Splunk Search

Change bar chart bar color based on percentage value

zd00191
Communicator
tag="*" LocID="-7" SbuID="-7" | dedup tag |eval x=substr(ResponseDisplay,1,3) |eval y=substr(AvailabilityDisplay,1,3)| stats values(x) values(y) by tag  

I have the search running below. x is a number up to 100. If x is greater than 75, I want it to be green. If it is 50 or below, I would like it to be red. Otherwise I want it to be yellow (51-74). Same thing for y. Please help! Thanks!

This is what I have for xml so far.

    <chart>
      <title>AHM Main</title>
      <searchString>tag="*" LocID="-7" SbuID="-7" | dedup tag |eval x=substr(ResponseDisplay,1,3) |eval y=substr(AvailabilityDisplay,1,3)| stats values(x) values(y) by tag</searchString>
      <earliestTime>-15m</earliestTime>
      <latestTime>now</latestTime>
      <option name="charting.axisTitleX.visibility">visible</option>
      <option name="charting.axisTitleY.visibility">visible</option>
      <option name="charting.axisX.scale">linear</option>
      <option name="charting.axisY.scale">linear</option>
      <option name="charting.chart">column</option>
      <option name="charting.chart.nullValueMode">gaps</option>
      <option name="charting.chart.sliceCollapsingThreshold">0.01</option>
      <option name="charting.chart.stackMode">default</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">bottom</option>
      <option name="charting.axisY.maximumNumber">100</option>
      <option name="charting.axisTitleX.text">Application</option>
      <option name="charting.fieldColors">{"reda":0xFF0000,"yellowa":0xFFFF00, "greena":0x73A550, "redr":0xFF0000,"yellowr":0xFFFF00, "greenr":0x73A550}</option>
    </chart>
0 Karma
1 Solution

martin_mueller
SplunkTrust
SplunkTrust

Update to 6.2 and take a look at the new Distributed Management Console. For example, http://splunk_host:8000/en-US/app/splunk_management_console/resource_usage_instance has several bar charts coloured according to percentage.

View solution in original post

martin_mueller
SplunkTrust
SplunkTrust

Update to 6.2 and take a look at the new Distributed Management Console. For example, http://splunk_host:8000/en-US/app/splunk_management_console/resource_usage_instance has several bar charts coloured according to percentage.

Get Updates on the Splunk Community!

What's New in Splunk Cloud Platform 9.3.2411?

Hey Splunky People! We are excited to share the latest updates in Splunk Cloud Platform 9.3.2411. This release ...

Buttercup Games: Further Dashboarding Techniques (Part 6)

This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the ...

Technical Workshop Series: Splunk Data Management and SPL2 | Register here!

Hey, Splunk Community! Ready to take your data management skills to the next level? Join us for a 3-part ...