Dashboards & Visualizations

Accordion in Splunk?

alex8103
Explorer

Hello,

my graphs in Spluk are becoming very many over time. I would therefore like to build a kind of accordion to be able to expand and collapse the individual areas.
Can someone please tell me how to do this?

Best regards

Alex

Labels (2)
Tags (3)
0 Karma

bowesmana
SplunkTrust
SplunkTrust

There are a number of ways to achieve something like this.

  • Uses a tab mechanism (using Splunk input type="link") to show groups of panels
  • Use a small visualisation to show a "thumbnail" and then expand the chart and remove other thumbnails when clicking on the chart

These all generally work through panel dependency and tokens to hide or show certain panels.

The tab approach simply uses a <change> element in the <input> to set and unset tokens that show or hide panels relating to that tab

      <input id="cascade_group" type="link" token="tab">
        <label>Cascade</label>
        <choice value="l1">Tab 1</choice>
        <choice value="l2">Tab 2</choice>
        <default>l1</default>
        <change>
          <condition value="l1">
            <unset token="show_l2"></unset>
            <set token="show_l1"></set>
          </condition>
          <condition value="l2">
            <unset token="show_l1"></unset>
            <set token="show_l2"></set>
          </condition>
        </change>
      </input>

Use the <row depends="$show_l1$> syntax to show rows/panels for l1 panels and the same for l2.

And this is the thumbnail approach

bowesmana_0-1718232949849.png

which if you click on the second thumbnail, expands to the chart below and removes the other thumbnails.

bowesmana_1-1718232995490.png

This is done by setting the height attribute of the chart through a token set by drilldown, e.g. something like this (but a little more complext)

<option name="height">$varietal_height$</option>

<drilldown>
  <set token="varietal_height">800</set>
  <unset... tokens for other thumbnails>
</drilldown>

Go checkout the XML reference and read about tokens and depends 

https://docs.splunk.com/Documentation/Splunk/latest/Viz/PanelreferenceforSimplifiedXML

 

0 Karma
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, ...