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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

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 GA in US-AWS!

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