Splunk Search

Overlay an average line on a bar graph of counts

ellenbytech
Explorer

I have a search index=safes TransactionCode=DOPN OR TransactionCode=DCLO Details="Door A Opened" OR Details="Door A Closed"
| transaction open_close startswith=DOPN endswith=DCLO maxevents=2 | search eventcount=2
| stats count(duration) as Events by Location
.

This gives me the number of relevant events by Location for the month I'm looking at. I want to display an average value line across the bar graph. However changing the last command to |stats count(duration) as Events, avg(Events) as Event_avg by Location doesn't create a value for Event avg and doesn't let me select Event avg as an overlay on the graph. I've seen many questions similar to this but the answers all seemed to refer to splitting up events by _time rather than some other field such as Location.

0 Karma
1 Solution

DalJeanis
Legend

Add at the end...

 | eventstats avg(Events) as Event_avg

That will put the same overall average on every event.

Haven't done overlays myself, so that only gets you halfway there, but the data will be available anyway.

View solution in original post

DalJeanis
Legend

Add at the end...

 | eventstats avg(Events) as Event_avg

That will put the same overall average on every event.

Haven't done overlays myself, so that only gets you halfway there, but the data will be available anyway.

Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...