Splunk Search

earliest - latest question

kstanley
New Member

I'm a newby so forgive my ignorance with Splunk. I'm running this real time and only want it to run from 6:30am to 10pm mon-sat. This is what I have on the end and it's not working. Any suggestions will be greatly appreciated.

earliest=@d+6h+30m latest=@d+22h date_wday!=sunday

Tags (2)
0 Karma

DalJeanis
Legend

1) It's not clear whether you are saying you want to ignore data that is not in that time frame, or you want to turn the search off if the wall clock is not in that time frame?

2) Your concentration on such a wide amount of time suggests to me that a realtime search is inappropriate to what you are actually doing. So, what are you actually doing?

0 Karma

somesoni2
Revered Legend

Are you running it as a 'real time search' and you want that search to run for specified duration? OR you're running a regular search and just want data from specified period to be included?

0 Karma

cmerriman
Super Champion

try this:

|eval keep=if((_time>=relative_time(_time,"@d+6h+30m") AND _time<=relative_time(_time,"@d+22h")) AND date_wday!="sunday",1,0)|search keep=1
0 Karma

kstanley
New Member

Thank you, I'll give that a try

0 Karma
Get Updates on the Splunk Community!

Unlock Database Monitoring with Splunk Observability Cloud

  In today’s fast-paced digital landscape, even minor database slowdowns can disrupt user experiences and ...

Purpose in Action: How Splunk Is Helping Power an Inclusive Future for All

At Cisco, purpose isn’t a tagline—it’s a commitment. Cisco’s FY25 Purpose Report outlines how the company is ...

[Upcoming Webinar] Demo Day: Transforming IT Operations with Splunk

Join us for a live Demo Day at the Cisco Store on January 21st 10:00am - 11:00am PST In the fast-paced world ...