Dashboards & Visualizations

How do you get the dropdown to take a value that's not on a returned list (any value that the user puts in)?

robertlynch2020
Influencer

HI,

I have the following drop down. It returns a list of numbers
For example: 2, 6, 7, 45 etc... random.

I need to be able to set the number X even if X is not in the list returned. Or Y or Z the use picks the value.

 <input type="dropdown" token="Token_Duration_MAX_Time" searchWhenChanged="true">
        <label>Duration_MAX_Time</label>
        <choice value="*">All</choice>
        <search>
          <query>| tstats summariesonly=true values(All_TPS_Logs.duration) AS Duration FROM datamodel=TPS_V4 WHERE nodename=All_TPS_Logs host=$host_token$ All_TPS_Logs.user=* OR NOT All_TPS_Logs.user=* All_TPS_Logs.operationIdentity="*" GROUPBY All_TPS_Logs.duration 
| rename All_TPS_Logs.duration as Duration 
| sort Duration 
| table Duration</query>
           <earliest>$tps_selection.earliest$</earliest>
          <latest>$tps_selection.latest$</latest>
        </search>
        <fieldForLabel>Duration</fieldForLabel>
        <fieldForValue>Duration</fieldForValue>
        <default>NO_Value</default>

Thanks in advance
Rob

0 Karma

richgalloway
SplunkTrust
SplunkTrust

@robertlynch2020 Is your problem resolved? If so, please accept the answer to help future readers.

---
If this reply helps you, Karma would be appreciated.
0 Karma

kishor_pinjark2
Path Finder

Hi,

Try below:

Test - XXX

<input type="dropdown" token="field1">
  <label>field1</label>
  <choice value="111">111</choice>
  <choice value="123">123</choice>
  <search>
    <query>index="_internal"| stats count by date_hour</query>
    <earliest>-15m</earliest>
    <latest>now</latest>
  </search>
  <fieldForLabel>count</fieldForLabel>
  <fieldForValue>count</fieldForValue>
</input>

You can choose any value instead of 111 or 123.
So that you can get values in dropdown, from dynamic search as well as hard coded.

In my case I am getting below values in dropdown:
111
123
+ values from dynamic search...

0 Karma

robertlynch2020
Influencer

Thanks, (I should have been more specific) i am looking for any value that the use will enter dynamically.

I don't want to have to update the dashboard each time

0 Karma

kishor_pinjark2
Path Finder

Are you looking for something like below scenario:

Test - XXX

<input type="text" token="user_input_tok">
  <label>User Input</label>
</input>


<panel>
  <table>
    <title>Testing</title>
    <search>
      <query>index="_internal"| top limit=$user_input_tok$ date_hour</query>
      <earliest>-15m</earliest>
      <latest>now</latest>
    </search>
    <option name="drilldown">none</option>
  </table>
</panel>

Put any value in a textbox and enter.
Modify user search query as per your requirement.

0 Karma

Vijeta
Influencer

You cannot enter input in a dropdown, you can create a textbox for user to enter the input and add that input to your dropdown list or your query.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...