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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...