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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...

Customer success is front and center at .conf25

Hi Splunkers, If you are not able to be at .conf25 in person, you can still learn about all the latest news ...