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
Motivator

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
Motivator

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
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...