Splunk Search

How to show all message from certain log via rex?

ivana27
Path Finder

Hi dear Splunkers,

i have log like this :

2021-02-11 14:47:51.167 [Error] ** Dummy User with dummyNumb:1111 Plate:AAAAA Country:Dummy paid dummy on DunnoOrder:2222222, but Dum sz: erere:45454545 not dispensed for Carouserl_Error !!!

And i would like to display everything after [Error] **.

I tried like this but i got error:

| rex "\[Error\]\s**\s(?<message>)"

Please help

Thank you

Labels (2)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| rex "\[Error\]\s\*\*\s(?<message>.*)"

View solution in original post

kamlesh_vaghela
SplunkTrust
SplunkTrust

@ivana27 

 

Can you please try this?

| rex "\[Error\]\s\*\*\s(?<message>.*)"


 Sample Search:

 

| makeresults 
| eval _raw="2021-02-11 14:47:51.167 [Error] ** Dummy User with dummyNumb:1111 Plate:AAAAA Country:Dummy paid dummy on DunnoOrder:2222222, but Dum sz: erere:45454545 not dispensed for Carouserl_Error !!!" 
| rex "\[Error\]\s\*\*\s(?<message>.*)"

 

Tags (1)

kamlesh_vaghela
SplunkTrust
SplunkTrust

oops.. late reply 🙂 

0 Karma

ivana27
Path Finder

Thank you in any case 🙂

Do you know how to put messages from Error one after another and not in horizontal view?

@kamlesh_vaghela 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

What delimits the parts of the message you want to separate?

0 Karma

ivana27
Path Finder

Should be split by _time of log, should look like this

2021-02-12 00:35:20.820  [Error] ## sample1 bla bla bla
2021-02-12 00:35:20.836  [Information] sample2 bla bla bla
2021-02-12 00:35:30.731 [Information] sample3 bla bla bla
2021-02-12 00:35:31.429 [Information] sample4 bla bla bla
2021-02-12 00:35:31.506 [Error] ## sample5 bla bla bla
2021-02-12 00:35:31.519 [Error] ** sample6 bla bla bla

And now i have search like this which displays in same row:

index=pkg_prespvm host IN (*)
| dedup _raw
| transaction host startswith="[Information] STEP = Dummy" endswith="[Information] -- START TRANSACTION --"
| rex field=_raw "plate:(?<info>[^,]+)"
| rex "\[Error\]\s\*\*\s(?<message>.*)"
| rex "\[Error\]\s\##\sGet\sDuuno\sTransaction\s(?<tranok>.*)"
| rex "\[Error\]\s\CustNum:\s(?<customer>.*)"
| search "Get Transaction NOK --> Payment:OK"
| stats count by host _time tranok message customer info
| table _time host customer tranok message info

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust
Can you please share your expected sample output. So I can help you..
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| rex "\[Error\]\s\*\*\s(?<message>.*)"
Get Updates on the Splunk Community!

Enhance Security Visibility with Splunk Enterprise Security 7.1 through Threat ...

(view in My Videos)Struggling with alert fatigue, lack of context, and prioritization around security ...

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...

Adoption of Infrastructure Monitoring at Splunk

  Splunk's Growth Engineering team showcases one of their first Splunk product adoption-Splunk Infrastructure ...