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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...