Dashboards & Visualizations

Dashboard timechart

prasant
Path Finder

How to display timechart for specific time period for specific business days.

Eg: index="someindex" |dedup eventid| timechart count(_raw) by eventName span=60m for monday,tuesday, wednesday, thursday, friday during 6pm - 8pm.  Or for specific dates .How can achieve this? 

thanks in advance

Labels (2)
0 Karma
1 Solution

bowesmana
SplunkTrust
SplunkTrust

You can do this if you have the date_wday field in your data

index="someindex" date_wday IN ("monday","tuesday","wednesday","thursday","friday") date_hour>=18 date_hour<20
| dedup eventid
| timechart count(_raw) by eventName span=60m 

If you don't have those fields you can do

index="someindex" 
| eval date_wday=strftime(_time, "%a")
| eval date_hour=strftime(_time, "%H")
| search date_wday IN ("mon","tue","wed","thu","fri") date_hour>=18 date_hour<20
| dedup eventid
| timechart count(_raw) by eventName span=60m 

View solution in original post

prasant
Path Finder

thanks, it helped . 

0 Karma

bowesmana
SplunkTrust
SplunkTrust

You can do this if you have the date_wday field in your data

index="someindex" date_wday IN ("monday","tuesday","wednesday","thursday","friday") date_hour>=18 date_hour<20
| dedup eventid
| timechart count(_raw) by eventName span=60m 

If you don't have those fields you can do

index="someindex" 
| eval date_wday=strftime(_time, "%a")
| eval date_hour=strftime(_time, "%H")
| search date_wday IN ("mon","tue","wed","thu","fri") date_hour>=18 date_hour<20
| dedup eventid
| timechart count(_raw) by eventName span=60m 
Get Updates on the Splunk Community!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...