Splunk Search

Search for events after a certain time

jboustead
Explorer

Is it possible to run a search that will only include all the events for that day after a certain time? (using the time range picker to select the date only, so the time will be selected using the search query)

For example I am wanting the search to pick events after 8am for the day selected by the time range picker, 

Labels (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

If your events have the date_hour field (and it's reliable) then you can use it to filter events.

... | where date_hour >= 20 | ...

If you don't have that field then you can make your own.

... | eval date_hour = strftime(_time, "%H")
| where date_hour >= 20
---
If this reply helps you, Karma would be appreciated.

inventsekar
SplunkTrust
SplunkTrust

Hi @jboustead ,
"using the time range picker to select the date only, so the time will be selected using the search query"

if your events got hour value as a separate field, then, with "where" command, it may be possible. 

BUT that's a long and difficult route. 

The earliest and latest offers all possible combinations of time/date we can ever imagine. 

 

This example searches an index for the last 24 hours but omits any events returned from Midnight to 1:00 A.M., when downtime returns false log entries.

index=myindex ((earliest=-24h latest<@d) OR (earliest>=@d+1h))

This search specifies two time ranges:

  • 24 hours before the search is run, up to midnight
  • The beginning of the day that the search is run, starting at 1 hour after midnight or 1:00 A.M.

https://docs.splunk.com/Documentation/SplunkCloud/8.1.2009/Search/Specifytimemodifiersinyoursearch

 

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...

Network to App: Observability Unlocked [May & June Series]

In today’s digital landscape, your environment is no longer confined to the data center. It spans complex ...

SPL2 Deep Dives, AppDynamics Integrations, SAML Made Simple and Much More on Splunk ...

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...