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!

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...

Cloud Monitoring Console - Unlocking Greater Visibility in SVC Usage Reporting

For Splunk Cloud customers, understanding and optimizing Splunk Virtual Compute (SVC) usage and resource ...

Automatic Discovery Part 3: Practical Use Cases

If you’ve enabled Automatic Discovery in your install of the Splunk Distribution of the OpenTelemetry ...