Getting Data In

How can I achieve the query for retrieving data for a particular time for the last 6 days?

Subarna
Explorer

How can I achieve the query for retrieving data for a particular time for the last 6 days? Suppose I want to get the data for last 6 days from time 12.00 A.M to 4.00 P.M. Please help on the same

Labels (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Subarna,

you have to run a search for the full period adding a filter on the hosu, something like this:

index=your_index earliest=-6d@d latest=@d (date_hour>11 date_hour<17)
| ...

if you haven't date _hour, you have to extract it:

index=your_index earliest=-6d@d latest=@d 
| eval date_hour=strftime(_time,"%H")
| where date_hour>11 AND date_hour<17
| ...

Ciao.

Giuseppe

0 Karma
Get Updates on the Splunk Community!

🌟 From Audit Chaos to Clarity: Welcoming Audit Trail v2

&#x1f5e3; You Spoke, We Listened Audit Trail v2 wasn’t written in isolation—it was shaped by your voices. In ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

 Prepare to elevate your security operations with the powerful upgrade to Splunk Enterprise Security 8.x! This ...

Get Early Access to AI Playbook Authoring: Apply for the Alpha Private Preview ...

Passionate about security automation? Apply now to our AI Playbook Authoring Alpha private preview ...