Splunk Search

How to fill count number of previous month when there is no data?

boxmetal
Path Finder

Hi Splunk community,

I have a chart display the number of users in each month. There was no data coming in in October and November, and I want to show the number of September for October and November for the chart to have a continuous trend.

Here's my query:

 

<my search>
| timechart span=1mon dc(UserID) as "Number of Users"

 

The current chart looks like this:

boxmetal_0-1675849098874.png

 

Labels (2)
0 Karma
1 Solution

boxmetal
Path Finder

This also needs additional steps to set the zero values to null in the timechart

https://community.splunk.com/t5/Splunk-Search/Timechart-filldown/m-p/521182

<my search>
| timechart span=1mon dc(UserID) as Count
| eval Count=if(Count==0, NULL, Count)
| filldown

 

View solution in original post

0 Karma

scelikok
SplunkTrust
SplunkTrust

Hi @boxmetal,

You can try below;

<my search>
| timechart span=1mon dc(UserID) as "Number of Users" 
| filldown
If this reply helps you an upvote and "Accept as Solution" is appreciated.

boxmetal
Path Finder

This also needs additional steps to set the zero values to null in the timechart

https://community.splunk.com/t5/Splunk-Search/Timechart-filldown/m-p/521182

<my search>
| timechart span=1mon dc(UserID) as Count
| eval Count=if(Count==0, NULL, Count)
| filldown

 

0 Karma

yuanliu
SplunkTrust
SplunkTrust
0 Karma
Get Updates on the Splunk Community!

Accelerating Observability as Code with the Splunk AI Assistant

We’ve seen in previous posts what Observability as Code (OaC) is and how it’s now essential for managing ...

Integrating Splunk Search API and Quarto to Create Reproducible Investigation ...

 Splunk is More Than Just the Web Console For Digital Forensics and Incident Response (DFIR) practitioners, ...

Congratulations to the 2025-2026 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...