Dashboards & Visualizations

How to hide cloumns in the table the basis of multiselect choices?

snehal
Loves-to-Learn Lots

Hi Team, How to hide cloumns in the table the basis of multiselect choices?
For example, I have options in multiselect , Critical, high,medium and Low. When i select high and low from multiselect, critical and low column should be hide from table.Only I need to show High and low column and there respective total in table.
Please give me solution on this.Thank you

Labels (2)
0 Karma

jhanvidattani
Path Finder

@snehal 
We can implement this thing by making use of Splunk tokens. Can you refer to below sample code?

 

<form>
  <label>Sample Dashboard</label>
  <fieldset submitButton="false">
    <input type="time" token="time_token">
      <label>Time range</label>
      <default>
        <earliest>-15m</earliest>
        <latest>now</latest>
      </default>
    </input>
    <input type="multiselect" token="severity_token">
      <label>Select Severity</label>
      <choice value="critical">critical</choice>
      <choice value="high">high</choice>
      <choice value="low">low</choice>
      <choice value="medium">medium</choice>
      <initialValue>critical</initialValue>
      <delimiter>,</delimiter>
    </input>
  </fieldset>
  <row>
    <panel>
      <table>
        <title>My Table</title>
        <search>
          <query>index="_internal" | rename date_hour as high | rename date_month as low | rename date_year as critical | rename date_zone as medium | dedup $severity_token$ | table $severity_token$</query>
          <earliest>$time_token.earliest$</earliest>
          <latest>$time_token.latest$</latest>
        </search>
        <option name="drilldown">none</option>
        <option name="count">10</option>
        <option name="refresh.display">progressbar</option>
      </table>
    </panel>
  </row>
</form>

 

If you find my solution fruitful, then an upvote would be appreciated.

 

 

Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...