Does anyone have a Grok filter compatible with Cortex XDR syslog entries?
I'm piping Cortex XDR syslog into logstash and then through to Elasticsearch for parsing & alerting, but there seems to be two nested log formats. One pipe-separate and then inside that a space-separated list of fields (including some values that themselves contains spaces and aren't quote-encapsulated)
Looks tricky to pick apart, so I was wondering if anyone else has already had a shot at this
Example data (sanitised) showing the initial pipe-separated data;
It's formatted using CEF. Logstash has a CEF codec plugin but it mostly just rewrites the keys or field names. Any items withe the string "Label" in the key are in fact providing the key name for the related non-label key=value
So:
cs6Label=Pants
cs6=True
Can actually be consolidated to
Pants: True
I recommend checking out nxlog as it has a very straight forward CEF->JSON conversion that would allow you to feed in json to logstash and hit the ground running.
Then you could construct a bunch of mutate filters like below to consolidate those fields.....
# Match labels to values and remove other fields
if([deviceCustomString1] and [deviceCustomString1Label]) {
mutate {
add_field => [ "%{deviceCustomString1Label}","%{deviceCustomString1}"]
remove_field => ["deviceCustomString1Label"]
remove_field => ["deviceCustomString1"]
}
}
You are correct in that everything starting with and after the string CEF is the Arcsight CEF format. The portion prior to that is a syslog header. If you use the current stable filebeat it includes native CEF parsing to ECS.
I have to say I was quite surprised at PAN's selection of CEF for the syslog messages but JSON for the email alerts. It also surprised me that their were far fewer fields provided in the CEF messages than the JSON emails (albeit a ton of fields are null),
I suspect the JSON format was chosen for it's flexibility, as Cortex alerts come in multiple types (Malware [both Local and Wildfire], Firewall/Strata, Analytics (e.g. Recurring Rare IP Address or Large Upload). Each type has it's own unique set of fields - you get source & dest port in Firewall log alerts, but not in Local Malware, for example
Keeping the CEF format makes sense as I'm sure PANW has many 'Enterprise' customers running centralised logging servers that incorporate logs from multiple vendors. To cover that situation they'd want to be able to 'fall back' to something standardised such as CEF. There are also multiple logging formats available for syslog servers, although I haven't tested out the 'legacy' format yet to see how different it is
Click
Accept as Solution
to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the
LIVEcommunity
as a whole!
The
LIVEcommunity
thanks you for your participation!