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
Get Updates on the Splunk Community!

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...

Cloud Monitoring Console - Unlocking Greater Visibility in SVC Usage Reporting

For Splunk Cloud customers, understanding and optimizing Splunk Virtual Compute (SVC) usage and resource ...

Automatic Discovery Part 3: Practical Use Cases

If you’ve enabled Automatic Discovery in your install of the Splunk Distribution of the OpenTelemetry ...