Splunk Search

How to edit my search to chart counts and a calculated count, order the bars, apply better labels, and graph values over time?

elumpkin_caisgr
Engager

I've found a way to chart event counts by eventtype, plus a calculated total of implied events. However, it's a little clunky and I'm wondering if there is a better way to accomplish the same thing. What I have is...

eventtype=enrollment OR eventtype=map-existing-user OR eventtype=start-registration OR eventtype="map-existing-failure"| stats count(eval(eventtype="start-registration")) as regs count(eval(eventtype="map-existing-user")) as existSuccess count(eval(eventtype="enrollment")) as newSuccess count(eval(eventtype="map-existing-failure")) as existFail  | eval abandon=regs-(existSuccess+existFail+newSuccess)| table Events, existSuccess , newSuccess , existFail, abandon

I like that the 3 eventtype counts are bars in the graph, as well as 'abandon' being a bar in the graph. That is the goal. However, I don't like that I can't control the order of the bars, that I can't apply better labels (e.g. 'New Enrollments' instead of newSuccess), and that I can't graph the values over time. Any recommendations on how to accomplish any/all of those would be greatly appreciated.

0 Karma
1 Solution

woodcock
Esteemed Legend

This is better:

eventtype=enrollment OR eventtype=map-existing-user OR eventtype=start-registration OR eventtype="map-existing-failure"
| stats count by eventtype | eval Total="Totals" | xyseries Total eventtype count
| rename "start-registration"  AS regs "map-existing-user" AS existSuccess "enrollment" AS newSuccess "map-existing-failure" AS existFail
| eval abandon=regs-(existSuccess+existFail+newSuccess)| table Events, existSuccess , newSuccess , existFail, abandon

View solution in original post

woodcock
Esteemed Legend

This is better:

eventtype=enrollment OR eventtype=map-existing-user OR eventtype=start-registration OR eventtype="map-existing-failure"
| stats count by eventtype | eval Total="Totals" | xyseries Total eventtype count
| rename "start-registration"  AS regs "map-existing-user" AS existSuccess "enrollment" AS newSuccess "map-existing-failure" AS existFail
| eval abandon=regs-(existSuccess+existFail+newSuccess)| table Events, existSuccess , newSuccess , existFail, abandon

elumpkin_caisgr
Engager

This more explicitly defines what is being charted and allows me to set the label values. Thank you woodcock!

I would love to find a way to chart the calculated value, but I won't hold my breath.

0 Karma
Get Updates on the Splunk Community!

Enter the Splunk Community Dashboard Challenge for Your Chance to Win!

The Splunk Community Dashboard Challenge is underway! This is your chance to showcase your skills in creating ...

.conf24 | Session Scheduler is Live!!

.conf24 is happening June 11 - 14 in Las Vegas, and we are thrilled to announce that the conference catalog ...

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...