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
SplunkTrust
SplunkTrust

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
SplunkTrust
SplunkTrust

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

Suresh
Engager

Thanks it worked 🙂

0 Karma
.conf21 Now Fully Virtual!
Register for FREE Today!

We've made .conf21 totally virtual and totally FREE! Our completely online experience will run from 10/19 through 10/20 with some additional events, too!