Splunk Search

How to regex up to a specific word?

limalbert
Path Finder

How can I create a regex query up to a Specific word? For example, the specific word below is "Index".
Example data:
1. ... Retirement Priority Index ...
2. ... Working Priority Index ...
3. ... Test Priority 1 Index ...

Current regex :

| rex "(?<priority>[^I]*)"
0 Karma
1 Solution

MuS
Legend

Hi limalbert,

give this a try:

 (?<priority>[\w\s]+)\sIndex

Hope this helps ...

cheers, MuS

View solution in original post

0 Karma

MuS
Legend

Hi limalbert,

give this a try:

 (?<priority>[\w\s]+)\sIndex

Hope this helps ...

cheers, MuS

0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...