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!

New in Observability - Improvements to Custom Metrics SLOs, Log Observer Connect & ...

The latest enhancements to the Splunk observability portfolio deliver improved SLO management accuracy, better ...

Improve Data Pipelines Using Splunk Data Management

  Register Now   This Tech Talk will explore the pipeline management offerings Edge Processor and Ingest ...

3-2-1 Go! How Fast Can You Debug Microservices with Observability Cloud?

Register Join this Tech Talk to learn how unique features like Service Centric Views, Tag Spotlight, and ...