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
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 ...