Dashboards & Visualizations

How to pass down token base on row click

tungpx
Explorer

Hello, 

I have a table in a dashboard like so 

User ID1 ID2
A ABC 123
B DEF 456
C GHJ 789

 

I have set a dilldown token like so

<set token="id1">$row.ID1$</set>
<set token="id1">$row.ID1$</set>

I have a below table that I want to pass these token down. For example, when I click at ABC at ID1, it will pass the token id1 aka value "ABC" to below query, when I click at 456 at ID2  it will pass the token id2 aka value "456" to below query. 

The query will be 

index=myindex $id1$  (if I click on a value in ID1 column)

or

index=myindex $id2$ (if I click on a value in ID2 column)

I push in the right direction would be very appriciated. 

Thank you

Labels (3)
0 Karma
1 Solution

renjith_nair
Legend

@tungpx 
Just assign the $click.value2$ to your token on drilldown.

Here is a run anywhere example

<dashboard version="1.1" theme="light">
  <label>Table DrillDown</label>
  <row>
    <panel>
      <table>
        <search>
          <query>|makeresults
| eval user="A B C"
| makemv user
| mvexpand user
| streamstats count
| eval ID1=user.count
| eval ID2=user.count.0
| fields - _time</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">cell</option>
        <drilldown>
          <set token="token_value">$click.value2$</set>
        </drilldown>
      </table>
    </panel>
  </row>
  <row>
    <panel>
      <html>
        <h2> index=myindex <b> <font color="red"> ID=$token_value$ </font> </b></h2>
      </html>
    </panel>
  </row>
</dashboard>
---
What goes around comes around. If it helps, hit it with Karma 🙂

View solution in original post

renjith_nair
Legend

@tungpx 
Just assign the $click.value2$ to your token on drilldown.

Here is a run anywhere example

<dashboard version="1.1" theme="light">
  <label>Table DrillDown</label>
  <row>
    <panel>
      <table>
        <search>
          <query>|makeresults
| eval user="A B C"
| makemv user
| mvexpand user
| streamstats count
| eval ID1=user.count
| eval ID2=user.count.0
| fields - _time</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">cell</option>
        <drilldown>
          <set token="token_value">$click.value2$</set>
        </drilldown>
      </table>
    </panel>
  </row>
  <row>
    <panel>
      <html>
        <h2> index=myindex <b> <font color="red"> ID=$token_value$ </font> </b></h2>
      </html>
    </panel>
  </row>
</dashboard>
---
What goes around comes around. If it helps, hit it with 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!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...