Spread our blog

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,

So Let’s start, we have a Splunk dashboard like this,

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.

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.

Now Let’s start with the dashboard, click on Edit.

After that, go to the Source, and do these modifications as shown below.

You can also know about :  Splunk Command: FIELDSUMMARY

Then save the dashboard and check the viz it’s working or not.

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!!

What’s your Reaction?
+1
+1
+1
+1
+1
1
+1
+1

Spread our blog

LEAVE A REPLY

Please enter your comment!
Please enter your name here