Splunk Search

Not displaying key with no value

mark112
Engager

I am writing to ask a question, which is probably an easy one. I am curious, how would you search for all occurances of a key in a particular index, while excluding identified keys that contain no value. For example, if I wanted to table all the keys named target_keys in the index, target_index, I may use the following search:

index = target_index | table target_keys

This would produce a table of all the key value pairs for target_keys. But How would I exclude the table command returning target_keys occurances that contain no value? Or that contain a specific value for which I am trying to exclude from the table?

Thanks in advance for any assistance!

Tags (3)
0 Karma

mark112
Engager

I will test this. Thank you, VERY much

0 Karma

lguinn2
Legend

Here are a few ideas

index=target_index | where isnull(target_key) | table target_keys

or

index=target_index | where isnotnull(target_key) | table target_keys

or

index=target_index target_key="goodvalue" | table target_keys

or

index=target_index NOT target_key="badvalue" | table target_keys
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

.conf25 Global Broadcast: Don’t Miss a Moment

Hello Splunkers, .conf25 is only a click away.  Not able to make it to .conf25 in person? No worries, you can ...

Observe and Secure All Apps with Splunk

 Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What's New in Splunk Observability - August 2025

What's New We are excited to announce the latest enhancements to Splunk Observability Cloud as well as what is ...