Dashboards & Visualizations

how to add a drop down to pick what csv lookup to use in a dashboard

sbattista
Explorer

is there a way to add a drop down option to a dashboard that can change what csv lookup it uses? 

 

 

 

Tags (2)
0 Karma

sbattista
Explorer

thank you this will work for now, is there a way to make it less manual? can it auto populate the list of csv's based in a app context? 

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@sbattista 

I have updated my answer. Please check it.

KV

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@sbattista 

Try this sample XML. Here, I have created a.csv, b.csv and c.csv with sample data.

 

 

<form>
  <label>Dynamic Lookup</label>
  <fieldset submitButton="false">
    <input type="dropdown" token="tkn_csv_file">
      <label>Select File</label>
      <fieldForLabel>title</fieldForLabel>
      <fieldForValue>title</fieldForValue>
      <search>
        <query>| rest /servicesNS/-/-/data/lookup-table-files | where 'eai:acl.app'="$env:app$" | table title</query>
        <earliest>-24h@h</earliest>
        <latest>now</latest>
      </search>
    </input>
  </fieldset>
  <row>
    <panel>
      <table>
        <search>
          <query>| inputlookup $tkn_csv_file$</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">none</option>
      </table>
    </panel>
  </row>
</form>

 

 

Thanks
KV
▄︻̷̿┻̿═━一

If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.

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 ...