Splunk Search

How do I search for the first occurrence of a field that is not null or empty?

faustof
Explorer

I have a field "Company Name" that is empty on some events, but has a value on others. How do I search for the first occurrence of that field that is not null or empty?

sourcetype=[my source] [filter field] = 322799761 
| table customer.companyName
0 Karma
1 Solution

sundareshr
Legend

Try this

sourcetype=[my source] [filter field] = 322799761 customer.companyName=* | table customer.companyName | head 1

View solution in original post

0 Karma

sundareshr
Legend

Try this

sourcetype=[my source] [filter field] = 322799761 customer.companyName=* | table customer.companyName | head 1
0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...