Splunk Search

How to remove blank cells in the statistics table?

ccsfdave
Builder

Greetings,

I am running the search attached in the image (I'll paste the text below as well).

index=security sourcetype=cisco mickey_mouse duration=* | rex "\((?<username>[\w_]+)\)$" |timechart span=1d sum(duration) as sumdur | eval "Time Connected"=tostring(sumdur, "duration") |fields - sumdur |rename _time as Date | convert timeformat=%m/%d/%Y ctime(Date)

I am getting results for many days, not all. This looks at VPN connections and totals the time connected per day. It could be that missing dates means there was no connection and blanks in "Time Connected" means it was a very brief connection. Can anyone think of a way to remove the blanks or have them say 0?

Thanks,

Dave

Note blank cell for time connected on 1/21/15

Tags (2)
0 Karma
1 Solution

MuS
Legend

Hi ccdfdave,

Take a look at the fillnull command http://docs.splunk.com/Documentation/Splunk/6.2.1/SearchReference/Fillnull and try something like this at the end :

 ..... | fillnull value=0 "Time Connected"

cheers, MuS

View solution in original post

MuS
Legend

Hi ccdfdave,

Take a look at the fillnull command http://docs.splunk.com/Documentation/Splunk/6.2.1/SearchReference/Fillnull and try something like this at the end :

 ..... | fillnull value=0 "Time Connected"

cheers, MuS

ccsfdave
Builder

MuS,

That indeed filled the blank cells with zeros. I would kinda like to get rid of those rows but short of that, I can accept the 0.

Thanks,

Dave

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...