Dashboards & Visualizations

Get values from options visalizations

mark8awar
New Member

Hi all

I'm new in Splunk and I would like to know if it's possible to get the values set in an visalization option. For example, in a Single Value visualization I set the color and range in the option panel, and I see these values in the XML as follows:

    <option name="rangeColors">["0x53a051","0xf8be34","0xdc4e41","0xdc4e41"]</option>
    <option name="rangeValues">[95,100,120]</option>

Is it possible to get the values in the arrays so I can use them in a token somewhere else in my dashboard?

Thanks

0 Karma

niketn
Legend

@mark8awar following could be some of your options:

Option 1. Use Splunk JS Extension to assign arrays as token include the JS file your dashboards and then use the tokens in your Dashboard to set chart configurations.
Option 2. Push the JS code for above mentioned approach, to dashboard.js, so that every dashboards in your app will already have the JS file included by default and you just need to use the token to set the Chart configurations as per your needs.
Option 3. Create a pre-built Panel with an independent search to set the token/s as per your need. Include the pre-built panel to your dashboards so that tokens can be used for Chart configuration.
Option 4. Add an init section in each dashboard to set the required arrays as tokens to be used in your dashboards.

Option 1, requires a new JS file to be created and included in all your dadhboards.
Option 2, does not need dashboard.js to be explicitly included all your dashboard, but you must ensure that your code does not break or lead to performance issues in your existing app (all other dashboards).
Option 3, does not require JS approach however, you must ensure prebuilt-panel is hidden as it does not have any UI component. It is just used to set initialization tokens, through one point of configuration.
Option 4. will require init section to be manually created/updated/deleted for each dashboard in case your threshold changes.

Please weigh in your option and you should be able to find all 4 approach in Splunk Docs and Splunk Answers.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...