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!

CX Day is Coming!

Customer Experience (CX) Day is on October 7th!! We're so excited to bring back another day full of wonderful ...

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...