Splunk Search

How to get the count of the last 30 days, for a 15 min period for each day- without using dc

dwibedi03
Explorer

My index is getting refreshed every 15 mins and new data gets populated every 15 mins.
I need to count the events for the last 15 mins for each day in a period of 30 days.

Currently, I am doing dc(field) for each day but it removes all the duplicates events and my count is not what I want.

I want to get the count of the last 30 days for a 15 mins period for each day without using dc.

Tags (3)
0 Karma
1 Solution

woodcock
Esteemed Legend

Like this (run for Last 30 days)?

... | timechart span=15m count BY source and maybe other fields here
| eval day = strftime(_time, "%Y%m%d")
| reverse
| dedup day

View solution in original post

0 Karma

woodcock
Esteemed Legend

Like this (run for Last 30 days)?

... | timechart span=15m count BY source and maybe other fields here
| eval day = strftime(_time, "%Y%m%d")
| reverse
| dedup day
0 Karma

richgalloway
SplunkTrust
SplunkTrust

dc is short for distinct_count, which counts the number of unique values, hence duplicates are not counted.
Consider using c or count, instead.

---
If this reply helps you, Karma would be appreciated.
0 Karma

dwibedi03
Explorer

I was doing count and it was giving a sum of whole day

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...