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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...