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!

Automatic Discovery Part 1: What is Automatic Discovery in Splunk Observability Cloud ...

If you’ve ever deployed a new database cluster, spun up a caching layer, or added a load balancer, you know it ...

Real-Time Fraud Detection: How Splunk Dashboards Protect Financial Institutions

Financial fraud isn't slowing down. If anything, it's getting more sophisticated. Account takeovers, credit ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...