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!

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...