Splunk Search

How to create a drilldown

jsuryaprakash
Path Finder

Hello everyone,
I am trying to create a simple hiding drill down panel.
With below search:

index=_internal |stats dc(user) as uniqueusers by sourcetype host 

Which gives below table:

sourcetype host uniqueusers
aaaa ccc 4
bbbbb ddddd 2

When a user clicks on uniquesusers value for example 4 it should show a new panel below with list of 4 uniqueuser names.

0 Karma

mayurr98
Super Champion

Try this :

<dashboard>
  <label>test</label>
  <row>
    <panel>
      <table>
        <search>
          <query>index=_*|stats dc(user) as user  by sourcetype host source</query>
          <earliest>-15m</earliest>
          <latest>now</latest>
        </search>
        <drilldown>
          <set token="show_panel">true</set>
          <set token="user">$click.value2$</set>
          <set token="source">$row.source$</set>
          <set token="host">$row.host$</set>
        </drilldown>
      </table>
    </panel>
  </row>
  <row>
    <panel depends="$user$">
      <table>
        <search>
          <query>index=_* |stats values(user) as user dc(user) as user_count  by sourcetype host source | search user_count=$user$ source="$source$" host=$host$ | mvexpand user</query>
          <earliest>-15m</earliest>
          <latest>now</latest>
        </search>
        <option name="count">20</option>
        <option name="dataOverlayMode">none</option>
        <option name="drilldown">none</option>
        <option name="percentagesRow">false</option>
        <option name="refresh.display">progressbar</option>
        <option name="rowNumbers">false</option>
        <option name="totalsRow">false</option>
        <option name="wrap">true</option>
      </table>
    </panel>
  </row>
</dashboard>

jsuryaprakash
Path Finder

It’s only working for the first value of the user column.
For other values in that column it’s showing no data. Can you please look into it.

0 Karma

mayurr98
Super Champion

It's working for me for each value of the user column. create a new dashboard and copy-paste entire XML.

0 Karma

jsuryaprakash
Path Finder

below is the query i achieved so far. i am unable to parse the token value

DrillDown

<panel>
  <table>
    <search>
      <query>index=_*|stats dc(user) as user  by sourcetype host source</query>
      <earliest>-15m</earliest>
      <latest>now</latest>
    </search>
    <drilldown>
      <set token="show_panel">true</set>
      <set token="selected_value">$click.value2$</set>
    </drilldown>
  </table>
</panel>


<panel depends="$selected_value$">
  <table>
    <search>
      <query>index=_* |stats values(user) as user  by sourcetype host source | mvexpand user| search user=$selected_value$ </query>
      <earliest>-15m</earliest>
      <latest>now</latest>
    </search>
    <option name="count">20</option>
    <option name="dataOverlayMode">none</option>
    <option name="drilldown">none</option>
    <option name="percentagesRow">false</option>
    <option name="refresh.display">progressbar</option>
    <option name="rowNumbers">false</option>
    <option name="totalsRow">false</option>
    <option name="wrap">true</option>
  </table>
</panel>
0 Karma

jsuryaprakash
Path Finder

when i click on user count for example its taking user=4 . I want the value values instead of number.

0 Karma
Get Updates on the Splunk Community!

Fall Into Learning with New Splunk Education Courses

Every month, Splunk Education releases new courses to help you branch out, strengthen your data science roots, ...

Super Optimize your Splunk Stats Searches: Unlocking the Power of tstats, TERM, and ...

By Martin Hettervik, Senior Consultant and Team Leader at Accelerate at Iver, Splunk MVPThe stats command is ...

How Splunk Observability Cloud Prevented a Major Payment Crisis in Minutes

Your bank's payment processing system is humming along during a busy afternoon, handling millions in hourly ...