Splunk Search

how do you concatenate the avg(value) for perfmon process coming from two servers

misnomerga
New Member

Very new to Splunk and need some guidance. I believe there must be a way to index the servers to differentiate them somehow

I have two servers with CPU processor time data coming in. How to display both values. The current query returns Error in 'timechart' command. The specifier 'avg(Value)' is specified multiple times and renamed with conflicting field names.

The query is:

sourcetype="Perfmon:Processor" | timechart avg(Value) As server1 avg(Value) As server2

Tags (2)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

The timechart command can separate stats values for you using the by clause. Something like this will give you a chart of average CPU processor time for each server.

sourcetype="Perfmon:Processor" | timechart avg(Value) As AvgCPU by server
---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

misnomerga
New Member

THANK YOU - that additional piece did the trick

0 Karma

richgalloway
SplunkTrust
SplunkTrust

The timechart command can separate stats values for you using the by clause. Something like this will give you a chart of average CPU processor time for each server.

sourcetype="Perfmon:Processor" | timechart avg(Value) As AvgCPU by server
---
If this reply helps you, Karma would be appreciated.
0 Karma

misnomerga
New Member

Thanks for the quick response - I will preface this by saying thanks for your patience. The "by" statement does not seem to allow me to show the avg cpu for both servers on the same chart. When I use the timechart avg(Value) As Server1 I get the single value. When I use the by I get the same result with the null. My goal is to show server1 and server2 in a side by side comparison on the same chart with the appropriate tags. Is there some way of stratifying that formula, e.g timechart avg.server1(Value) As server 1 avg.server2(Value) as server2

0 Karma

richgalloway
SplunkTrust
SplunkTrust

The timechart command I provided should work, but may need a little adjusting. In the 'by server' clause, 'server' is a field name that distinguishes server1 from server2. Your events probably use a different name. It may be 'host' or something else. Replace 'server' with the appropriate field name and see what you get.

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

Detecting Remote Code Executions With the Splunk Threat Research Team

WATCH NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If exploited, ...

Enter the Splunk Community Dashboard Challenge for Your Chance to Win!

The Splunk Community Dashboard Challenge is underway! This is your chance to showcase your skills in creating ...

.conf24 | Session Scheduler is Live!!

.conf24 is happening June 11 - 14 in Las Vegas, and we are thrilled to announce that the conference catalog ...