Hello,
I am currently using security onion for pulling in zeek logs to our SIEM, and they are very particular about the JSON formatting of the data to have it show up properly parsed in the SIEM.
For my logstash pipeline custom output config, we would normally have our output set as so:
output {
if [event][module] == "zeek" {
tcp {
id => "cloned_events_out"
host => "192.168.x.x"
port => 1514
codec => "json_lines"
}
}
}
However, due to the SIEM not liking all of the additional info that gets tacked onto the logs other than just the zeek log message itself, I have had to modify it to send the logs like so:
output {
if [event][module] == "zeek" {
tcp {
id => "cloned_events_out"
host => "192.168.x.x"
port => 1514
codec => line { format => "%{pipeline} - %{message}"}
}
}
}
This has worked great for getting logs parsed in our SIEM, but now we are lacking some information that I would like to be in the log, specifically the information inside of %{host}, which includes the name of the security onion sensor that observed the zeek traffic.
This data is included in the whole log, but not the log %{message} component of the logs. I am wondering how it would be possible to pull that %{host} field from the log and include it at the end of the %{message} part of the log.
My original try was to just modify the codec line like so:
codec => line { format => "%{pipeline} - %{message} %{host}"}
but then it messed up the JSON formatting and contains a bunch of info I don't need. (Green box is the expected, message part of the log, the red is all the extra stuff that comes along with the host part of the log that I don't need the majority of...)
I really am only interested in having a line at the end of the zeek message itself that says:
observer: <name>
Unfortunately I have not had to do very much with logstash since all of the elastic stuff comes prebuilt into security onion out of the box, so apologies for being a newbie to elastic. I appreciate any guidance or tips on how to achieve what I am setting out to do! Thank you in advance!