Dashboards & Visualizations

Dynamic Drilldowns - pass token over and populate new token depending on selected column on graph

deanamite90
New Member

I have a dashboard with which I have to select a month token.
On this dashboard I have a graph which shows a Customer against Efficiency (£).

When I click on one of the Customers on my graph I want it drilldown to a new dashboard.
On this new dashboard I want the month token I already had to be passed down but also populate a Customer token.
The Customer token should be populated with the customer that I selected on the graph.

So effectively:
Month token --> (new dashbaord) --> Month token
Customer on graph --> (new dashbaord) --> Customer token

The XML for my Customer v Efficiency graph is below.

<panel>
      <title>Customer Efficiency</title>
      <chart>
        <search>
          <query>index="commercial_performance" $month_token$ Cat1="Efficiency Variance *" Value!="within *" | eval Efficiency=round('Value',0) |  stats sum(Value) AS Efficiency by Customer | sort + Efficiency | eval Efficiency_G=if(Efficiency&gt;0,Efficiency,0) | eval Efficiency_R=if(Efficiency_G=0,Efficiency,0) | table Customer Efficiency_*</query>
          <earliest>0</earliest>
        </search>
        <option name="charting.chart">bar</option>
        <option name="height">550</option>
        <option name="charting.fieldColors">{"Efficiency_R":0xFF0000,"Efficiency_G":0x73A550}</option>
        <option name="charting.axisY2.enabled">undefined</option>
        <option name="charting.axisLabelsX.majorLabelStyle.overflowMode">ellipsisNone</option>
        <option name="charting.axisLabelsX.majorLabelStyle.rotation">-90</option>
        <option name="charting.axisTitleX.visibility">visible</option>
        <option name="charting.axisTitleY.visibility">visible</option>
        <option name="charting.axisTitleY2.visibility">visible</option>
        <option name="charting.axisX.scale">linear</option>
        <option name="charting.axisY.scale">linear</option>
        <option name="charting.axisY2.scale">inherit</option>
        <option name="charting.chart.bubbleMaximumSize">50</option>
        <option name="charting.chart.bubbleMinimumSize">10</option>
        <option name="charting.chart.bubbleSizeBy">area</option>
        <option name="charting.chart.nullValueMode">gaps</option>
        <option name="charting.chart.sliceCollapsingThreshold">0.01</option>
        <option name="charting.chart.stackMode">stacked</option>
        <option name="charting.chart.style">shiny</option>
        <option name="charting.drilldown">all</option>
        <option name="charting.layout.splitSeries">0</option>
        <option name="charting.legend.labelStyle.overflowMode">ellipsisMiddle</option>
        <option name="charting.legend.placement">none</option>
        <option name="charting.axisTitleY.text">Efficiency (£)</option>
        <drilldown>
          <link>https://146.105.85.57/en-GB/app/Commercial/second_level_customer_dashboard</link>
        </drilldown>
        <option name="wrap">true</option>
        <option name="rowNumbers">false</option>
        <option name="dataOverlayMode">none</option>
      </chart>
    </panel>

You can see the link of the dashboard I want to drilldown to above.

Hopefully I have explained this well enough. Any questions don't hesitate to ask.

0 Karma

somesoni2
Revered Legend

Try this

<panel>
      <title>Customer Efficiency</title>
      <chart>
        <search>
          <query>index="commercial_performance" $month_token$ Cat1="Efficiency Variance *" Value!="within *" | eval Efficiency=round('Value',0) |  stats sum(Value) AS Efficiency by Customer | sort + Efficiency | eval Efficiency_G=if(Efficiency>0,Efficiency,0) | eval Efficiency_R=if(Efficiency_G=0,Efficiency,0) | table Customer Efficiency_*</query>
          <earliest>0</earliest>
        </search>
        <option name="charting.chart">bar</option>
        <option name="height">550</option>
        <option name="charting.fieldColors">{"Efficiency_R":0xFF0000,"Efficiency_G":0x73A550}</option>
        <option name="charting.axisY2.enabled">undefined</option>
        <option name="charting.axisLabelsX.majorLabelStyle.overflowMode">ellipsisNone</option>
        <option name="charting.axisLabelsX.majorLabelStyle.rotation">-90</option>
        <option name="charting.axisTitleX.visibility">visible</option>
        <option name="charting.axisTitleY.visibility">visible</option>
        <option name="charting.axisTitleY2.visibility">visible</option>
        <option name="charting.axisX.scale">linear</option>
        <option name="charting.axisY.scale">linear</option>
        <option name="charting.axisY2.scale">inherit</option>
        <option name="charting.chart.bubbleMaximumSize">50</option>
        <option name="charting.chart.bubbleMinimumSize">10</option>
        <option name="charting.chart.bubbleSizeBy">area</option>
        <option name="charting.chart.nullValueMode">gaps</option>
        <option name="charting.chart.sliceCollapsingThreshold">0.01</option>
        <option name="charting.chart.stackMode">stacked</option>
        <option name="charting.chart.style">shiny</option>
        <option name="charting.drilldown">all</option>
        <option name="charting.layout.splitSeries">0</option>
        <option name="charting.legend.labelStyle.overflowMode">ellipsisMiddle</option>
        <option name="charting.legend.placement">none</option>
        <option name="charting.axisTitleY.text">Efficiency (£)</option>
        <drilldown>
          <link> <![CDATA[/app/Commercial/second_level_customer_dashboard?form.month_token=$month_token$&form.customer=$click.value2$]]></link>
        </drilldown>
        <option name="wrap">true</option>
        <option name="rowNumbers">false</option>
        <option name="dataOverlayMode">none</option>
      </chart>
    </panel>

Ensure that second_level_customer_dashboard has data inputs (dropdown/textbox etc) with token name as month_token and customer to old the passed values.

deanamite90
New Member

On both dashboards the month_token is the same

  <label>Month</label>
  <choice value="*">All</choice>
  <search>
    <query>index="commercial_performance" | dedup date_month | table _time date_month | sort -  _time</query>
  </search>
  <fieldForLabel>date_month</fieldForLabel>
  <fieldForValue>date_month</fieldForValue>
  <prefix>(</prefix>
  <suffix>)</suffix>
  <valuePrefix>date_month="</valuePrefix>
  <valueSuffix>"</valueSuffix>
  <delimiter> OR </delimiter>
</input>

Here is the customer_token on the second dashboard

  <label>Customer</label>
  <choice value="*">All</choice>
  <search>
    <query>index="commercial_performance" NOT "FCO" NOT "BT" | dedup Customer | table Customer | sort  Customer</query>
    <earliest>0</earliest>
  </search>
  <fieldForLabel>Customer</fieldForLabel>
  <fieldForValue>Customer</fieldForValue>
  <prefix>(</prefix>
  <suffix>)</suffix>
  <valuePrefix>Customer="</valuePrefix>
  <valueSuffix>"</valueSuffix>
  <delimiter> OR </delimiter>
</input>

When I tried the code above in the month_token on the second dashbaord it said '(date_month="august")' and nothing was populated in the Customer_token

0 Karma

yuanliu
SplunkTrust
SplunkTrust

@somesoni2 do you happen to know if in some conditions $click.value2$ won't work in "advanced XML"? Or is this caused by some server-side configuration glitch? After using $click.value2$ in simple XML on my desktop, I had to work with "advanced XML" in "real server". By then, I could only use <param>row<\/param>. If I attempt any other value, any click results in null for all variables.

0 Karma

somesoni2
Revered Legend

THis is the link for drilldown token available in simple xml

http://docs.splunk.com/Documentation/Splunk/6.2.5/Viz/PanelreferenceforSimplifiedXML#Drilldown_event...

This one for Advanced xml
http://docs.splunk.com/Documentation/Splunk/5.0.4/Viz/Dynamicdrilldownindashboardsandforms

My guess is that you should be able to use $click.value$

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...