Getting Data In

Scripting in metrics with Splunk?

daniel333
Builder

All,

Still getting my head around metrics. I shameless stole this line of bash and setup metrics and it's working . UI was cool.

echo "mydesktop.cpu.util:$intCount|c" | nc -w 1 -u myheavyforwarders.domain.com 8125

With this in mind how would I send more than one metric? Say I wanted all the output of TOP? Can you send more than one metric at a time? I understand these metric can have dimension, is that basically an array of values?

0 Karma

rjthibod
Champion

As @richgalloway said in hist comment, in 7.0.0, you can only send one _value and one measurement in each metric event, but theoretically you can have as many dimensions (columns/tags/fields) as you want.

You could parse top output and send each row separately with the same timestamp. Each column would be a dimension but you would need to determine what you are sending as the _value field in this case. Not really sure what the point of this would be, but it is doable.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

As I understand metrics, each "event" is a single value. Dimensions describe the value - process ID, user running the process, etc.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Enhance Your Splunk App Development: New Tools & Support

UCC FrameworkAdd-on Builder has been around for quite some time. It helps build Splunk apps faster, but it ...

Prove Your Splunk Prowess at .conf25—No Prereqs Required!

Your Next Big Security Credential: No Prerequisites Needed We know you’ve got the skills, and now, earning the ...

Splunk Observability Cloud's AI Assistant in Action Series: Observability as Code

This is the sixth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...