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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...