Splunk Search

Can you help me with a complex subsearch?

jip31
Motivator

Hi

I use the request below in order to count degradation stop performances by service name

index="windows" sourcetype="wineventlog:microsoft-windows-diagnostics-performance/operational" Type=* OpCode="Détérioration de l’arrêt" TaskCategory="Analyse des performances d’arrêt" Nom_du_fichier=* "Durée de la dégradation"=* 
 | stats dc(Durée de la dégradation) as Total by Nom_du_fichier | sort -Total limit=10

You can see the result here

https://cjoint.com/c/IAdiC08SQZd

Now, I want to match these requests with this one :

index="windows-fr" sourcetype=WinRegistry key_path=\\registry\\machine\\software\\wow6432node\\xx\\master\\ConfigurationCountry | eval NATCO=if(key_path="\\registry\\machine\\software\\wow6432node\\xx\\master\\ConfigurationCountry",data, null)
| stats values(NATCO) as NATCO by host 
| stats dc(host) as host by NATCO | sort -NATCO limit=10

My goal is to count degradation stop performances by service name and by NATCO.

So, I would like to have in a same table the same thing that there is in the capture but also with a NATCO column.

Could you help me please??

0 Karma

raphgoncalves
Explorer

Just in case someone come over this question, I suggested OP to use "Join" Command : https://docs.splunk.com/Documentation/Splunk/7.2.0/SearchReference/Join

He came up with the following search

index="windows" sourcetype="wineventlog:microsoft-windows-diagnostics-performance/operational" Type=* OpCode="Détérioration de l’arrêt" TaskCategory="Analyse des performances d’arrêt" Nom_du_fichier=* "Durée de la dégradation"=* | stats count by host   
 | join host [search index=windows sourcetype=winregistry key_path="\\registry\\machine\\software\\wow6432node\\xx\\master\\ConfigurationCountry"  | eval NATCO=if(key_path=="\\registry\\machine\\software\\wow6432node\\xx\\master\\ConfigurationCountry",data, null) | stats latest(NATCO) as NATCO by host]
 | stats values(NATCO) as NATCO by host | stats count as Total by NATCO
 | sort -Total limit=10
0 Karma

raphgoncalves
Explorer

If you have a common ID, you could use "join" command : https://docs.splunk.com/Documentation/Splunk/7.2.0/SearchReference/Join

0 Karma

jip31
Motivator

I dont succeed...

0 Karma

raphgoncalves
Explorer

Maybe I could help if you give events sample for your requests

0 Karma

jip31
Motivator

I have done this

index="windows" sourcetype="wineventlog:microsoft-windows-diagnostics-performance/operational" Type=* OpCode="Détérioration de l’arrêt" TaskCategory="Analyse des performances d’arrêt" Nom_du_fichier=* "Durée de la dégradation"=* | stats count by host   
| join host [search index=windows sourcetype=winregistry key_path="\\registry\\machine\\software\\wow6432node\\xx\\master\\ConfigurationCountry"  | eval NATCO=if(key_path=="\\registry\\machine\\software\\wow6432node\\xx\\master\\ConfigurationCountry",data, null) | stats latest(NATCO) as NATCO by host]
| stats values(NATCO) as NATCO by host | stats count as Total by NATCO
| sort -Total limit=10
0 Karma

raphgoncalves
Explorer

so you have a common id 😉
Great to know that it helped 🙂

0 Karma

jip31
Motivator

thanks!!!!

0 Karma

jip31
Motivator

And no commun ID..

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...