Splunk Search

How to Add missing date by each id and fill 0 or null?

Julia1231
Communicator

Hi everyone,

I have a list of id and event by day. But some days are missing for some id, now I want to fill 0 or null for the missing date to have continuous day for every id.

_time id value
01/04/2022 1 10
01/04/2022 2 20
01/04/2022 3 30
02/04/2022 1 15
02/04/2022 2 30
03/04/2022 3 45
04/04/2022 1 25
04/04/2022 2 45
04/04/2022 3 65

Expecting:

_time id value
01/04/2022 1 10
01/04/2022 2 20
01/04/2022 3 30
02/04/2022 1 15
02/04/2022 2 30
02/04/2022 3  
03/04/2022 1  
03/04/2022 2  
03/04/2022 3 45
04/04/2022 1 25
04/04/2022 2 45
04/04/2022 3 65

 

thanks a lot.

0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| timechart span=1d values(value) as value by id
| fillnull value=0
| untable _time id value

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust
| timechart span=1d values(value) as value by id
| fillnull value=0
| untable _time id value
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Observability Simplified: Combining User Experience, Application Performance & ...

Tech Talk Observability Simplified: Combining User Experience, Application Performance & Network ...

Event Series May & June: From Network Visibility to Service Intelligence

Unifying the Network: Moving from Alert Noise to Service Intelligence with Splunk ITSI In today’s hybrid ...