Splunk Search

timechart - show every week, even if there is no value

matansocher
Contributor

Hi,

I am creating a timechart and in some of my weeks I have no value for a field ("Number Of Lines").
I need the timechart to present every week, and when there is no value for a week, fill it with value of 0 in the field "Number Of Lines".

I have tried fillnull but it is not working.

my query:

index=testeda_p groupID=sloc_data 
| eval _time = strptime(dateformat, "%m-%d-%Y") 
| timechart span=1w sum(sloc) as "Number Of Lines"

Thanks

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi matansocher,
try

index=testeda_p groupID=sloc_data 
| timechart span=1w sum(sloc) as "Number Of Lines"

Bye.
Giuseppe

0 Karma

matansocher
Contributor

I must use the line with the "dateformat" field. I use that sting date and not the upload to splunk date.

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...