Dashboards & Visualizations

color in single value which change if minus or plus result

jip31
Motivator

Hello

In a single value result (see attachment) i want that if the result is minus then the color is green but if the result is + the color is red
but impossible to do this with the formant command
pearhaps in xml??
could you help me please?

Tags (1)
0 Karma

adonio
Ultra Champion

hello there:

try this, click refresh couple times as it uses random command to generate positive or negative results

<dashboard>
  <label>minus_green_plus_red</label>
  <row>
    <panel>
      <single>
        <search>
          <query>| gentimes start="10/10/2018:00:00:00" end="10/11/2018:90:00:00" increment=1h
| eval _time = starttime 
| eval value = random()%100
| eval next_value = if(value>50,value,-1*value)
| timechart span=1h max(next_value) as plus_or_minus</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="colorBy">value</option>
        <option name="colorMode">block</option>
        <option name="drilldown">none</option>
        <option name="numberPrecision">0</option>
        <option name="rangeColors">["0x65a637","0xd93f3c"]</option>
        <option name="rangeValues">[0]</option>
        <option name="showSparkline">1</option>
        <option name="showTrendIndicator">1</option>
        <option name="trellis.enabled">0</option>
        <option name="trellis.scales.shared">1</option>
        <option name="trellis.size">medium</option>
        <option name="trendColorInterpretation">standard</option>
        <option name="trendDisplayMode">absolute</option>
        <option name="unitPosition">after</option>
        <option name="useColors">1</option>
        <option name="useThousandSeparators">1</option>
      </single>
    </panel>
    <panel>
      <single>
        <search>
          <query>| gentimes start="10/10/2018:00:00:00" end="10/11/2018:90:00:00" increment=1h
| eval _time = starttime 
| eval value = random()%100
| eval next_value = if(value>50,value,-1*value)
| timechart span=1h max(next_value) as plus_or_minus</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="colorBy">value</option>
        <option name="colorMode">block</option>
        <option name="drilldown">none</option>
        <option name="numberPrecision">0</option>
        <option name="rangeColors">["0x65a637","0xd93f3c"]</option>
        <option name="rangeValues">[0]</option>
        <option name="showSparkline">1</option>
        <option name="showTrendIndicator">1</option>
        <option name="trellis.enabled">0</option>
        <option name="trellis.scales.shared">1</option>
        <option name="trellis.size">medium</option>
        <option name="trendColorInterpretation">standard</option>
        <option name="trendDisplayMode">absolute</option>
        <option name="unit">%</option>
        <option name="unitPosition">after</option>
        <option name="useColors">1</option>
        <option name="useThousandSeparators">1</option>
      </single>
    </panel>
  </row>
</dashboard>

screenshot:

alt text

0 Karma

jip31
Motivator

thanks but i dont reach to adapt it to my xml

0 Karma

jip31
Motivator

nobody have an idea please??

0 Karma
Get Updates on the Splunk Community!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...