- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a dropdown menu where you can select a state and I want another dropdown for city. Is there a way that the city dropdown then only has the options for the state chosen? For example, if I chose Massachusetts in the first dropdown, Los Angeles would not be an option to pick on the second drop down menu.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

use the token that is creating the state dropdown in your search that is creating the city dropdown.
for instance, if $state$ is the token name for your state dropdown:
sourcetype="support_csv" location=$state$|stats count by city|fields - count
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content


What you want is a cascading input.
First input populating search:
sourcetype=mySourcetype | stats count by "State"
First input token: state_token
Second input populating search:
sourcetype=mySourcetype State=$state_token|s$ | stats count by "City"
Note the use of a |s filter with the state_token. This will add quote marks to capture states like North Dakota.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Use a populating search
for the 2nd dropdown that uses something like |inputcsv YourFileWithStatesAndCities Here | search State=$state$
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

use the token that is creating the state dropdown in your search that is creating the city dropdown.
for instance, if $state$ is the token name for your state dropdown:
sourcetype="support_csv" location=$state$|stats count by city|fields - count
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is saying my search produces no result. I tried it as State=$state$ and that didn't work either.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When I get rid of the part with the token it works but it shows all the cities for all states.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

can you paste your xml from your dashboard so i can see what might be happening? i just need the part from <fieldset...>
to </fieldset>
where all the dropdowns are
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I got it! I just had to put the token in quotes! Thank you so much for all your help! You are a life saver!! I wish I had all your splunk knowledge hahaha!
