Skip to content

Instantly share code, notes, and snippets.

@catherinetcai
Last active February 1, 2017 23:31
Show Gist options
  • Save catherinetcai/ced3d14e2963202ad1453ace71c51a51 to your computer and use it in GitHub Desktop.
Save catherinetcai/ced3d14e2963202ad1453ace71c51a51 to your computer and use it in GitHub Desktop.
Slurping rsyslog 7.4.4
input {
tcp {
port => 5514
type => syslog
}
}
filter {
if [type] == "syslog" {
grok {
match => { "message" => "<%{POSINT:syslog_lvl}>%{SYSLOGTIMESTAMP:syslog_timestamp} %{DATA:hostname} (%{GREEDYDATA:program}:) %{GREEDYDATA:message_remainder}" }
add_tag => [ "%{program}" ]
}
mutate {
replace => { "message" => "%{message_remainder}" }
remove_field => [ "message_remainder", "@version", "syslog_timestamp" ]
}
}
}
output {
stdout { codec => rubydebug }
}
{
"hostname" => "collect-1: message repeated 33",
"@timestamp" => 2017-02-01T23:27:21.168Z,
"port" => 51601,
"host" => "127.0.0.1",
"syslog_lvl" => "13",
"program" => "times",
"message" => "[ COLLECT SIDE]",
"type" => "syslog",
"tags" => [
[0] "times"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment