Create a Marker Gauges in Splunk Table
Use a filler or marker gauge to map a value in relation to a range. A gauge visualization provides metric status and range information that you can interpret quickly. You can use a real-time search to generate a gauge tracking value fluctuations as they occur.
Today we will create a viz like this shown below,
![](https://i2.wp.com/splunkonbigdata.com/wp-content/uploads/2022/01/1-49.png?resize=696%2C266&ssl=1)
So Let’s start, we have a Splunk dashboard like this,
![](https://i0.wp.com/splunkonbigdata.com/wp-content/uploads/2022/01/2-53.png?resize=696%2C105&ssl=1)
Here we have a table with two columns “method” and “Count vs Total”. We want two create a gauge meter viz in Splunk table with the “Count vs Total” field.
The dashboard query is given below,
index=_internal
|stats count by method
| eventstats sum(count) as Total
|eval count_total='count'." / ".'Total'
|rename count_total as "Count vs Total"
|table method "Count vs Total"
Explanation:
The query is pretty simple, after taking the statistical count of method values. Using eventstats took the total sum of the count field. After that, using eval command created a field called “count_total”, where we concatenated total and count values together delimited by “/”.
Implementation:
To get the use case done we have a javascript that is given below,
Download cell_fill_gauge.js from here.
In the given script change your custom field name here only and the rest of the script will be as it is.
![](https://i1.wp.com/splunkonbigdata.com/wp-content/uploads/2022/01/7-33.png?resize=696%2C328&ssl=1)
And save this JS in this path,
“C:\Program Files\Splunk\etc\apps\<app name>\appserver\static”
Then restart your Splunk server. This is for the Windows environment.
![](https://i1.wp.com/splunkonbigdata.com/wp-content/uploads/2022/01/4-45.png?resize=696%2C227&ssl=1)
Now Let’s start with the dashboard, click on Edit.
![](https://i2.wp.com/splunkonbigdata.com/wp-content/uploads/2022/01/3-51.png?resize=696%2C160&ssl=1)
After that, go to the Source, and do these modifications as shown below.
![](https://i2.wp.com/splunkonbigdata.com/wp-content/uploads/2022/01/5-44.png?resize=612%2C694&ssl=1)
Then save the dashboard and check the viz it’s working or not.
![](https://i2.wp.com/splunkonbigdata.com/wp-content/uploads/2022/01/6-40.png?resize=696%2C182&ssl=1)
In addition, The complete source code is given below.
Hope you have enjoyed this blog “Create a Marker Gauges in Splunk Table”. See you all on to the next one.
Happy Splunking!!