I have a cef log being sent to us but I can't get the kv plugin to work. When I apply this config, I don't get any errors but I don't see any logs from it so it's breaking it somehow. Below is the config I'm giving it and an example log. I have a priority value first followed by logs in the k=v format. Message does get broken down into syslog_pri and syslog_message but as soon as I apply any variation of kv{} I don't get any logs. Any suggestions?
filter {
if "syslog" in [tags] {
if ([message] =~ /XG330/) {
mutate {
add_tag => [ "sophos" ]
}
grok {
match => {"message" => "<%{POSINT:syslog_pri}>%{GREEDYDATA:syslog_message}"}
}
kv {
source => "syslog_message"
}
}
}
I don't have direct console access to this because we use a salt master-minion configuration to manage these. I can write to a log file and have tried this config but I get errors (below) when trying to restart the logstash service. We already have another config running an output statement so it may be conflicting with that but I can't disable that one to test.
Thanks that did it to create the file but the file became too large (~100 mb per minute) so I added the same if statement from the filter to the output section and that gave me just these logs. When reviewing them I do see they are getting parsed but not sure why they aren't making it to our Kibana. If I remove the kv section, I get them?!?
If you are not seeing them in Kibana then it could be because the events are not reaching elasticsearch (e.g. a mapping exception). Running a query in the developer console of Kibana might tell you whether the events are in elasticsearch. If they are in elasticsearch but you are not seeing them in Kibana then the query you are running (either the filter or the time picker) does not include them.
That was it. We had a conflict of one of these new fields with the index we were putting this logs into and moving to it's own index resolved this. Thanks for all your help on this!
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.