All Apps and Add-ons

need to get a input for reports

splunkuseradmin
Path Finder

hi all
below is my query i am working with i have a correct output of business hours utilization using formula but i have to input manually in the formula is there a way i can do it using any input for selected timeperiod so i dont have to do it manual.
ex., I used | eval ... , which is correct but used540as total minutes forbusiness hoursfor the time periodyesterday. but i need a input so if i select any othertimeperiodi get utilization value not by entering540foryesterdayor2700total minutes(business hours) forlast week`.

1 Solution

woodcock
Esteemed Legend

Like this:

... | eval utilization=round(100*minutes/
[|makeresults 
| addinfo 
| eval _time = info_min_time 
| timechart count span=1h
| eval dayofweek = strftime(_time, "%a") 
| eval hourofday = strftime(_time, "%H")
| search (NOT (dayofweek="Sat" OR dayofweek="Sun")) AND hourofday>7 AND hourofday<17
| stats count AS business_hours
| eval business_minutes = 60 * business_hours], 2). "%" ...

View solution in original post

Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...