Getting Data In

Use of Timewrap command to control the time range

Shashank_87
Explorer

Hi, I am trying to plat a graph of response time over a period of time. I am using timewrap command to plot it for yesterday, day before yesterday and last week.
The problem is I only want it for a certain period of time on the day. For Example between 12:00 PM to 10:00 PM (peak hours).
I am snapping the time in the search itself like this earliest=-7d@d+3h latest=@d but is not working. Please see the graph - on the x-axis it is still plotting from 12:00 AM but what i want is from 12:00 PM.

earliest=-7d@d+3h latest=@d

Any help is appreciated.alt text

0 Karma

to4kawa
Ultra Champion
your search
| where relative_time(now(),"-8d@d+12h") <= _time

earliest=-8d@d+3h is 03:00 AM, but timechart starts at 00:00 AM.
I don't know why.

Why not limit the display period?

0 Karma

jkat54
SplunkTrust
SplunkTrust

Please share the spl queries you've attempted

0 Karma

Shashank_87
Explorer

@jkat54 This is the query -
index=tp_test sourcetype=access_combined_wcookie earliest=-8d@d+3h latest=@d
| timechart span=15m avg(response_time_sec) as AvgResponseTime
| timewrap d
| fields _time,AvgResponseTime_latest_day,AvgResponseTime_1day_before,AvgResponseTime_7days_before

0 Karma

jkat54
SplunkTrust
SplunkTrust

I think you need a number in front of the units:

| timewrap 1d

0 Karma

Shashank_87
Explorer

I dont think that matters. The problem is I want to compare the results from 12:00 PM to 10:00 PM.
Right now it's coming for full day which i don't want.
I think this is what needs to be modified : earliest=-8d@d+3h latest=@d

0 Karma

jkat54
SplunkTrust
SplunkTrust

timewrap 10h

12p -10p is 10 hours

drop earliest and latest from your search and update timewrap to 10h

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...