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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...