Splunk Dev

Load another panel when one row in a table is selected

macadminrohit
Contributor

Hi,

Currently i have a search which actually generally a stats for the number of application installed on a server. The list of servers is coming from the inputlookup command. This will give the number of apps installed on each host.

index=main sourcetype="Script:InstalledApps" [|inputlookup servers | rename Servers as host ]
| search DisplayName = Microsoft* | stats dc(DisplayName) by host

Now i want to list all the apps when i select a row in the above stats table. So basically i want to load another panel below the stats table which will just give the list of installed apps for the host selected.

Tags (1)
0 Karma
1 Solution

ralzate
Explorer

Hello

You can use the drilldown functionality.
You have to activate drilldown on the first table. And for the specific host column set up a token used by the second table.

You can even use "depends" in order to hide the panel when no row was selected.

<panel>
  <table>
    <title>main table</title>
    <search>
      <query>index=main sourcetype="Script:InstalledApps" [|inputlookup servers | rename Servers as host ] | search DisplayName = Microsoft* | stats dc(DisplayName) by host</query>
    </search>
    <option name="count">10</option>
    <option name="drilldown">cell</option>
    <option name="wrap">true</option>
    <drilldown>
      <condition field="host">
        <set token="hostName">$click.value2$</set>
      </condition>
      <condition field="*">
        <unset token="hostName"></unset>
      </condition>
    </drilldown>
  </table>
</panel>

<panel depends="$hostName$">
    <table>
    <title>Detail table</title>
    <search>
      <query>index=main sourcetype="Script:InstalledApps" host=$hostName$ ...</query>
    </search>
    <option name="count">10</option>
    <option name="drilldown">none</option>
    <option name="wrap">true</option>
  </table>
</panel>

Regards
Régis

View solution in original post

ralzate
Explorer

Hello

You can use the drilldown functionality.
You have to activate drilldown on the first table. And for the specific host column set up a token used by the second table.

You can even use "depends" in order to hide the panel when no row was selected.

<panel>
  <table>
    <title>main table</title>
    <search>
      <query>index=main sourcetype="Script:InstalledApps" [|inputlookup servers | rename Servers as host ] | search DisplayName = Microsoft* | stats dc(DisplayName) by host</query>
    </search>
    <option name="count">10</option>
    <option name="drilldown">cell</option>
    <option name="wrap">true</option>
    <drilldown>
      <condition field="host">
        <set token="hostName">$click.value2$</set>
      </condition>
      <condition field="*">
        <unset token="hostName"></unset>
      </condition>
    </drilldown>
  </table>
</panel>

<panel depends="$hostName$">
    <table>
    <title>Detail table</title>
    <search>
      <query>index=main sourcetype="Script:InstalledApps" host=$hostName$ ...</query>
    </search>
    <option name="count">10</option>
    <option name="drilldown">none</option>
    <option name="wrap">true</option>
  </table>
</panel>

Regards
Régis

chaker
Contributor

Does this help?

http://docs.splunk.com/Documentation/Splunk/7.0.3/Viz/tokens

Access tokens to show or hide user interface components

You can use token values to conditionally show or hide user interface components. The following elements contain the attributes depends and rejects. Use the and elements to set the token values that these attributes consume.

<row>
<panel>
<chart>
<event>
<html>
<map>
<single>
<table>
<input>

For example, show the element only when the showChart token has been set.

0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...