Splunk Search

Regex for string between to delimeters

mninansplunk
Path Finder

Hello,

Thank you for your help on this in advance,  I just need to create a field in Splunk Search that contains the value between 2 delimiters.    The delimiter is "?".  For example.

Athena.siteone.com?suvathp001?443

What would be the regex to only extract suvathp001

Thanks again for your help,

Tom

 

 

Labels (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

The general form for that regex is "<<delimiter>>(?<field>[^<<delimiter>>]+)".  In this case, the delimiter is a regex special character so escaping is needed.  Try this command:

| rex "\?(?<field>[^\?]+)"
---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Observability Unlocked: Kubernetes Monitoring with Splunk Observability Cloud

 Ready to master Kubernetes and cloud monitoring like the pros? Join Splunk’s Growth Engineering team for an ...

Update Your SOAR Apps for Python 3.13: What Community Developers Need to Know

To Community SOAR App Developers - we're reaching out with an important update regarding Python 3.9's ...

October Community Champions: A Shoutout to Our Contributors!

As October comes to a close, we want to take a moment to celebrate the people who make the Splunk Community ...