All Apps and Add-ons

Daily Business Hours Apdex Chart

kullss
New Member

I have dynatrace apdex score of user satisfaction index. I need take this score avg by filtering 8 am to 5 pm business hours and draw a chart with the previous day business hour apdex chart.
So i would have chart monthly/weekly from Monday to Friday apdex avg only from business hour. how this is possible to do with splunk.

0 Karma
1 Solution

alemarzu
Motivator

Hello @kulls,

Try this, is a working example with metrics.log charting values from previous week. This is assuming that you have date_* fields in your events, if not let me know.

index=_internal source="*metrics.log"  earliest=-1w@w latest=@w
| eval date_hour=strftime(_time, "%H")
| eval date_wday = strftime(_time, "%w")
| search date_hour>=8 date_hour<=17 date_wday>=1 date_wday<=5
| chart avg(kb) by date_wday

Edit: New query, this will work even if you don't have date_* fields and it's easier to understand if you want a montly report,

index=_internal source="*metrics.log"  earliest=-1mon@mon latest=@mon
| eval hour = tonumber(strftime(_time,"%H"))
| eval wday = tonumber(strftime(_time,"%w"))
| bin _time span=1d 
| where hour>=8 AND hour<=17 AND wday!=0 AND wday!=6
| eval formatedTime=strftime(_time, "%b %d")
| chart avg(kb) by formatedTime | rename formatedTime AS "Date"

Hope it helps.

View solution in original post

0 Karma

alemarzu
Motivator

Hello @kulls,

Try this, is a working example with metrics.log charting values from previous week. This is assuming that you have date_* fields in your events, if not let me know.

index=_internal source="*metrics.log"  earliest=-1w@w latest=@w
| eval date_hour=strftime(_time, "%H")
| eval date_wday = strftime(_time, "%w")
| search date_hour>=8 date_hour<=17 date_wday>=1 date_wday<=5
| chart avg(kb) by date_wday

Edit: New query, this will work even if you don't have date_* fields and it's easier to understand if you want a montly report,

index=_internal source="*metrics.log"  earliest=-1mon@mon latest=@mon
| eval hour = tonumber(strftime(_time,"%H"))
| eval wday = tonumber(strftime(_time,"%w"))
| bin _time span=1d 
| where hour>=8 AND hour<=17 AND wday!=0 AND wday!=6
| eval formatedTime=strftime(_time, "%b %d")
| chart avg(kb) by formatedTime | rename formatedTime AS "Date"

Hope it helps.

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

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