Splunk Search

Can you help me with a stats count with different field names?

jip31
Motivator

hello,

I use the two query below

index="x" sourcetype="WinEventLog:Microsoft-Windows-Diagnostics-Performance/Operational" | stats dc(Durée de la dégradation) by "Nom_du_fichier" 

index="x" sourcetype="WinEventLog:Microsoft-Windows-Diagnostics-Performance/Operational" | stats dc(Degradation Time) by "File_Name" 

I need to concatenate these 2 queries because the fields are the same: one is in french and one is in english.

I want to do a stats dc with "Durée de la dégradation" and "Degradation Time" and a by with "Nom_du_fichier" and "File_Name"in the same time

could you help me please???

Tags (2)
0 Karma
1 Solution

renjith_nair
Legend

@jip31,

Try

index="x" sourcetype="WinEventLog:Microsoft-Windows-Diagnostics-Performance/Operational" 
|eval Degradation_Time=coalesce('Durée de la dégradation','Degradation Time')
|eval File_Name=coalesce(Nom_du_fichier,File_Name)
|stats dc(Degradation_Time) by File_Name
---
What goes around comes around. If it helps, hit it with Karma 🙂

View solution in original post

0 Karma

renjith_nair
Legend

@jip31,

Try

index="x" sourcetype="WinEventLog:Microsoft-Windows-Diagnostics-Performance/Operational" 
|eval Degradation_Time=coalesce('Durée de la dégradation','Degradation Time')
|eval File_Name=coalesce(Nom_du_fichier,File_Name)
|stats dc(Degradation_Time) by File_Name
---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma

jip31
Motivator

perfect renjith thanks

0 Karma

FrankVl
Ultra Champion

You'll simply need to rename the french fields to have the same name as the english fields, before doing your stats.

0 Karma

jip31
Motivator

thanks franck

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!

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

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...