Dashboards & Visualizations

Show panel when checkbox is checked

david_poulin
New Member

We have a dashboard including a couple of server informations (processes, processor, memory...etc) and we want to select the panel that need to be display with a checkbox...

for sure we can propably do it with html and javascript....but that will only mask the panel and chart. In our case, we want, if it<s possible, to be sure that the chart is not rendered if the panel is not displayed

is there any way ?

0 Karma

bmacias84
Champion

I believe you can use a simple xml form and using in-page Drilldown with Perma-link. Below is an example with input type of text, but you could change it to use checkbox. The bottom chart use attribute depends to delay render/ search. This example can be found in the simple xml app

<form>
    <label>In-Page Drilldown with Perma-linking</label>
    <fieldset submitButton="false">
        <!--
            Create an input to store the drilldown value. It will be hidden using custom javascript when
            the dashboard is loaded.
         -->
        <input type="text" token="sourcetype" searchWhenChanged="true" />
    </fieldset>
    <row>
        <table id="master">
            <title>Master</title>
            <searchString>index=_internal | stats count by sourcetype</searchString>
            <earliestTime>-60m@m</earliestTime>
            <latestTime>now</latestTime>
            <!-- Set the type of of drilldown, since we will always consume the same field, use row-->
            <option name="drilldown">row</option>
            <drilldown>
                <!-- Use set to specify the new token to be created.
                     Use any token from the page or from the click event to produce the value needed. -->
                <set token="sourcetype">$row.sourcetype$</set>
                <!-- If we also set the form.sourcetype the input will get updated too -->
                <set token="form.sourcetype">$row.sourcetype$</set>
            </drilldown>
        </table>
    </row>
    <row>
        <!-- depends is the way we tell the content to only show when the token has a value.
             Hint: use comma separated values if the element requires more than one token. -->
        <chart id="detail" depends="$sourcetype$">
            <title>Detail: $sourcetype$</title>
            <searchTemplate>index=_internal sourcetype=$sourcetype$ | timechart count</searchTemplate>
            <earliestTime>-60m@m</earliestTime>
            <latestTime>now</latestTime>
        </chart>
    </row>
</form>
0 Karma

david_poulin
New Member

Thank for your reply.

But, what we want to do is to have a input to select which panel we want to show on a total of posibilities. By example i can check to see the memory panel, the disk usage.....so in my dashboard..only this 2 panel are displayed of the total panels. We want more like a hide/show panel mechanism, but if we do it in pure javascript, the chart will probably be rendered so we try to avoid that...

0 Karma

bmacias84
Champion

Then your only real option is to use a HTML embedded tag and write a Javascript extension similar to the Single Value Tend in the simple XML app. You can still use simple xml, but you have to write javascript extensions.

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...