Splunk Search

How to customize the dashboard drill down query

sajoseph
Explorer

HI,
I have a dashboard query which is like this.

index=elf |search * | chart count(eval(event_type="3000")) AS AUDIT, count(eval(event_type="6000")) AS USAGE,count(eval(event_type="7000")) AS HEART_BEAT,count(eval(event_type="10000")) AS ERROR by app_id

This search gives events grouped by application ID and the different event_types that are stacked in a Column chart.

When i click on any event type, it is suppose to run a search which filters the data by Application ID and then filters the data by Event_type.

But I am getting only the below search "index=elf | search app_id="ERD"" not as "index=elf | search app_id="ERD" event_type=6000"

Please let me know how to customize the drilldown search

I am new to splunk. Appreciate your timely help.

0 Karma

lguinn2
Legend

FIrst, I would rewrite your search as

index=elf 
| eval CountType = case(eventtype="3000","AUDIT",
                        eventtype="6000", "USAGE"
                        eventtype="7000", "HEART_BEAT",
                        eventtype="10000", "ERROR",
                        1=1,"Unknown" )
| where CountType!=unknown
| chart count by app_id CountType

It just seems easier. Second, drilldown may not work because of the way you have structured the result table. For example, Splunk isn't going to be able to connect "USAGE" with eventtype="6000". I think this will be true regardless of whether you use the original search or the search I've shown above. And I can't see how to do this even with a custom drilldown.

You could do this:

index=elf (eventtype="3000" OR eventtype="6000" OR eventtype="7000" OR eventtype="10000")
| chart count by app_id eventtype

Now your drilldown should work, but your headings won't be as nice.

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!

Free Professional Services for .conf26 Attendees

This year at .conf26, we are doing something a little different. We are bringing the best minds from ...

Defend at Machine Speed: Your Guide to Security Sessions at .conf26

Splunk .conf26   With threats moving at machine speed and attack surfaces expanding across hybrid ...

Where Innovation Takes Flight: The Splunk4Aviation Flight Sim Lands at .conf26

If you hear someone at .conf26 shouting "gear down, GEAR DOWN" across the show floor, you have found us.  The ...