How to Customize a Dashboard using HTML in Splunk
Hello guys!!
Are you feeling bored by using XML dashboard?? Have you ever thought of changing the visualization in Splunk?? Here we have come with a new interesting and attractive topic of Splunk that is how to customize a dashboard using HTML. For customizing the a dashboard follow the below steps.
Step 1:
Create a simple XML dashboard using the below query.
index=_internal | stats count by sourcetype
Also we have given the dashboard name as Pie Chart Dashboard. Click on Save to create the dashboard. Then click on View Dashboard to see the dashboard.
Step 2:
In the XML dashboard we can’t make more attractive . Now convert the dashboard to HTML . You can see … button on the top right corner of the dashboard. Click on that and next click on Convert to HTML to convert the dashboard into HTML.
Step 3:
Now you can specify a new name for the html dashboard . Click on Convert Dashbaord to save the dashboard . We have given the name as Pie Chart Dashboard HTML for the html dashboard. Click on View to see the dashboard.
Step 4:
Click on Edit to edit the source code of the HTML Dashboard.
Step 5:
We will modify into the following marked portions.
Step 6:
We have written custom CSS inside style tag.
We have called custom CSS inside the div tag. For dashboard name we have called dashboard . For a single panel we have called single. To change the background we have called panel2 and as well as we have called panel. Also we have made the panel title bold by b tag and by center tag we have put it into center.
We have changed the background color of the pie chart as well as foreground color of the pie chart by adding following marked lines . After making changes into the source code click on Save to make the changes. Like this way you can change the background color of charts in XML dashboard as well.
Step 7:
Now you can see one cool dashboard is ready for presentation. You can impress your boss by making this type of custom html dashboard.
You can also download the source code of this sample dashboard by clicking the below button.
Hope this has helped you in achieving the below requirement without fail:
How to Customize a Dashboard using HTML in Splunk
Happy Splunking !!