Splunk Search

extract events for specific time period

remy06
Contributor

I've just configured splunk to index a file that contains events for the last 30 days. Within these events I want to search for all events that fall between 8pm and 8am only.

The format of events are such:

4/30/2012 6:48:32 PM,"xxxxx\xxxxxx","xxxxx",........."
4/30/2012 8:50:30 PM,"xxxxx\xxxxxx","xxxxx",........."
....

Splunk has automatically extracted this field "Date_time" > "4/30/2012 6:48:32 PM"

Any idea?

Tags (2)
0 Karma

kristian_kolb
Ultra Champion

Unless they're WinEventLogs, there should also be a field called date_hour, which can be used;

sourcetype=your_sourcetype date_hour > 20 OR date_hour < 8 | ...

EDIT: corrected the hour value

Hope this helps,

Kristian

kristian_kolb
Ultra Champion

oops, see edit above. /k

0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...