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!

Application management with Targeted Application Install for Victoria Experience

  Experience a new era of flexibility in managing your Splunk Cloud Platform apps! With Targeted Application ...

Index This | What goes up and never comes down?

January 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Splunkers, Pack Your Bags: Why Cisco Live EMEA is Your Next Big Destination

The Power of Two: Splunk &#43; Cisco at "Ludicrous Scale"   You know Splunk. You know Cisco. But have you seen ...