Splunk Search

stats command to get count of NULL values

anoopambli
Communicator

I am using a DB query to get stats count of some data from 'ISSUE' column. This column also has a lot of entries which has no value in it.

something like,

ISSUE

Event log alert

Skipped count

how do i get the NULL value (which is in between the two entries also as part of the stats count. Is there any way?

Tags (1)
1 Solution

lukejadamec
Super Champion

In your search use the fillnull command and assign a value to that field when it is null, then count that value for the field.

search issue="*" | fillnull value=null issue | stats count by issue

View solution in original post

JChapp23
Loves-to-Learn Lots

Is there a way to rename the NULL to display something else?

 

0 Karma

lukejadamec
Super Champion

In your search use the fillnull command and assign a value to that field when it is null, then count that value for the field.

search issue="*" | fillnull value=null issue | stats count by issue

anoopambli
Communicator

awesome, that fixed it 🙂 thanks a lot.

0 Karma
Get Updates on the Splunk Community!

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...