Getting Data In

Splunk Query not generating proper output

shreyasathavale
Communicator

Hi,
We have joined 2 queries for output.When we run individual query we are getting the proper output but when combined we are not getting it. It would be helpful if anyone give thoughts about it.
Queries are as follows:

index=perfmon counter="% Processor Time" source="Perfmon:cputime" earliest=-15m | stats avg(Value) as CpuUsage by role,host|where CpuUsage > 10

index=perfmon counter="% Processor Time"source="Perfmon:Process" | top 6 instance by host|fields instance,host

Tags (2)
0 Karma

shreyasathavale
Communicator

I have mentioned roles in serverclass.conf

0 Karma

linu1988
Champion

I have 2 doubts

| stats avg(Value) as CpuUsage by role,host 

from where u are getting roles?

0 Karma

HiroshiSatoh
Champion

Do you join? Not add?

[join]
index=perfmon counter="% Processor Time" source="Perfmon:cputime" earliest=-15m | stats avg(Value) as CpuUsage by role,host|where CpuUsage > 10 |join host [index=perfmon counter="% Processor Time"source="Perfmon:Process" | top 6 instance by host|fields instance,host]

[ADD]
index=perfmon counter="% Processor Time" source="Perfmon:cputime" earliest=-15m | stats avg(Value) as CpuUsage by role,host|where CpuUsage > 10 |append [index=perfmon counter="% Processor Time"source="Perfmon:Process" | top 6 instance by host|fields instance,host]

0 Karma

shreyasathavale
Communicator

Hi, I tried the above queries but it is only giving me top 1 instance instead of 3/4/5 .. My requirement is "If the 1st query is true then only run 2nd query else dont run" , since it takes lots of time for parsing.. Any help ??

0 Karma

shreyasathavale
Communicator

I had used appendcols as well as join but was not able to get the output... I had tried join id [search index=]...I will still try the above .. Thanks..

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 ...