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!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...