Dashboards & Visualizations

Color range over time by field

Suresh
Engager

Hi 

I had a search to get the range of colors which shows the availablity significance over time

My search is like below

Index=xyz | bucket span=1h l  eval ftime =strftime(_time, "%d-%m-%Y %H:%M") | chart values (percent) as requests over country by ftime

 

My columns varies dynamically as per the time range and span of my bucket

Where I need to set color as 

Percentage 0 to   50 = red( back ground color)

Percentage 50-90= yellow( back ground color)

Percentage 90-100= green(back ground color)

My results comes as

Bg: background color

=============================

Country  1-05-20 01:00. 1-05-20 01:00 

US.                 99.(red bg)                      80(yellow bg)

==================================

For the case if column is constant then it is working fine 

<format type='color' field= "name">

But here the column field is dynamic, can some help me how to achieve  this in XML  please

 

 

 

Labels (2)
0 Karma
1 Solution

to4kawa
Ultra Champion

Why  don't you try

 

<format type="color">

 

without field  designation

 

sample:

<dashboard>
  <label>table background color</label>
  <row>
    <panel>
      <table>
        <search>
          <query>| tstats avg(PREFIX("average_kbps=")) as average_kbps where index=_internal source="*metrics.log" by _time span=1d
| eval header="average_kbps" , time=strftime(_time,"%F")
| eventstats max(average_kbps) as maximum
| eval perc=round(average_kbps / maximum * 100)
| xyseries header time perc</query>
          <earliest>0</earliest>
          <latest></latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <format type="color">
          <colorPalette type="list">[#FF0000,#FFFF00,#53A051]</colorPalette>
          <scale type="threshold">50,90</scale>
        </format>
      </table>
    </panel>
  </row>
</dashboard>

View solution in original post

to4kawa
Ultra Champion

Why  don't you try

 

<format type="color">

 

without field  designation

 

sample:

<dashboard>
  <label>table background color</label>
  <row>
    <panel>
      <table>
        <search>
          <query>| tstats avg(PREFIX("average_kbps=")) as average_kbps where index=_internal source="*metrics.log" by _time span=1d
| eval header="average_kbps" , time=strftime(_time,"%F")
| eventstats max(average_kbps) as maximum
| eval perc=round(average_kbps / maximum * 100)
| xyseries header time perc</query>
          <earliest>0</earliest>
          <latest></latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <format type="color">
          <colorPalette type="list">[#FF0000,#FFFF00,#53A051]</colorPalette>
          <scale type="threshold">50,90</scale>
        </format>
      </table>
    </panel>
  </row>
</dashboard>

Suresh
Engager

Thanks it worked 🙂

0 Karma
Get Updates on the Splunk Community!

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...

[Live Demo] Watch SOC transformation in action with the reimagined Splunk Enterprise ...

Overwhelmed SOC? Splunk ES Has Your Back Tool sprawl, alert fatigue, and endless context switching are making ...

What’s New & Next in Splunk SOAR

Security teams today are dealing with more alerts, more tools, and more pressure than ever.  Join us on ...