Dashboards & Visualizations

Link a dashboard using drilldown

Uday
Explorer

Hi,

I am trying to link two  dashboards using drilldown option.

If I drilldown on server A, it should link to dashboard X.

If I drilldown on server B, it should link to dashboard Y.

Please suggest how to achieve this.

Labels (1)
0 Karma

bowesmana
SplunkTrust
SplunkTrust

@Uday 

When you save 'Server A' or 'Server B' do you mean the values in a table or a chart?

If you're talking about field values, then the token $click.value$ or $row.XX$ (for tables) will contain the value of that field you have clicked. 

You can then use a <condition> element with a match statement that can match to the value you're expecting and set the link URL accordingly.

See this document about token usage in dashboards, which has examples of using drilldown tokens and conditions.

https://docs.splunk.com/Documentation/Splunk/8.1.0/Viz/tokens

 

0 Karma

Marco
Communicator

Hi @Uday ,

If you click the source button, then find your visualization in the XML code, you should see this line of code:

<option name="charting.drilldown">none</option>

change that to all:

<option name="charting.drilldown">all</option>

Then inside the drilldown brackets add your conditions:

<drilldown>
<condition field="A">
<link target="_blank">X</link>
</condition>
<condition field="B">
<link target="_blank">Y</link>
</condition>

</drilldown>

 

-Marco

0 Karma

Uday
Explorer

Thank you. Please see the attached screenshot. I am not using a chart. I have both Unix and Windows servers. The window servers will have “w” in the server names highlighted in green and the rest are Unix servers. If I drill down on Windows server, it should take me to Y dashboard. If it is Unix server, it should take me to C dashboard.

0 Karma

bowesmana
SplunkTrust
SplunkTrust

@Uday 

Save this as a new dashboard. It shows 2 examples of doing what you want with the drilldown.

Left panel uses drilldown condition matching to determine which url and right hand uses pre-evaluated url path and hides that field in the table with the <fields> statement (can be done with tables).

<dashboard>
  <label>Test</label>
  <row>
    <panel>
      <title>This panel uses condition matches to check server name</title>
      <table>
        <search>
          <query>
| makeresults 
| eval servers=mvrange(1,11) 
| mvexpand servers 
| eval type=mvindex(split("W,U",","),random() % 2 - 1)
| eval status=mvindex(split("UP,DOWN",","),random() % 2 - 1)
| eval server=printf("%c_Server_%02d", type, servers)
| table server, status
          </query>
        </search>
        <option name="drilldown">row</option>
        <drilldown>
          <condition match="match($row.server$,&quot;W&quot;)">
            <link target="_blank">https://www.google.com.au?q=Windows</link>
          </condition>
          <condition match="match($row.server$,&quot;U&quot;)">
            <link target="_blank">https://www.google.com.au?q=Unix</link>
          </condition>
          <condition field="*"></condition>
        </drilldown>
      </table>
    </panel>
    <panel>
      <title>This panel uses fields statement and evaluated dashboard path</title>
      <table>
        <search>
          <query>
| makeresults 
| eval servers=mvrange(1,11) 
| mvexpand servers 
| eval type=mvindex(split("W,U",","),random() % 2 - 1)
| eval status=mvindex(split("UP,DOWN",","),random() % 2 - 1)
| eval server=printf("%c_Server_%02d", type, servers)
| table server, status
| eval dashboard=if(match(server,"W"),"path_to_y_dahsboard", "path_to_c_dashboard")
          </query>
        </search>
        <option name="drilldown">row</option>
        <fields>"server","status"</fields>
        <drilldown>
          <link target="_blank">$row.dashboard$</link>
        </drilldown>
      </table>
    </panel>
  </row>
</dashboard>

Hope this helps

 

0 Karma
Get Updates on the Splunk Community!

What the End of Support for Splunk Add-on Builder Means for You

Hello Splunk Community! We want to share an important update regarding the future of the Splunk Add-on Builder ...

Solve, Learn, Repeat: New Puzzle Channel Now Live

Welcome to the Splunk Puzzle PlaygroundIf you are anything like me, you love to solve problems, and what ...

Building Reliable Asset and Identity Frameworks in Splunk ES

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