Splunk Search

How to return events with or without a value in a specific field?

KyleMcDougall
Path Finder

Hi all!

I'm trying to create a table with case_number and session as the two columns. 

Any event without a case_number won't show up in the table. How do I get them to show up? 

 

index=cui botId=123456789 case_number=* session=*
| table case_number session

 

 I tried using | fields case_number instead, but this didn't work either. 

Appreciate any help! 

Labels (2)
0 Karma

TDFlames
Engager

Hi,

 

What you can try is

| fillnull value=

don't fill anything after the =

I'm having the same issue and this works for me, let me know if it works for you.

0 Karma

somesoni2
Revered Legend

Your base search is looking for events where both case_number and session fields are available. To see everything, just remove that filter from base search, like this

index=cui botId=123456789 session=*
| table case_number session

 If you want to display some different value instead of blanks/null, try this version

 

index=cui botId=123456789 session=*
| eval case_number=coalesce(case_number,"Not Available")
| table case_number session

 

0 Karma

KyleMcDougall
Path Finder

For some reason, the case number field doesn't show up unless I add in "case_number=*'

Dually noted your eval command. I'm sure I'll end up using it if I can figure out how to get the blank case number values to populate. 

0 Karma

batabay
Path Finder

Hi,

You can fill empty fields with fillnull command, try this ; 

index=cui "your search" | fillnull case_number value=null | table case_number session

0 Karma

KyleMcDougall
Path Finder

This is really good to know! But, I still wasn't able to get events without a case number to show up. 

I think the case_number=* parameter is enforcing that a value is present for this field. 

0 Karma
Get Updates on the Splunk Community!

.conf25 Community Recap

Hello Splunkers, And just like that, .conf25 is in the books! What an incredible few days — full of learning, ...

Splunk App Developers | .conf25 Recap & What’s Next

If you stopped by the Builder Bar at .conf25 this year, thank you! The retro tech beer garden vibes were ...

Congratulations to the 2025-2026 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...