Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Splunk extracted field in dashboard

I am sending some data to splunk which looks like:

"Start|timestamp:1552607877702|type:counter|metricName:cache|count:34488378|End"

And then extracting the fields using a regex:

search "attrs.name"="service" | regex (Start)(.*)(End) | extract pairdelim="\"{|}" kvdelim=":"

After extraction, I can see the fields (type, metricName, count) under "INTERESTING FIELDS". How do I go about using these fields in a dashboard?

Thanks

like image 472
CaptainHastings Avatar asked Oct 21 '25 17:10

CaptainHastings


1 Answers

search "attrs.name"="service" | regex (Start)(.*)(End) | extract pairdelim="\"{|}" kvdelim=":" | stats count by metricName

Or

search "attrs.name"="service" | regex (Start)(.*)(End) | extract pairdelim="\"{|}" kvdelim=":" | stats count by type

Or

search "attrs.name"="service" | regex (Start)(.*)(End) | extract pairdelim="\"{|}" kvdelim=":" | table type, metricName, count

should all give you a table, which can also be represented as a visualization. You can save any of these, or the original events, as a dashboard panel.

like image 158
Simon Duff Avatar answered Oct 24 '25 05:10

Simon Duff



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!