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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...