Last active
March 18, 2019 13:32
-
-
Save linuxmalaysia/cc31d91fb6553a28e2a0071b724a9087 to your computer and use it in GitHub Desktop.
Logstash Conf Filter For Syslog Input
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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