Splunk Dev

How to set up in-page drilldown with different tokens

splunkrocks2014
Communicator

For a single in-page drilldown, the following codes work as expected from "master1" table. How can I set up an in-page drilldown from either either token from "master1" or "master2"?

<form>
  <label>Process Tracking</label>
  <fieldset submitButton="false">
    <input type="dropdown" token="p_usage" searchWhenChanged="true">
      <label>Usage</label>
      <search>
        <query>| inputlookup usage.csv</query>
        <earliest>0</earliest>
      </search>
      <fieldForLabel>range</fieldForLabel>
      <fieldForValue>range</fieldForValue>
      <initialValue>usage<1%</initialValue>
      <default>usage<1%</default>
    </input>
    <input type="time" token="p_time" searchWhenChanged="true">
      <label>Time Range</label>
      <default>
        <earliest>-7d@h</earliest>
        <latest>now</latest>
      </default>
    </input>
  </fieldset>
  <row>
    <panel>
      <table id="master1">
        <title>Total process</title>
        <search>
          <query>index=xxxxxx sourcetype="xxxxxxxx" range="$p_usage$"  | stats dc(host) AS count by process | sort - count</query>
          <earliest>$p_time.earliest$</earliest>
          <latest>$p_time.latest$</latest>
        </search>
        <option name="drilldown">row</option>
        <drilldown>
          <set token="tk_process">$row.process$</set>
        </drilldown>
      </table>
    </panel>
    <panel>
      <table id="master2">
        <title>Total Workstation</title>
        <search>
          <query>index=xxxxxx sourcetype="xxxxxxxx" range="$p_usage$" | stats dc(process) AS count by host | sort - count</query>
          <earliest>$p_time.earliest$</earliest>
          <latest>$p_time.latest$</latest>
        </search>
        <option name="drilldown">row</option>
        <drilldown>
          <set token="tk_host">$row.host$</set>
        </drilldown>
      </table>
    </panel>
  </row>
  <row>
    <table id="detail" depends="$tk_process$">
      <title>Detail: $tk_process$</title>
      <search>
        <query>index=xxxxxx sourcetype="xxxxxxxx" process="$tk_process$" | dedup host process | table host process</query>
        <earliest>$p_time.earliest$</earliest>
        <latest>$p_time.latest$</latest>
      </search>
    </table>
  </row>
</form>
Tags (1)
0 Karma
1 Solution

somesoni2
Revered Legend

Use the same token name in the drilldown stanza (instead of using tk_process and tk_host, just use tk_drilldown in both places). Remember to update the depends= and panel 3 query with new token name.

View solution in original post

0 Karma

somesoni2
Revered Legend

Use the same token name in the drilldown stanza (instead of using tk_process and tk_host, just use tk_drilldown in both places). Remember to update the depends= and panel 3 query with new token name.

0 Karma

splunkrocks2014
Communicator

Thanks. That works.

0 Karma
Get Updates on the Splunk Community!

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...