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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...