Splunk Search

How to replace blank values with "0"?

harshparikhxlrd
Path Finder

Trying to replace the blank values on my dashboard with 0s. If table is empty, should display 0. On the logs data, it is simply blank.

Labels (1)
0 Karma
1 Solution

aberkow
Builder

Since you said you tried fillnull, I'm guessing they're being read in as empty strings. For that specific column, you can specifically try

| eval invalid=if(isnull(invalid) OR invalid="", 0, invalid)
Otherwise fillnull value=0 should fill any fields that are null. You can also check if the column is actually null or not by doing this:

| eval isInvalidNull=if(isnull(invalid), 1, 0)
and compute this column just to validate that theory

View solution in original post

aberkow
Builder

Since you said you tried fillnull, I'm guessing they're being read in as empty strings. For that specific column, you can specifically try

| eval invalid=if(isnull(invalid) OR invalid="", 0, invalid)
Otherwise fillnull value=0 should fill any fields that are null. You can also check if the column is actually null or not by doing this:

| eval isInvalidNull=if(isnull(invalid), 1, 0)
and compute this column just to validate that theory

TrangCIC81
Communicator

@aberkow wrote:

Otherwise fillnull value=0 should fill any fields that are null.



Works for me. 

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

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