All Apps and Add-ons

How to change Status Indicator size

guimilare
Communicator

Hello Splunkers.

I have 2 questions about Status Indicator Viz and believe you guys can help me.

1) Is it possible to limit the size of the icon?
I know that with Single Value I can resize it using

<option name="height">300px</option>

Do I need a CSS to do that? What I have is on figure 1 and what I want is on figure 2:
alt text

alt text
BTW, at figure 2 I manually resized the Status Indicator with mouse.

2) Can I show a different icon based on value? For example, check icon when value is 0 and error icon when value is greather than 0?
I tried to use the option "Field Value" under format but no success.

Thank you!
Regards,

0 Karma
1 Solution

niketn
Legend

For any search that generates a numeric field like result, icon and color fields need to be mapped. Following are two options:

Option 1 - Use Rangemap to set range_color and range_icon


| table result | rangemap field=result green=0-0 yellow=1-10 red=10-11 default=severe|eval range_color=range |rangemap field=result arrow-circle-o-up=0-0 exclamation-circle=1-10 arrow-circle-o-down=10-11 default=arrow-circle-o-down| eval range_icon=range | table result, range_icon, range_color

Option 2 - Use Nested if or case statement


| table result | rangemap field=result green=0-0 yellow=1-10 red=10-11 default=severe|eval range_color=range |eval range_icon=if(result=0, "arrow-circle-o-up",if(result >0 AND result<=10,"exclamation-circle","arrow-circle-o-down"))| table result, range_icon, range_color

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

niketn
Legend

For any search that generates a numeric field like result, icon and color fields need to be mapped. Following are two options:

Option 1 - Use Rangemap to set range_color and range_icon


| table result | rangemap field=result green=0-0 yellow=1-10 red=10-11 default=severe|eval range_color=range |rangemap field=result arrow-circle-o-up=0-0 exclamation-circle=1-10 arrow-circle-o-down=10-11 default=arrow-circle-o-down| eval range_icon=range | table result, range_icon, range_color

Option 2 - Use Nested if or case statement


| table result | rangemap field=result green=0-0 yellow=1-10 red=10-11 default=severe|eval range_color=range |eval range_icon=if(result=0, "arrow-circle-o-up",if(result >0 AND result<=10,"exclamation-circle","arrow-circle-o-down"))| table result, range_icon, range_color

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

guimilare
Communicator

Thank you niketnilay !!
It worked perfectly!

I was missing the statements eval range_color=range and eval range_icon=range

Regards!

0 Karma

guimilare
Communicator

Ok, the first one I've discovered myself.
The only thing you have to do is add the following line:

<option name="height">110px</option> 

(of course, you can set a value for height that fits you better)
In my case, the xml is:

<viz type="status_indicator_app.status_indicator">
        <search>
          <query> my search </query>
        </search>
        <option name="status_indicator_app.status_indicator.showOption">1</option>
        <option name="status_indicator_app.status_indicator.icon">fix_icon</option>
        <option name="status_indicator_app.status_indicator.fixIcon">info-circle</option>
        <option name="status_indicator_app.status_indicator.useColors">true</option>
        <option name="status_indicator_app.status_indicator.colorBy">field_value</option>
        <option name="status_indicator_app.status_indicator.staticColor">#555</option>
        <option name="status_indicator_app.status_indicator.fillTarget">text</option>
        <option name="status_indicator_app.status_indicator.precision">0</option>
        <option name="status_indicator_app.status_indicator.useThousandSeparator">true</option>
        <option name="height">110px</option>
      </viz>

Now, I'm working on the second question...

markuxProof
Path Finder

Thanks Master guimilare!

0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...