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:
@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.