Splunk Search

1 graph for two searches

pborucki
New Member

Hello,

I am new to Splunk and I ma trying to analyze my logfile and create graph for two avg fields by each present different values, here is fragment of my file:

3/21/12
10:03:49.335 AM     

Mar 21 10:03:49.335 [RATE] cur=209.9 lo=209.9 hi=210.0 avg=209.9

3/21/12
10:03:19.335 AM     

Mar 21 10:03:19.335 [RATE] CPU=61658.825: cur=80 avg=81

I need to have graph which present avg value from both lines separately over time.
My problem is that splunk count average value from both avg fields in both lines.
How can I separate them?

thank you

Tags (1)
0 Karma

sowings
Splunk Employee
Splunk Employee

I'd use eval to rename the fields, on a conditional basis, and then plot both values simultaneously:

search RATE
  | eval rate_avg=if(isnotnull(lo), avg, null)
  | eval cpu_avg=if(isnotnull(CPU), avg, null)
  | timechart avg(rate_avg) AS rate_avg, avg(cpu_avg) AS cpu_avg

There'll be two lines on the chart, one labeled rate_avg, and the other as cpu_avg.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...