Splunk Search

Case with a multivalue field in calculated field not working

wealot
Explorer

For CIM compliance I am trying to fill the action field from some logs using a case. This works in search but not in the calculated field, I see some others had similar issues but there has not been an answer on here. I am on Cloud so cannot directly change the confs, but calculated fields so far have been working fine.

Simple case statements that do not have multivalue fields with objects (e.g. category instead of entitis{}.remediationStatus) work as expected in calculated fields.

The events have a similar setup like this:

{"entities": [{"name": "somename"}, {"name": "other naem", "remediationStatus": "Prevented"}]}

 

Search (WORKS):

 

eval action=case('entities{}.remediationStatus'=="Prevented", "blocked", 'entities{}.deliveryAction'=="Blocked", "blocked", 'entities{}.deliveryAction'=="DeliveredAsSpam", "blocked", true(), "allowed")

 

Calculated field (Doesn't WORK):

action=case('entities{}.remediationStatus'=="Prevented", "blocked", 'entities{}.deliveryAction'=="Blocked", "blocked", 'entities{}.deliveryAction'=="DeliveredAsSpam", "blocked", true(), "allowed")
Labels (2)
0 Karma
1 Solution

wealot
Explorer

It seems I made a mistake and kept the action= in the calculated field, which is why it didn't work.

Next to that while testing more it is important to wait for the test searches to time out of the caching or to change the searches.

View solution in original post

0 Karma

wealot
Explorer

It seems I made a mistake and kept the action= in the calculated field, which is why it didn't work.

Next to that while testing more it is important to wait for the test searches to time out of the caching or to change the searches.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...