Hello,
For some reason in my case logstash keeps not compling when I try to use a custom pattern. So I tried to implement a needed pattern as a field (the easier one now for testing, just a letter with a '-' in front of it), but it doesn't seem to work. Logstash compiles, but logs do not match.
grok {
remove_tag => ["_grokparsefailure"]
match => {
"message" => ["%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}(?:\[%{POSINT:syslog_pid}\])?: xCAT: Allowing %{GREEDYDATA:xCAT_comm_exec} (?<o_option> (\-[O-Oo-o])) %{GREEDYDATA:x_CAT_used_nodes} for %{USERNAME:xcat_user} from %{SYSLOGHOST:xcat_user_hostname}"]
}
add_field => [ "received_at", "%{@timestamp}" ]
add_field => [ "received_from", "%{host}" ] }
}
Logs that are supposed to be parsed with that grok filter look like this:
May 11 12:14:42 head-testing xcat[12345]: xCAT: Allowing lsdef -t node -o n00p123,n01p123,n10p123,n01p123,ndfl-mic1,testnode1 for admin from localhost