Splunk Search

Sync Max Y Value Between Different Charts

k_ivesic
Explorer

Hi everyone. I have three charts in a panel in a Simple XML dashboard and I'm trying to programmatically (i.e., with tokens) sync the maximum value of the Y axis. The idea is that the value, determined by the maximum value of all three charts, is used in all three charts. Any clues? I tried setting a token in each of the three searches and then another token as max of these tokens. The resulting token was used to set the maxY value, but it doesn't work.

This is the token initialization:

 

 

  <init>
    <set token="max_y_version">0</set>
    <set token="max_y_version1">0</set>
    <set token="max_y_version2">0</set>
    <set token="max_y_version3">0</set>
  </init>

 

 

 

And this is an example chart (I have three of these):

 

 

<chart>
        <search>
          <done>
            <eval token="max_y_version1">$result.max_count$</eval>
            <eval token="max_y_version">max($max_y_version1$, $max_y_version2$, $max_y_version3$)</eval>
          </done>
          <query>(some query which creates results containing max_count in the first row...)</query>
        </search>
        <option name="charting.axisY.maximumNumber">$max_y_version$</option>
        <option name="charting.axisTitleX.text">Date</option>
        <option name="charting.axisTitleX.visibility">collapsed</option>
        <option name="charting.chart">column</option>
        <option name="charting.chart.stackMode">stacked</option>
        <option name="charting.drilldown">none</option>
        <option name="charting.legend.placement">top</option>
        <option name="refresh.display">progressbar</option>
      </chart>

 

 

 

Any clues? Thanks.

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

What you are doing appears to be correct (and works in my environment). Check that there are no typos and that the value set for the maximum is numeric for all instances where it is retrieved.

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

What you are doing appears to be correct (and works in my environment). Check that there are no typos and that the value set for the maximum is numeric for all instances where it is retrieved.

0 Karma

k_ivesic
Explorer

Hi @ITWhisperer 

Thank you for your answer. Yes, although my max_count was clearly a number, the conversion was still needed. I modified the code a bit and now it seems to work fine:

<eval token="max_y_version1">tonumber($result.max_count$)</eval>
<eval token="max_y_version">max(tonumber($result.max_count$), $max_y_version2$, $max_y_version3$)</eval>
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 ...