Splunk Search

How to extract subword from a string?

aa0
Path Finder

Hi all,

I want to extract the following word with rex expression:

ABC\qq1234 

expected result: qq1234

Please note that the substring needed will always after ABC\. Any help will be appreciated!

Labels (3)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Try something like this

| rex "ABC\\(?<subword>\w+)"

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try something like this

| rex "ABC\\(?<subword>\w+)"
0 Karma

aa0
Path Finder

Thanks a lot! It working well with 3 backslashes used instead in order to escape a backslash character.

0 Karma
Get Updates on the Splunk Community!

Exporting Splunk Apps

Join us on Monday, October 21 at 11 am PT | 2 pm ET!With the app export functionality, app developers and ...

Cisco Use Cases, ITSI Best Practices, and More New Articles from Splunk Lantern

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Build Your First SPL2 App!

Watch the recording now!.Do you want to SPL™, too? SPL2, Splunk's next-generation data search and preparation ...