Skip to content

Instantly share code, notes, and snippets.

@VAdamec
Created December 23, 2014 05:54
Show Gist options
  • Save VAdamec/f0053cc78454ca07a4be to your computer and use it in GitHub Desktop.
Save VAdamec/f0053cc78454ca07a4be to your computer and use it in GitHub Desktop.
Nagios simple log parsing
input {
zeromq {
type => 'zmq'
topology => 'pushpull'
address => 'tcp://*:5556'
mode => 'server'
}
}
output {
elasticsearch {
cluster => "ELA003"
index => "nagios-logstash-%{+YYYY.MM.dd}"
tags => ["nagios"]
}
stdout {
debug => true
debug_format => "json"
tags => ["nagios"]
}
}
filter {
grok {
tags => ["nagios"]
match => [ "@message", "\[%{NUMBER:timestamp}\]\s%{DATA:type}\:\s%{DATA:host}\;%{DATA:check}\;%{DATA:level}\;%{DATA:alert}\;%{DATA:repeat}\;%{GREEDYDATA:comment}" ]
}
mutate {
remove => ["timestamp"]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment