Splunk Search

Help with eval (if)

efelder0
Communicator

I need some assistance with the eval (if) function. I have a CSV file that has been indexed with 100 records. In that CSV, there is a field (fieldX) that has values ranging 1-100. In my output, I only want to return records where fieldX is greater than or equal to 4.

I think the eval with IF function would work here. Maybe something like eval field1=if(fieldX <= 4, "1", "0")

Any suggestions would greatly be appreciated.

thx

Tags (1)
0 Karma
1 Solution

Ayn
Legend

Not sure if you actually need to use eval - if you only want to include the results where fieldX is greater than or equal to 4, couldn't you include it as a regular search filter?

... | search fieldX>=4

View solution in original post

Ayn
Legend

Not sure if you actually need to use eval - if you only want to include the results where fieldX is greater than or equal to 4, couldn't you include it as a regular search filter?

... | search fieldX>=4

efelder0
Communicator

yes, that seems to work fine. Thanks!

0 Karma
Get Updates on the Splunk Community!

There's No Place Like Chrome and the Splunk Platform

Watch On DemandMalware. Risky Extensions. Data Exfiltration. End-users are increasingly reliant on browsers to ...

The Great Resilience Quest: 5th Leaderboard Update

The fifth leaderboard update for The Great Resilience Quest is out &gt;&gt; &#x1f3c6; Check out the ...

Devesh Logendran, Splunk, and the Singapore Cyber Conquest

At this year’s Splunk University, I had the privilege of chatting with Devesh Logendran, one of the winners in ...