Dashboards & Visualizations

How to show a subset of all keys in a chart?

neilmac64
Path Finder

I am ingesting data from multiple end points. The data is about 30key/value pairs. I would like to be able to chart just a subset of the keys.

At the moment, I have a chart that has a drop down list to select the endpoint I want to display (identified by mac address).

Right now, my search is as follows:

index=index
mac_address=$mac_address$ | timechart span=15m values(value) by key

This returns a graph with every single key/value pair on it.  I'd like to edit the search just to show specific values.

 

I note I don't have a source/sourcetype specified (I wasn't sure if I needed this).

I've also tried to search for specific fields using the avg command but this returns no values:

index=index
mac_address=$mac_address$ | timechart span=15m avg(key_1) as "key_1" avg(key_2) as "key_2"

 

As always, any help very much appreciated.

 

NM

Labels (1)
0 Karma

neilmac64
Path Finder

OK, I have now something that looks like what I need. The search I now have is:

index=index
mac_address=$mac_address$ key=key_1 OR key=key_2 | timechart span=15m values(value) by key

I'm going to play some more and see if this scales to the other charts I need. I'll let you know how it looks.

NM

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

If you know the values of the keys you want to keep, e.g. key_1 and key_2, just include them on a fields command

index=index
mac_address=$mac_address$ | timechart span=15m values(value) by key
| fields _time key_1 key_2
0 Karma

neilmac64
Path Finder

Thank you for the very quick reply.

As amended, that search does not show any results:

index=index
mac_address=$mac_address$ | timechart span=15m values(value) by key
| fields _time key_1 key_2

neilmac64_0-1673014113642.png

 

What else could I try?

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Perhaps you could share the stats table you got as a result?

The values(value) part of the timechart will create multivalue fields and if there is more than one value in the field, it can't be displayed on the column chart (which value should be represented)?

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...