Splunk Search

How to create a dropdown menu

sarahw3
Explorer

I am trying to create a dropdown menu where a user can select a city. I have the following code as the search string but it is not working.
sourcetype="support_csv" location | fields location | dedup location

I have very little experience with Splunk and need a basic how to for dropdown menus haha!

0 Karma
1 Solution

cmerriman
Super Champion

what about this:

sourcetype="support_csv" |stats count by location|fields - count

and then in your Field for Label and Field for Value, use location

View solution in original post

0 Karma

woodcock
Esteemed Legend

Like this:

 sourcetype="support_csv" |stats count by location|sort 0 - count | fields - count

This puts the most popular locations at the top.

0 Karma

sarahw3
Explorer

Good to know! Thank you!

0 Karma

niketn
Legend

Try the following for Dynamic Options of the dropdown:

sourcetype="support_csv" location=*
| dedup location
| table location
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

cmerriman
Super Champion

what about this:

sourcetype="support_csv" |stats count by location|fields - count

and then in your Field for Label and Field for Value, use location

0 Karma

sarahw3
Explorer

That worked perfectly! Thank you so much!!

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...