Dashboards & Visualizations

Drilldown not working correctly

jiaqya
Builder

i have a drilldown setup to open 2 different pages on 2 different clicks on the page.
but what i see is , whatever the click i do on the page , it only opens the first link, ie test1.
any body know what the issue is here.

      <condition match="match('click.name2', &quot;Today&quot;)">
        <eval token="test1">mvindex(split('click.value', "Test1"),0)</eval>
        <link>
          <![CDATA[/app/test1/test1?form.Name=$test1]]>
        </link>
      </condition>
      <condition match="match('click.name2', &quot;Today&quot;)">
        <eval token="test2">mvindex(split('click.value', "Test2"),0)</eval>
        <link>
          <![CDATA[/app/test2/test?form.Name=$test2$]]>
        </link>
      </condition>
      <condition></condition>
    </drilldown>
Tags (1)
0 Karma
1 Solution

kamlesh_vaghela
SplunkTrust
SplunkTrust

@jiaqya

I'm sharing 2 dashboards XML with you.

1) This dashboard is an example of on the base of the column name and value. It will open respective link also.

<dashboard>
  <label>Today</label>
  <row>
    <panel>
      <table>
        <search>
          <query>| makeresults count=2 | eval a=1 | accum a | eval OtherColumns=if(a==1,"Data Test1 Event?","Data Test2 Event?"), Today="Hello" | table OtherColumns Today</query>
        </search>
        <option name="count">20</option>
        <option name="dataOverlayMode">none</option>
        <option name="drilldown">cell</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>
        <drilldown>
          <condition match="match('click.name2',&quot;Today&quot;) AND match('click.value', &quot;Test1&quot;)">
             <eval token="test1">mvindex(split('click.value', "Test1"),0)</eval>
            <link target="_blank">/app/test1/test1?form.Name=$test1$</link>
          </condition>
          <condition match="match('click.name2',&quot;Today&quot;) AND match('click.value', &quot;Test2&quot;)">
            <eval token="test2">mvindex(split('click.value', "Test2"),0)</eval>
            <link target="_blank">/app/test2/test?form.Name=$test2$</link>
          </condition>
          <condition>
            <!-- Keep It Blank -->

          </condition>
        </drilldown>
      </table>
    </panel>
  </row>
  <row>
    <panel>
      <html>
        test1 = $test1$ <br/>
        test2 = $test2$ <br/>
      </html>
    </panel>
  </row>
</dashboard>

2) This dashboard is an example of open multiple link.

<dashboard>
  <label>Today</label>
  <row>
    <panel>
      <table>
        <search>
          <query>| makeresults count=2 | eval OtherColumns="Hi", Today="Hello" | table OtherColumns Today</query>
        </search>
        <option name="count">20</option>
        <option name="dataOverlayMode">none</option>
        <option name="drilldown">cell</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>
        <drilldown>
          <condition field="Today">
            <link target="_blank">https://www.google.com</link>
            <link target="_blank">https://www.yahoo.com</link>
          </condition>
          <condition>
          </condition>
        </drilldown>
      </table>
    </panel>
  </row>
</dashboard>

I suggest you to go with 1st option but take refernce as per your requirement.

View solution in original post

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@jiaqya

I'm sharing 2 dashboards XML with you.

1) This dashboard is an example of on the base of the column name and value. It will open respective link also.

<dashboard>
  <label>Today</label>
  <row>
    <panel>
      <table>
        <search>
          <query>| makeresults count=2 | eval a=1 | accum a | eval OtherColumns=if(a==1,"Data Test1 Event?","Data Test2 Event?"), Today="Hello" | table OtherColumns Today</query>
        </search>
        <option name="count">20</option>
        <option name="dataOverlayMode">none</option>
        <option name="drilldown">cell</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>
        <drilldown>
          <condition match="match('click.name2',&quot;Today&quot;) AND match('click.value', &quot;Test1&quot;)">
             <eval token="test1">mvindex(split('click.value', "Test1"),0)</eval>
            <link target="_blank">/app/test1/test1?form.Name=$test1$</link>
          </condition>
          <condition match="match('click.name2',&quot;Today&quot;) AND match('click.value', &quot;Test2&quot;)">
            <eval token="test2">mvindex(split('click.value', "Test2"),0)</eval>
            <link target="_blank">/app/test2/test?form.Name=$test2$</link>
          </condition>
          <condition>
            <!-- Keep It Blank -->

          </condition>
        </drilldown>
      </table>
    </panel>
  </row>
  <row>
    <panel>
      <html>
        test1 = $test1$ <br/>
        test2 = $test2$ <br/>
      </html>
    </panel>
  </row>
</dashboard>

2) This dashboard is an example of open multiple link.

<dashboard>
  <label>Today</label>
  <row>
    <panel>
      <table>
        <search>
          <query>| makeresults count=2 | eval OtherColumns="Hi", Today="Hello" | table OtherColumns Today</query>
        </search>
        <option name="count">20</option>
        <option name="dataOverlayMode">none</option>
        <option name="drilldown">cell</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>
        <drilldown>
          <condition field="Today">
            <link target="_blank">https://www.google.com</link>
            <link target="_blank">https://www.yahoo.com</link>
          </condition>
          <condition>
          </condition>
        </drilldown>
      </table>
    </panel>
  </row>
</dashboard>

I suggest you to go with 1st option but take refernce as per your requirement.

0 Karma

jiaqya
Builder

Option 1 works perfectly for me, thanks..
never knew i could use a "AND" inside the condition eval. There is so much to know in SPL...

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@jiaqya

The behaviour of condition tag is if the first condition matches then it will execute that block and skip others.

In your shared sample code, both the condition are same and might be possible your every click is matchig with first condition.

<condition match="match('click.name2', &quot;Today&quot;)">
.
.
.
<condition match="match('click.name2', &quot;Today&quot;)">

0 Karma

jiaqya
Builder

That exactly seems to be the problem, i have correct it by adjusting columns.
Now i have a row , but i want to only drilldown on the "Today" column.
currently the full row is drilldownable..

column names are dynamic, ex: jan2020 feb2020 Today..... except Today.
so how do i exclude the other columns dynamically. can i use a wild card for column names ?

0 Karma

manjunathmeti
Champion

You can only add one link drill-down to a column. When user clicks a value you can display two links and ask them click to go to those links, check if this works for you.

<panel>
     ....
       <table>
        ....
        <drilldown>
          <condition match="match('click.name2', &quot; Today&quot;)">
            <eval token="test1">mvindex(split('click.value', "Test1"),0)</eval>
            <eval token="test2">mvindex(split('click.value', "Test2"),0)</eval>
          </condition>
        </drilldown>
      </table>
      <html depends="$test1$">
          <h3>Click below to go to forms:</h3>
            <a href="/app/test1/test1?form.Name=$test1$" target="_blank">Test1</a>
            <br/>
            <a href="/app/test2/test?form.Name=$test2$" target="_blank">Test2</a>
      </html>
</panel>
0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...