Skip to content

Instantly share code, notes, and snippets.

@lusis
Created April 25, 2014 04:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lusis/11277790 to your computer and use it in GitHub Desktop.
Save lusis/11277790 to your computer and use it in GitHub Desktop.
omrelp rsyslog config
$ModLoad omrelp
$RepeatedMsgReduction off
$template ls_json,"{\"@version\":1,\"@timestamp\":\"%timestamp:1:19:date-rfc3339%.%timestamp:1:3:date-subseconds%+00:00\",%HOSTNAME:::jsonf:source_host%,\"message\":\"%timestamp% %app-name%:%msg:::json%\",%syslogfacility-text:::jsonf:facility%,%syslogseverity-text:::jsonf:severity%,%app-name:::jsonf:program%,%procid:::jsonf:processid%}"
*.* :omrelp:127.0.0.1:20514;ls_json
input {
relp { port => 20514 codec => "json" add_field => {"es_component" => "syslog"}}
redis {
data_type => "list"
key => "logstash_plain"
}
redis {
data_type => "list"
key => "logstash_jsonevent"
codec => "json"
}
}
filter {
if [source_host] =~ /\d+\.\d+\.\d+\.\d+/ { dns { action => "replace" reverse => [ "source_host"] } }
if [source_host] =~ /[^.]+\..*/ { mutate { gsub => [ "source_host", "([^.]+)\..*", "\1" ] } }
}
output {
#stdout { debug => true }
elasticsearch_http { codec => "json" host => "localhost" }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment