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!

Uncovering Multi-Account Fraud with Splunk Banking Analytics

Last month, I met with a Senior Fraud Analyst at a nationally recognized bank to discuss their recent success ...

Secure Your Future: A Deep Dive into the Compliance and Security Enhancements for the ...

What has been announced?  In the blog, “Preparing your Splunk Environment for OpensSSL3,”we announced the ...

New This Month in Splunk Observability Cloud - Synthetic Monitoring updates, UI ...

This month, we’re delivering several platform, infrastructure, application and digital experience monitoring ...