Skip to content

Instantly share code, notes, and snippets.

@linuxmalaysia
Last active March 18, 2019 13:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save linuxmalaysia/cc31d91fb6553a28e2a0071b724a9087 to your computer and use it in GitHub Desktop.
Save linuxmalaysia/cc31d91fb6553a28e2a0071b724a9087 to your computer and use it in GitHub Desktop.
Logstash Conf Filter For Syslog Input
## https://github.com/minyk/morphline-mr/wiki/DictionariesOfGrok
## https://serverfault.com/questions/735230/why-cant-the-logstash-syslog-pri-filter-see-the-priority-in-syslog-messages
filter {
if "syslog" in [tags] {
grok {
match => {
"message" => [ "%{SYSLOG5424PRI}%{SYSLOGBASE2}", "%{SYSLOGBASE2}", "%{SYSLOGPAMSESSION}", "%{CRONLOG}", "%{SYSLOGLINE}" ]
}
tag_on_failure => [ "failedPattern_syslog" ]
add_field => [ "received_at", "%{@timestamp}" ]
}
### sso ### 2018-05-02T01:00:17+08:00
date {
locale => "en"
timezone => "Asia/Kuala_Lumpur"
match => ["timestamp", "MMM d HH:mm:ss", "MMM dd HH:mm:ss", "ISO8601"]
remove_field => ["timestamp"]
}
date {
locale => "en"
timezone => "Asia/Kuala_Lumpur"
match => ["timestamp8601", "ISO8601"]
remove_field => ["timestamp8601"]
}
syslog_pri {
syslog_pri_field_name => "syslog5424_pri"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment