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
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...