Dashboards & Visualizations

query/Panel should be changed based on token passage value

sahana
Engager

Hi,

I have requirement like the drilldown panel query should be changed based on the token value passed from the parent panel

right now the condition is I have a parent panel token which may pass either SUCCESS or FAILURE as value

If it FAILURE the drilldown panel should execute different query and for SUCCESS it should execute different one

Labels (2)
0 Karma

diogofgm
SplunkTrust
SplunkTrust

Hi Sahana,

You can set a token to the complete search you what to use on either case.
In this example I placed the search in the values of the dropdown.

<form>
  <label>drilldown</label>
  <fieldset submitButton="false">
    <input type="dropdown" token="filter" searchWhenChanged="true">
      <label></label>
      <choice value="index=_internal">All</choice>
      <choice value="index=_internal log_level=info">Info</choice>
      <choice value="index=_internal log_level=error">Error</choice>
    </input>
    <input type="time" token="field1">
      <label></label>
      <default>
        <earliest>-24h@h</earliest>
        <latest>now</latest>
      </default>
    </input>
  </fieldset>
  <row>
    <panel>
      <table>
        <search>
          <query>$filter$
|stats count by log_level </query>
          <earliest>$field1.earliest$</earliest>
          <latest>$field1.latest$</latest>
        </search>
        <option name="drilldown">cell</option>
        <drilldown>
          <link target="_blank">search?q=$filter$%20log_level%3D$click.value$&amp;earliest=$field1.earliest$&amp;latest=$field1.latest$</link>
        </drilldown>
      </table>
    </panel>
  </row>
</form>

 
Its easier to work with and help you with what you have right now and what is your objective if you're able to share that.
Check the docs as they have great information on how tokens work and can be used.
https://docs.splunk.com/Documentation/Splunk/8.2.4/Viz/ContextualDrilldown

------------
Hope I was able to help you. If so, some karma would be appreciated.
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

There are a couple of ways to do this:

You could use the drilldown to hide or display whichever panel represents the choice made i.e. you have two drilldown panel and only show one of them. This is done with the depends attribute on the panel

The other way is to use the drilldown to set tokens which are used in the search for the drilldown panel

0 Karma

sahana
Engager

Can you give me some examples pls

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!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...