All Apps and Add-ons

Can timewrap be utilized to only use weekdays?

aferone
Builder

Can timewrap be utilized to only use weekdays?

Specifically, if I am searching from a Monday for a daily report, can I skip Saturday and Sunday and use the timewrap utility to chart Friday? We want to be able to skip Saturdays and Sundays when we use the daily comparison of timewrap.

Thanks!

Tags (1)
1 Solution

martin_mueller
SplunkTrust
SplunkTrust

You could do something like this, run over -7d@d to @d+d in my case:

| tstats prestats=t count where index=_internal by _time span=1h | timechart span=1h count
| eval wday = strftime(_time, "%a") | where wday != "Sat" AND wday != "Sun" | fields - wday
| timewrap d

The first line loads an example timechart, the second throws out Saturdays and Sundays, and finally it runs timewrap. I get a chart for latest_day, 1day_before, 2days_before, 5days_before, 6days_before, 7days_before - note how 3 and 4 days before are missing, those would be Saturday and Sunday.

View solution in original post

martin_mueller
SplunkTrust
SplunkTrust

You could do something like this, run over -7d@d to @d+d in my case:

| tstats prestats=t count where index=_internal by _time span=1h | timechart span=1h count
| eval wday = strftime(_time, "%a") | where wday != "Sat" AND wday != "Sun" | fields - wday
| timewrap d

The first line loads an example timechart, the second throws out Saturdays and Sundays, and finally it runs timewrap. I get a chart for latest_day, 1day_before, 2days_before, 5days_before, 6days_before, 7days_before - note how 3 and 4 days before are missing, those would be Saturday and Sunday.

aferone
Builder

Perfect! Thank you!!

0 Karma

aferone
Builder

Yes, however, I want to skip Saturday's and Sunday's. I wasn't sure if that could be done utilizing Timewrap.

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

So... you are doing a "compare today with the last X working days" report?

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