Dashboards & Visualizations

dynamic drilldown on table value

simona2121
Path Finder

I have a table Fruits. Under Fruits table I have value "apple" "grape" "kiwi"

I want to redirect the page to a new page depending on which row the user has clicked. So, if i click on "kiwi" (from the table values), I should be redirected to "abc" page, if i click on "apple" (from the table values), I should be redirected to "xyz" page. I have been trying to use the drilldown tag. but it only redirects to one single page irrespective of the value of the table clicked by user.

Tags (1)
0 Karma
1 Solution

sundareshr
Legend

Try this updated answer

 <panel>
   <table>
     <search>
       <query>basequery</query>
       <earliest>$field1.earliest$</earliest>
       <latest>$field1.latest$</latest>
     </search>
     <option name="wrap">true</option>
     <option name="rowNumbers">false</option>
     <option name="dataOverlayMode">none</option>
     <option name="drilldown">row</option>
     <option name="count">10</option>
     <drilldown>
        <condition match="match(`click.value2`=&quot;kiwi&quot;)">
        <set token="abc">$click.value2$</set>
        <link>
            //pathOfNewPage?form.abc=$valueOfFieldname(eg:kiwi, apple)$
        </link>
        </condition>
     </drilldown> 
   </table>
 </panel>

View solution in original post

0 Karma

sundareshr
Legend

Try this updated answer

 <panel>
   <table>
     <search>
       <query>basequery</query>
       <earliest>$field1.earliest$</earliest>
       <latest>$field1.latest$</latest>
     </search>
     <option name="wrap">true</option>
     <option name="rowNumbers">false</option>
     <option name="dataOverlayMode">none</option>
     <option name="drilldown">row</option>
     <option name="count">10</option>
     <drilldown>
        <condition match="match(`click.value2`=&quot;kiwi&quot;)">
        <set token="abc">$click.value2$</set>
        <link>
            //pathOfNewPage?form.abc=$valueOfFieldname(eg:kiwi, apple)$
        </link>
        </condition>
     </drilldown> 
   </table>
 </panel>
0 Karma

simona2121
Path Finder

Doesnt work. 😞

0 Karma

sundareshr
Legend

Please share your dashboard code (xml)

0 Karma

simona2121
Path Finder

Fruits

<input type="time" token="field1">
  <label></label>
  <default>
    <earliest>0</earliest>
    <latest></latest>
  </default>
</input>


<panel>
  <table>
    <search>
      <query>basequery</query>
      <earliest>$field1.earliest$</earliest>
      <latest>$field1.latest$</latest>
    </search>
    <option name="wrap">true</option>
    <option name="rowNumbers">false</option>
    <option name="dataOverlayMode">none</option>
    <option name="drilldown">cell</option>
    <option name="count">10</option>

      <set token="abc">$click.value2$</set>
        <link>
     //pathOfNewPage?form.abc=$valueOfFieldname(eg:kiwi, apple)$
    </link>
    </drilldown> 
  </table>
</panel>
0 Karma

sundareshr
Legend

Try updated answer

0 Karma

simona2121
Path Finder

I did. It gives me a error at this line

.. and which is why i am unable o save the xml query at all.

0 Karma

simona2121
Path Finder

Extra content at the end of the document

0 Karma

sundareshr
Legend

Try this working run-anywhere sample.

<dashboard>
  <label>Test Dashboard</label>
  <row>
    <panel>
      <table>
        <title>$x$</title>
        <search>
          <query>index=_internal | stats count by sourcetype</query>
          <earliest>-15m</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">row</option>
        <option name="refresh.display">preview</option>
        <drilldown>
          <condition match="match('click.value', &quot;splunk&quot;)">
            <link>http://www.splunk.com</link>
          </condition>
          <condition field="*">
            <set token="x">did not match</set>
          </condition>
        </drilldown>
      </table>
    </panel>
  </row>
</dashboard>
0 Karma

simona2121
Path Finder

Omg!! Thank you so much
It works flawlessly

0 Karma

sundareshr
Legend

Do you want to change the path of the link based on user selection or just a value in the querystring?

0 Karma

simona2121
Path Finder

want to change it Based on the value of row the user clicks on.

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!

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...