Splunk Search

How do I extract a string from my sample log using the rex command?

kumina
New Member

How do I extract the string from MSG: till EL from the sample log below using the rex command?

BL: | LL: ERROR | TS: 2015-06-05 13:42:28,544 | AR: RxC_15.01.24.01 | STORE: 09560:wks02 | USER: 0589263 | HOST: wks02 | APPSERVER: rri1rxappa60/10.92.227.28 | MSGID: 09560-wks02-SCRRXDE01NewPrescriptionP-1433526148422: |SC: [com.cvs.rxconnect.web.RxConnectWebEntry.doPost] | MSG: EXCP Error completing service call com.cvs.rxconnect.rx.service.RxFillService.saveAIDetail | java.lang.NullPointerException
                at com.cvs.rxconnect.modeleValue194)
                at com.cvs.rxconnect.ai.boundary.(RxpAdditionalInfoBoundaryImpl.java:331)
                at com.cvs.rxconnect.ai.persistor.(istorImpl.java:9626)
                at com.cvs.rxconnect.ai.service.(AdditionalInfoServiceImpl.java:998)
                at com.cvs.rxconnect.rx.service.R(FillServiceImpl.java:11319)
                at com.cvs.rxconnect.rx.service.Re(<generated>)
                at net.sf.cglib.reflect.FastMethod.invoke(53)

:EL
0 Karma

richgalloway
SplunkTrust
SplunkTrust

This works on regex101.com:

... | rex "(?s)MSG:(?P<string>.*):EL" | ...
---
If this reply helps you, Karma would be appreciated.

richgalloway
SplunkTrust
SplunkTrust

If this solved your problem, please accept the answer.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...