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!

Mastering Threat Intelligence in ES 8.5, Splunk AI Assistant v2, and More from Splunk ...

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...

Break the Build: Inside the KubeDoom Lounge at .conf26

    You step up to the machine. The pixelated corridors of a certain 1993 FPS load in front of you, EMP Pulse ...

Splunk Auto Ingestion Parallel Pipeline Scaling

Why this feature matters Many Splunk environments experience ingestion pressure long before the host is fully ...