Splunk Search

How show 0 when not result

Luninho
Explorer

I need show any value in every minute, but I only get value > 0
Search:
| tstats count WHERE index=XXXXX C_TXN_A IN (1,2) C_TXN_B IN (1)
((C_TXN_C IN (1,2,3,5) AND C_TXN_D IN (5,6)) OR (NOT C_TXN_C IN (4,6) AND C_TXN_D IN (7,8)))
by _time span=1m 
| sort _time

After that, I  get:
2020-10-29 10:45:00     47
2020-10-29 10:40:00     12

But I want to get:
2020-10-29 10:45:00     47
2020-10-29 10:44:00     0
2020-10-29 10:43:00     0
2020-10-29 10:42:00     0
2020-10-29 10:41:00     0
2020-10-29 10:45:00     12

How to do it?

Labels (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

The timechart command will do that.

| tstats prestats=t count WHERE index=XXXXX C_TXN_A IN (1,2) C_TXN_B IN (1)
((C_TXN_C IN (1,2,3,5) AND C_TXN_D IN (5,6)) OR (NOT C_TXN_C IN (4,6) AND C_TXN_D IN (7,8)))
by _time span=1m 
| timechart span=1m count
---
If this reply helps you, Karma would be appreciated.
0 Karma

Luninho
Explorer

You helped me however I improved your idea:
|timechart span=1m sum(count)
|fillnull

0 Karma
Get Updates on the Splunk Community!

Reduce and Transform Your Firewall Data with Splunk Data Management

Managing high-volume firewall data has always been a challenge. Noisy events and verbose traffic logs often ...

Automatic Discovery Part 1: What is Automatic Discovery in Splunk Observability Cloud ...

If you’ve ever deployed a new database cluster, spun up a caching layer, or added a load balancer, you know it ...

Real-Time Fraud Detection: How Splunk Dashboards Protect Financial Institutions

Financial fraud isn't slowing down. If anything, it's getting more sophisticated. Account takeovers, credit ...