Splunk Enterprise

Why am I getting null values in my results?

human96
Communicator

 

I have a search

index="xyz" sourcetype="csv"
| fillnull value="unknownMan" field1 field2 field3 field4
| eventstats dc(field1) as xyz by field2 field3 field4
| table  field1 field2 field3 field4

while running this, i'm getting NULL values in the results?

Please help me with this why NULL values will be coming when there is no NULL values in the events??

Labels (1)
0 Karma

johnhuang
Motivator

When you say "NULL" value, I am assuming you mean the value is blank/empty rather than literal.

Try this to set all the empty values to null. 

index="xyz" sourcetype="csv"
| foreach * [eval <<FIELD>>=IF(<<FIELD>>="", NULL(), <<FIELD>>)]
| fillnull value="unknownMan" field1 field2 field3 field4
| eventstats dc(field1) as xyz by field2 field3 field4
| table field1 field2 field3 field4

0 Karma
Get Updates on the Splunk Community!

Splunk at Cisco Live 2025: Learning, Innovation, and a Little Bit of Mr. Brightside

Pack your bags (and maybe your dancing shoes)—Cisco Live is heading to San Diego, June 8–12, 2025, and Splunk ...

Splunk App Dev Community Updates – What’s New and What’s Next

Welcome to your go-to roundup of everything happening in the Splunk App Dev Community! Whether you're building ...

The Latest Cisco Integrations With Splunk Platform!

Join us for an exciting tech talk where we’ll explore the latest integrations in Cisco &#43; Splunk! We’ve ...