Last active
December 6, 2016 07:09
-
-
Save wellcomer/2c665c5d4297a4085585 to your computer and use it in GitHub Desktop.
grok-filters
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
input { | |
file { | |
path => [ "/var/log/syslog" ] | |
start_position => end | |
type => "syslog" | |
} | |
} | |
filter { | |
grok { | |
match => { "message" => "%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}(?:\[%{POSINT:syslog_pid}\])?: %{GREEDYDATA:syslog_message}" } | |
} | |
syslog_pri { } | |
date { | |
locale => "en" | |
match => [ "syslog_timestamp", "MMM dd HH:mm:ss", "MMM d HH:mm:ss", "ISO8601" ] | |
} | |
if [syslog_program] == "dhcpd" { | |
grok { | |
match => { "syslog_message" => "%{WORD:dhcp_action} (for|on|from|to|of) (%{IPV4:dhcp_client_ip} )?(.*%{COMMONMAC:dhcp_client_mac}( \(%{HOSTNAME:dhcp_client_name}\))?.*)?via %{USERNAME:interface}" } | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment