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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...