Splunk Search

Distinct Events Days in Index

fredclown
Builder

I'm trying to write an efficient search to find out the distinct days of events that I have in an index. Basically, I want to be able to see if I am missing data for any days. I could pipe the date in mm/dd/yyyy format to a table and then use dedup, but that is SLOW and my hunch is there is a better and faster way to do it.

Tags (2)
0 Karma
1 Solution

somesoni2
Revered Legend

Try this one. decent performance.

index=yourindex| stats first(_time) as _time by date_mday | convert timeformat="%Y/%m/%d" mktime(_time) as Date

View solution in original post

somesoni2
Revered Legend

Try this one. decent performance.

index=yourindex| stats first(_time) as _time by date_mday | convert timeformat="%Y/%m/%d" mktime(_time) as Date

fredclown
Builder

Yeah, that is MUCH faster than my previous attempt. Thanks sir.

0 Karma

lukejadamec
Super Champion

You could create a summary index, and then back fill it with data in the background. It would take a while to backfill, but it does that in the background. Once it is done, it would be very fast to search, and re-search. Here is the link to the summary index page.

http://docs.splunk.com/Documentation/Splunk/6.0.1/Knowledge/Usesummaryindexing

0 Karma
Get Updates on the Splunk Community!

Index This | What did the zero say to the eight?

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

Splunk Observability Cloud's AI Assistant in Action Series: Onboarding New Hires & ...

This is the fifth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Now Playing: Splunk Education Summer Learning Premieres

It’s premiere season, and Splunk Education is rolling out new releases you won’t want to miss. Whether you’re ...