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!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

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

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...