Skip to content

Instantly share code, notes, and snippets.

@leejo
Created February 5, 2014 14:26
Show Gist options
  • Save leejo/8824667 to your computer and use it in GitHub Desktop.
Save leejo/8824667 to your computer and use it in GitHub Desktop.
if [type] == "syslog" {
grok {
match => {
message => "%{SYSLOGTIMESTAMP:timestamp} %{SYSLOGHOST:hostname} (%{SYSLOGHOST:remote} )?%{DATA:program}(?:\[%{POSINT:pid}\])?: (%{YEAR}/%{MONTHNUM}/%{MONTHDAY} %{TIME} )?%{GREEDYDATA:message_no_ts}"
}
add_tag => [ "%{[tag]}","syslog","%{[program]}" ]
}
date {
# we use the value of timestamp in the @timestamp field
match => [ "timestamp","MMM dd HH:mm:ss","MMM d HH:mm:ss" ]
}
mutate {
# remove duplicate fields that we no longer need
remove_field => [ "tag","timestamp" ]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment