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!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...