Latest Updates

random

Custom Icons in Dashboards


Related image

The table element provides us with the additional functionality of showing icons on the basis of the range of the values of the fields.
Let’s take an example to understand how to create custom icons in table.

Suppose that user wants to categorize result according to values. If the values is between 0-100 then good, 100-200, then ⚠️ moderate, above 200 then 🔴 severe. This categorization can be achieved using the rangemap command.

To make the categorization more visual, we can add icons accordingly. For example the good ones are marked with a green tick mark, the moderate ones with an orange triangle, and the severe ones with a red circle.


Let’s take an example to understand this better. 

Steps:
1. Consider this query:



2. The result of the query we get is as following :



3. Now we will create a css file and js file and place it in respective app’s file location , i.e $SPLUNK_HOME\etc\apps\appserver\static, where app_name is the name of the app. The JavaScript file defines what needs to be done on which fields, and the CSS file holds formatting options such as color, font, size, etc.

4. Put the following code in js file:

5. Put the following code in css file:

6. Include the name of css and js file in the tag of  xml file. The table in which the range values are to be replaced with an icon is set as the same table ID that we have set in the preceding JS file.

7. Once all preceding settings are done, click on Save and restart Splunk to make the changes effective.

8. Once Splunk is restarted, the range field will have icons in place of values.


Hence you have successfully Customized and icon in the table.

If you are still facing issue regarding this topic Feel free to Ask Doubts in the Comment Box Below and Don't Forget to Follow us on 👍 Social Networks, happy Splunking >😉
Custom Icons in Dashboards Reviewed by Avotrix.Author on Friday, February 08, 2019 Rating: 5

No comments:

All Rights Reserved by Avotrix © 2018 - 2019
Developed and created by Avotrix

Contact Form

Name

Email *

Message *

Powered by Blogger.