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!

Earn a $35 Gift Card for Answering our Splunk Admins & App Developer Survey

Survey for Splunk Admins and App Developers is open now! | Earn a $35 gift card!      Hello there,  Splunk ...

Continuing Innovation & New Integrations Unlock Full Stack Observability For Your ...

You’ve probably heard the latest about AppDynamics joining the Splunk Observability portfolio, deepening our ...

Monitoring Amazon Elastic Kubernetes Service (EKS)

As we’ve seen, integrating Kubernetes environments with Splunk Observability Cloud is a quick and easy way to ...