Dashboards & Visualizations

Append dropdown to text box

mwdbhyat
Builder

Hi there,

I have a dashboard with 3 dropdown inputs and a text box. I am trying to get whatever i select from the 3 dropdown boxes to appear in the adjacent text box, essentially just appending the tokens to the whitespace and only running when they appear in that box and i hit "submit". The selections from the dropdown need to be in " ". I also want it to then clear previous selections if i go back and change one of the dropdowns again.

Has anyone got any thoughts on how i could achieve this?

Currently this almost works - i just need to figure out the append part properly:

<fieldset submitButton="false">
<input type="dropdown" token="mainSection">
  <label>Main Section</label>
  <fieldForLabel>MainSection</fieldForLabel>
  <fieldForValue>MainSection</fieldForValue>
  <search>
    <query>| inputlookup bla.csv
| fillnull value="(empty)"
| fields MainSection
| dedup 1 MainSection</query>
    <earliest>-24h@h</earliest>
    <latest>now</latest>
  </search>
</input>
<input type="dropdown" token="subSection">
  <label>SubSection</label>
  <fieldForLabel>SubSection</fieldForLabel>
  <fieldForValue>SubSection</fieldForValue>
  <search>
    <query>| inputlookup bla.csv
| fillnull value="(empty)"
| search MainSection="$mainSection$"
| fields SubSection
| dedup 1 SubSection</query>
    <earliest>-24h@h</earliest>
    <latest>now</latest>
  </search>
</input>
<input type="dropdown" token="dataLine">
  <label>DatalineName</label>
  <fieldForLabel>DatalineName</fieldForLabel>
  <fieldForValue>Dataline</fieldForValue>
  <search>
    <query>| inputlookup bla.csv
| fillnull value="(empty)"
| search MainSection="$mainSection$"
| search SubSection="$subSection$"
| fields DatalineName Dataline
| dedup 1 DatalineName</query>
    <earliest>-24h@h</earliest>
    <latest>now</latest>
  </search>
  <change>
    <eval token="chosen_dls">$chosen_dls$." ".$dataLine$</eval>
  </change>
</input>
<input type="text" token="chosen_dls">
  <label>selected</label>
</input>

Thanks!

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @mwdbhyat,
When you speak of thext box, a Single Value coulkd be useful for you?
If yes, see this example with two dropdowns and the choosed values displayed in a Single Value box, then you can use the tokens also for your searches.

<form>
  <label>Search Box</label>
  <fieldset submitButton="false">
    <input type="dropdown" token="token1">
      <label>token 1</label>
      <choice value="One">One</choice>
      <choice value="Two">Two</choice>
    </input>
    <input type="dropdown" token="token2">
      <label>token 2</label>
      <choice value="Three">Three</choice>
      <choice value="Four">Four</choice>
    </input>
  </fieldset>
  <row>
    <panel>
      <single>
        <search>
          <query>| makeresults | eval search_box="$token1$ $token2$" | table search_box</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="drilldown">none</option>
      </single>
    </panel>
  </row>
</form>

Ciao.
Giuseppe

0 Karma

mwdbhyat
Builder

Unfortunately it needs to be exactly as i described it above.. i suspect there may be a need for some JS to make this work the way I want it to!

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @mwdbhyat,
You could modify CSS and put an HTML box in the input section to use to display the tokens, but I cannot help to do this!

Ciao.
Giuseppe

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Best Practices: Splunk auto adjust pipeline queue

When you enable autoAdjustQueue in Splunk, maxSize should be understood as the queue size Splunk starts with ...

Introducing the 2026 - 2027 SplunkTrust cohort!

The goal of the SplunkTrust™ membership has historically been to acknowledge and recognize those who go above ...

Splunk Auto Ingestion Parallel Pipeline Scaling

Why this feature matters Many Splunk environments experience ingestion pressure long before the host is fully ...