Dashboards & Visualizations

Dropdown Question?

Shan
Builder

Hi Friends,

I have a drop-down filter in dashboard. If that filter is not populating any value, then while loading the dashboard itself that filter shouldn't be visible in dashboard and tokens used in the panel query(dashboard) for that filter shouldn't be active..

Wise versa once the data is there in that filter, filter need to be shown in dashboard and tokens used in the panel query(dashboard) for that filter should be active..

Please help me on achieving it ..

Thanks in advance ..

0 Karma

Shan
Builder

Hi All,

Does anyone have idea about achieving it.

Thanks ...

0 Karma

vnravikumar
Champion

Hi

Try this

    <input type="dropdown" token="number" depends="$show_dropdown$">
      <label>Sample dropdown</label>
      <fieldForLabel>count</fieldForLabel>
      <fieldForValue>count</fieldForValue>
      <search>
        <query> .....  your query........</query>
        <earliest>-24h@h</earliest>
        <latest>now</latest>
        <done>
          <condition match="'job.resultCount' >0">
            <set token="show_dropdown">true</set>
          </condition>
          <condition>
            <unset token="show_dropdown"></unset>
          </condition>
        </done>
      </search>
    </input>
0 Karma

Shan
Builder

@vnravikumar,

Thanks for your input..

Yes, i achieved the above one with help of splunk doc. Now the problem, When the dropdown is hidden. I don't want that dropdown token to be used in the panel query. How to achieve it. Token need to be active in panel query of dashboard, when dropdown is visible ..

Thanks ...

0 Karma

to4kawa
Ultra Champion

How do you populate a hidden filter?

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...