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!

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...