Splunk Search

How to set radialGauge text value?

hazekamp
Builder

How can I set a static value on a radial Gauge instead of the event count? I have tried:

  <module name="HiddenChartFormatter">
    <param name="charting.chart">radialGauge</param>
    <param name="charting.valueStyle.text">Access</param>
Tags (1)
0 Karma
1 Solution

cgilbert_splunk
Splunk Employee
Splunk Employee

My strong suspicion is that this isn't supported. The description for the Radial guage is:

The radialGauge, like the other gauge chart types, enables the visualization of a single numerical value mapped against a range of colors that may have particular business meaning or logic. The radial gauge is similar in appearance to a speedometer in appearance; it has an arced range scale and a rotating needle.

Also, referencing the chart legend in the developers manual:

http://www.splunk.com/base/Documentation/latest/Developer/CustomChartingConfig-ChartLegend#radialgau...

Please note that the "valueStyle" property appears to be the only one that allows for modification of the value at the bottom of the gauge...but the description specifically references that you can't use this parameter to permit setting of a text string.

"valueStyle style Provides the style properties for the value at the bottom of the gauge. Note that valueStyle can be used to change the way the value displays (font, bolding, italicization, and so on.), but it can't be used to actually change the text itself. For example, you can't use valueStyle to replace the value with a specific text string. See the textBlock table for specific defaults."

If I locate anything that indicates that your use-case is supported, I'll definitely update this answer...but as of now, I don't believe it is.

View solution in original post

0 Karma

cgilbert_splunk
Splunk Employee
Splunk Employee

My strong suspicion is that this isn't supported. The description for the Radial guage is:

The radialGauge, like the other gauge chart types, enables the visualization of a single numerical value mapped against a range of colors that may have particular business meaning or logic. The radial gauge is similar in appearance to a speedometer in appearance; it has an arced range scale and a rotating needle.

Also, referencing the chart legend in the developers manual:

http://www.splunk.com/base/Documentation/latest/Developer/CustomChartingConfig-ChartLegend#radialgau...

Please note that the "valueStyle" property appears to be the only one that allows for modification of the value at the bottom of the gauge...but the description specifically references that you can't use this parameter to permit setting of a text string.

"valueStyle style Provides the style properties for the value at the bottom of the gauge. Note that valueStyle can be used to change the way the value displays (font, bolding, italicization, and so on.), but it can't be used to actually change the text itself. For example, you can't use valueStyle to replace the value with a specific text string. See the textBlock table for specific defaults."

If I locate anything that indicates that your use-case is supported, I'll definitely update this answer...but as of now, I don't believe it is.

0 Karma

jgatt
Splunk Employee
Splunk Employee

That's correct - not supported. The note in the dev manual was actually just added yesterday in response to an email conversation about this post.

0 Karma

cgilbert_splunk
Splunk Employee
Splunk Employee

What does your search look like? Here's mine:

search = * | head 1 | eval count = 32 | gauge count 0 25 50 75 100

What I get is a radial gauge with 0-100 in increments of 10...with "32" in the middle of the gauge and the hand pointing to where 32 would be on the gauge.

0 Karma

hazekamp
Builder

Agreed. I want it do display static text i.e a label, not a #.

0 Karma

cgilbert_splunk
Splunk Employee
Splunk Employee

Do you want a static value to appear in the center of the gauge, or a static range on the radial portion?

If you want the latter, you can pipe to the "gauge count" command, followed by the values you want to demarcate the gauge "colors" by.

So, issuing "| gauge count 0 25 50 75 100" after your search will start the gauge at "0", then end the green area at "25", the next colored area at "50"...etc (the number of colors is determined by the number of values you use after "count"..basically, n-1) .

Now the arc of the gauge can actually have different values listed than you specified (or not)...in this case, my search will produce an arc where the increments go from 0-100 by 10s...but I've seen other behavior based on the number of parameters you use and other factors.

Now, if you want to have a static value appear in the CENTER of the gauge, I think you can just change the value of the count using eval...something like this: "| eval count = 1000"

Hopefully either of these answered your question.

0 Karma

hazekamp
Builder

cgilbert. I was looking to perform the latter. I tried the | eval x="MyString" to set the x-axis statically, but the radial displays 0 instead.

0 Karma
Get Updates on the Splunk Community!

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...