Dashboards & Visualizations

Handling Nulls

Rgk_Trail
Explorer

Hi,

I am combining fields using strcat as shows below and I want to have "N/A" in the same field if result of strcat is Null. But for some reason, isnull or isnotnull command used after strcat is not identifying null values. 

Am I missing something here ? 

|strcat Key_1 Key_2 Key_3 Key_4 Testing_Key
|eval Testing_Key=if(isnotnull(Testing_Key),Testing_Key,"N/A")

Result should be either value of Testing_Key when its not null and it should "N/A" when Testing_Key is Null.

Thanks,

Rohan Kinhikar

Labels (1)
Tags (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

I suspect that strcat creates an empty string rather than a null field.  You can verify/workaround that using

|strcat Key_1 Key_2 Key_3 Key_4 Testing_Key
|eval Testing_Key=if(Testing_Key=="","N/A",Testing_Key)
---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Unlock Database Monitoring with Splunk Observability Cloud

  In today’s fast-paced digital landscape, even minor database slowdowns can disrupt user experiences and ...

Purpose in Action: How Splunk Is Helping Power an Inclusive Future for All

At Cisco, purpose isn’t a tagline—it’s a commitment. Cisco’s FY25 Purpose Report outlines how the company is ...

[Upcoming Webinar] Demo Day: Transforming IT Operations with Splunk

Join us for a live Demo Day at the Cisco Store on January 21st 10:00am - 11:00am PST In the fast-paced world ...