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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...