Dashboards & Visualizations

How to drill down a single value panel from dashboard?

SapthagiriAavik
Explorer

i have many single value panels in a dashboard,So When i click a panel it should open with same search string in a new tab. i tried with custom drill down ,but its opening a empty new tab. kindly guide me

Tags (2)
0 Karma

niketn
Legend

@SapthagiriAavikov, following is a run anywhere dashboard based on Splunk's _internal index to show the options to run the search in a new window for Single Value Trellis Layout as well as Single Value without Trellis.

<form>
  <label>Trellis single value drilldown</label>
  <fieldset submitButton="false">
    <input type="time" token="field1" searchWhenChanged="true">
      <label></label>
      <default>
        <earliest>-24h@h</earliest>
        <latest>now</latest>
      </default>
    </input>
  </fieldset>
  <row>
    <panel>
      <single>
        <search>
          <query>index=_internal sourcetype=splunkd log_level!=INFO earliest=-24h@h latest=now
| stats count by component</query>
          <earliest>$field1.earliest$</earliest>
          <latest>$field1.latest$</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="colorBy">value</option>
        <option name="colorMode">none</option>
        <option name="drilldown">all</option>
        <option name="numberPrecision">0</option>
        <option name="rangeColors">["0x65a637","0x6db7c6","0xf7bc38","0xf58f39","0xd93f3c"]</option>
        <option name="rangeValues">[0,30,70,100]</option>
        <option name="refresh.display">progressbar</option>
        <option name="showSparkline">1</option>
        <option name="showTrendIndicator">1</option>
        <option name="trellis.enabled">1</option>
        <option name="trellis.scales.shared">1</option>
        <option name="trellis.size">medium</option>
        <option name="trellis.splitBy">component</option>
        <option name="trendColorInterpretation">standard</option>
        <option name="trendDisplayMode">absolute</option>
        <option name="unitPosition">after</option>
        <option name="useColors">0</option>
        <option name="useThousandSeparators">1</option>
        <drilldown>
          <link target="_blank">search?q=index="_internal" sourcetype="splunkd" log_level!="INFO" component="$trellis.value$"
| stats count by component&amp;earliest=$field1.earliest$&amp;latest=$field1.latest$</link>
        </drilldown>
      </single>
    </panel>
  </row>
  <row>
    <panel>
      <single>
        <title>$tokClickName$</title>
        <search>
          <query>index=_internal sourcetype=splunkd log_level!=INFO earliest=-24h@h latest=now
| stats count by component 
| sort - count 
| head 1
| table count component</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="colorBy">value</option>
        <option name="colorMode">none</option>
        <option name="drilldown">all</option>
        <option name="numberPrecision">0</option>
        <option name="rangeColors">["0x65a637","0x6db7c6","0xf7bc38","0xf58f39","0xd93f3c"]</option>
        <option name="rangeValues">[0,30,70,100]</option>
        <option name="refresh.display">progressbar</option>
        <option name="showSparkline">1</option>
        <option name="showTrendIndicator">1</option>
        <option name="trendColorInterpretation">standard</option>
        <option name="trendDisplayMode">absolute</option>
        <option name="unitPosition">after</option>
        <option name="useColors">0</option>
        <option name="useThousandSeparators">1</option>
        <drilldown>
          <condition match="$row.component$=&quot;TimeoutHeap&quot;">
            <set token="tokClickName">$row.component$</set>
            <link target="_blank">search?q=index=_internal sourcetype=splunkd log_level!=INFO
  | stats count by component 
  | sort - count 
  | search count="$click.value$" AND component="$row.component$"&amp;earliest=$field1.earliest$&amp;latest=$field1.latest$</link>
          </condition>
          <condition>
            <!-- DO NOTHING-->
            <set token="tokClickName">$row.component$</set>
          </condition>
        </drilldown>
      </single>
    </panel>
  </row>
</form>

Please try out and confirm!

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

niketn
Legend

@SapthagiriAavikov, are you using Trellis for multiple Single Value panels or does each Single Value panel have its own query?

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

tiagofbmm
Influencer

Hey follow this example and edit the source of the dashboard:

<dashboard>
  <label>Test1</label>
  <row>
    <panel>
      <single>
        <search>
          <query>index=_internal | head 10 | where source like "%" | stats count</query>
          <earliest>-60m@m</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">all</option>
        <option name="refresh.display">progressbar</option>
      </single>
    </panel>
  </row>
</dashboard>
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!

Event Series: Level up your SOC: Advancing with Splunk Enterprise Security

AI has fundamentally raised the stakes for security operations, and this three-part series is your guide to ...

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 ...

SOC4Kafka - New Kafka Connector Powered by OpenTelemetry

The new SOC4Kafka connector, built on OpenTelemetry, enables the collection of Kafka messages and forwards ...