Splunk Search

How to draw a line chart using the data from events

sunfan1981
New Member

Hi,

May I know how to use the data from events and draw a line chart in splunk or splunk can not do it?
My input data is simple like this:
type1, field1: 80, field2:100
type2, field1: 90, field2:100

I want to draw a line chart that will show two output : 80/100 as rate1 from type1, 90/100 as rate2 from type2

Thanks!

Tags (2)
0 Karma

woodcock
Esteemed Legend

Try this:

sourcetype=type1 OR sroucetype=type2 | rex "field1\s*:\s*(?<field1>\d+),\s+field2\s*:\s*(?<field2>\d+)" | eval rate=(field1/field2) | timechart rate by sourcetype
0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...