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!

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