All Apps and Add-ons

Same hour for the last 7 days

kochera
Communicator

Hi,

I would like to compare the same hour for the last seven days. Is there a chance of using timewrap for this?

cheers,
Andy

Tags (1)
1 Solution

MuS
Legend

Hi kochera,

Yes, you can use timewrap for this. Take a look at this run everywhere example:

index=_internal earliest=-7d@d latest=-0d@d source=*metrics.log | timechart span=1h sum(kb) by series | timewrap w | where strftime(_time, "%H") == "10"

This will get you a nice chart of the sum for kb per series out of the metrics.log and compares the results for each day at hour 10 over the last 7 days.

hope this helps ... and @carasso can agree on this ...

cheers, MuS

View solution in original post

MuS
Legend

Hi kochera,

Yes, you can use timewrap for this. Take a look at this run everywhere example:

index=_internal earliest=-7d@d latest=-0d@d source=*metrics.log | timechart span=1h sum(kb) by series | timewrap w | where strftime(_time, "%H") == "10"

This will get you a nice chart of the sum for kb per series out of the metrics.log and compares the results for each day at hour 10 over the last 7 days.

hope this helps ... and @carasso can agree on this ...

cheers, MuS

linu1988
Champion

Kristian's one will be efficient as it will get all the required values before creating the chart.

0 Karma

kristian_kolb
Ultra Champion

You might even make do with using the date_* default fields;

index=_internal earliest=-7d@d date_hour=10 | stats c by date_mday

It all depends on how you want to process and report on your data.
/k

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!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

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 ...