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!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

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

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...