Getting Data In

How to split String sentence into one row?

tahasefiani
Explorer

Hello,

I have a fields in my index named MESSAGE.

[BBB] ProcessGenererIdentifiantLMKRImpl/genererIdentifiantLMKR - CHECK OK - codeClient= 98451635- codeCanal= III- identifiantLMKR= JHF7UNJK6ZJNEZFI0873NFI373UBF389, nomMethode=genererIdentifiantLMKR

The result that i want is

alt text

0 Karma
1 Solution

to4kawa
Ultra Champion
| makeresults 
| eval message="[BBB] ProcessGenererIdentifiantLMKRImpl/genererIdentifiantLMKR - CHECK OK - codeClient= 98451635- codeCanal= III- identifiantLMKR= JHF7UNJK6ZJNEZFI0873NFI373UBF389, nomMethode=genererIdentifiantLMKR"
| eval _raw=split(replace(replace(message," ",""),",","-"),"-")
| kv
| table codeClient identifiantLMKR

View solution in original post

kamlesh_vaghela
SplunkTrust
SplunkTrust

@tahasefiani

Can you please try this?

YOUR_SEARCH | rex field=MESSAGE "codeClient=\s(?<codeClient>\d+[^-]).*identifiantLMKR=\s(?<identifiantLMKR>\w+)"  
| table codeClient identifiantLMKR

Sample search:

| makeresults 
| eval MESSAGE="[BBB] ProcessGenererIdentifiantLMKRImpl/genererIdentifiantLMKR - CHECK OK - codeClient= 98451635- codeCanal= III- identifiantLMKR= JHF7UNJK6ZJNEZFI0873NFI373UBF389, nomMethode=genererIdentifiantLMKR" 
| rex field=MESSAGE "codeClient=\s(?<codeClient>\d+[^-]).*identifiantLMKR=\s(?<identifiantLMKR>\w+)"  
| table codeClient identifiantLMKR
0 Karma

tahasefiani
Explorer

it returns me empty columns

0 Karma

to4kawa
Ultra Champion
| makeresults 
| eval message="[BBB] ProcessGenererIdentifiantLMKRImpl/genererIdentifiantLMKR - CHECK OK - codeClient= 98451635- codeCanal= III- identifiantLMKR= JHF7UNJK6ZJNEZFI0873NFI373UBF389, nomMethode=genererIdentifiantLMKR"
| eval _raw=split(replace(replace(message," ",""),",","-"),"-")
| kv
| table codeClient identifiantLMKR
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...