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
Get Updates on the Splunk Community!

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...

Splunk MCP & Agentic AI: Machine Data Without Limits

Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization uses ...