Splunk Search

eval isnull() always returns true

dmrhodes101
Explorer

We're using Splunk to monitor EDI traffic onto our backend system. We want to have a single value panel that shows green when an order has been received, yellow, when there's been no order and it's prior to 16:00 and red when there's been no order and it's 16:00+

Here's the command I used, but the isnull always returns 0 even when EDI-count is greater than 0.

source="C:\\Monitor\\Vista\\EDI\\EDISPLUNK.csv" NOT _raw="Date,Time,Type,Account,Name,Order Qty,EAN,SAN,Order Ref,Order Date,From1,From2" host="Vista-EDI2" AND Name="Companyname*" 
| stats count as EDI-count
| eval Time=now()
| convert timeformat=%H:%M ctime(Time)
| eval Got=if(isnull(EDI-count),0,1)
| eval Test=case(Got=0 and Time>="16:00",0,Got=0 and Time<"16:00",2,Got=1,4)
| rangemap field=Test low=4-5 elevated=2-3 default=severe
Tags (1)

youngc_splunk
Splunk Employee
Splunk Employee

@dmrhodes101 , it looks like you are trying to process EDI, we do have a solution accelerator for processing EDIs, love to share some of the content we have.  Let me know if you're interested.

0 Karma

sowings
Splunk Employee
Splunk Employee

I think that stats will give you a 0 for the count if there are no matching events, not null. Zero isn't null.

It also appears that Splunk may be interpreting the field name "EDI-count" as a subtraction of two undefined fields EDI and count. I had to remove the - (or change it to an underscore) to make it work in my testing.

The EDI_count field is effectively acting as a boolean already, but if you want to normalize it to (0|1), your eval call would look like:
eval Got=if(EDI_count,1,0), or eval Got=if(EDI_count==0,0,1) if you're the explicit type.

Note also that you can save a step with your Time field and do eval Time=strftime(now(), "%H:%M").

dmrhodes101
Explorer

That's perfect thanks.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

SOK it to Me: Top 3 Benefits of Using Splunk Operator on Kubernetes that’ll Make ...

    Thursday, July 9, 2026  |  11:00AM–12:00PM PDT Duration: 1 hour (includes Q&A) Managing can feel like a ...

Upgrade Prep for 10.4, Network Observability Deep Dives, and More from Splunk Lantern

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...

Splunk Developer Day announcements: AI agents, MCP tools, Forecasting, and Custom ...

Splunk Developer Day was packed with product and platform updates for developers building in the AI ...