Dashboards & Visualizations

how i can display only one value using dropdown?

rajhemant26
New Member

Hello, everyone

I am using one CSV file to display the output. I have added the screenshot for CSV file.

Tags (1)
0 Karma

vnravikumar
Champion

Hi

Check this and modify accordingly

<form>
  <label>Product</label>
  <fieldset submitButton="false">
    <input type="dropdown" token="product">
      <label>Product Type</label>
      <choice value="ProductA">ProductA</choice>
      <choice value="ProductB">ProductB</choice>
    </input>
    <input type="dropdown" token="field2">
      <label>field2</label>
      <fieldForLabel>Version</fieldForLabel>
      <fieldForValue>Version</fieldForValue>
      <search>
        <query>|inputlookup RK.csv | eval date = strptime($product$,"%d/%m/%y") | where date < now() | table Version | sort - Version</query>
        <earliest>-24h@h</earliest>
        <latest>now</latest>
      </search>
    </input>
  </fieldset>
</form>

OR

If you want only the latest value

<form>
  <label>Product</label>
  <fieldset submitButton="false">
    <input type="dropdown" token="product">
      <label>Product Type</label>
      <choice value="ProductA">ProductA</choice>
      <choice value="ProductB">ProductB</choice>
    </input>
    <input type="dropdown" token="field2">
      <label>field2</label>
      <fieldForLabel>Version</fieldForLabel>
      <fieldForValue>Version</fieldForValue>
      <search>
        <query>|inputlookup RK.csv | eval date = strptime($product$,"%d/%m/%y") | where date < now() | table Version | sort 1 - Version</query>
        <earliest>-24h@h</earliest>
        <latest>now</latest>
      </search>
    </input>
  </fieldset>
</form>
0 Karma
Get Updates on the Splunk Community!

Splunk AI Assistant for SPL | Key Use Cases to Unlock the Power of SPL

Splunk AI Assistant for SPL | Key Use Cases to Unlock the Power of SPL  The Splunk AI Assistant for SPL ...

Buttercup Games: Further Dashboarding Techniques (Part 5)

This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the ...

Customers Increasingly Choose Splunk for Observability

For the second year in a row, Splunk was recognized as a Leader in the 2024 Gartner® Magic Quadrant™ for ...