Splunk Search

Table with Sparklines for multiple key/value pairs

giovere
Path Finder

Hi All

Logged events look something like this:

10:00 ComponentA: 3 ComponentB: 5 ComponentC: 8
10:01 ComponentA: 3 ComponentB: 4 ComponentC: 10
10:02 ComponentA: 5 ComponentB: 2 ComponentC: 12

Number of components is fixed, ideally I’d like to have a table with the latest value for component and a sparkline for the past 30 minutes or so.

Component  | Value| Sparkline
ComponentA | 5    | Sparkline(3,3,5)
ComponentB | 2    | Sparkline(5,4,2)
ComponentC | 12   | Sparkline(8,10,12)

(Optional) Bonus sub-step would be adding coloring map per row (Component)? Found in documentation a way to define it per table, but each Component has different threshold.

Any help much appreciated.
Thanks in advance

Tags (3)
0 Karma
1 Solution

somesoni2
SplunkTrust
SplunkTrust

This should do the trick

your base search giving fields _time, ComponentA, ComponentB, ComponentC | fields _time, ComponentA, ComponentB, ComponentC | untable _time Component Value | stats latest(Value) as Value sparkline as Sparkline by Component

View solution in original post

somesoni2
SplunkTrust
SplunkTrust

This should do the trick

your base search giving fields _time, ComponentA, ComponentB, ComponentC | fields _time, ComponentA, ComponentB, ComponentC | untable _time Component Value | stats latest(Value) as Value sparkline as Sparkline by Component

sunnyparmar
Communicator

It works for me as well. thanks

0 Karma

giovere
Path Finder

Thanks, this works quite well, except one thing. Is there a way to get sparkline(latest(Value),8h)? Apparently by default it supports aggregation functions like avg, mean, max etc., but what I'd rather have is a latest value for a given span.

0 Karma

esix_splunk
Splunk Employee
Splunk Employee

You cant do this for specific aggregates unluss you rework your whole search. Otherwise you can add
... | bin _time span=8h | ..

Thats if I understand you're wanting to group all these together into 8h buckets.

0 Karma

giovere
Path Finder

sure enough, it works with splitting it into bins. Thanks!

0 Karma
Get Updates on the Splunk Community!

Splunk Lantern | Getting Started with Edge Processor, Machine Learning Toolkit ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...

Enterprise Security Content Update (ESCU) | New Releases

In the last month, the Splunk Threat Research Team (STRT) has had 2 releases of new security content via the ...

Announcing the 1st Round Champion’s Tribute Winners of the Great Resilience Quest

We are happy to announce the 20 lucky questers who are selected to be the first round of Champion's Tribute ...