Splunk Search

Can you help me come up with a regex for an API path?

serviceinfrastr
Explorer

Hi Community,

Sorry this should be easiest for you, but i have many problem with regex ....

i want to keep the first 3 sets of information (bellow in red)

alt text

i have already done this :

" |rex field=uri_path "^/(?\w+)" |

but i have only the first.

Can you help me ?

Tags (2)
0 Karma
1 Solution

jlelli
Path Finder

this should work:

  | rex field=uri_path "^(?<myfield>/\w+/\w+/\w+/)"

View solution in original post

0 Karma

jlelli
Path Finder

this should work:

  | rex field=uri_path "^(?<myfield>/\w+/\w+/\w+/)"
0 Karma

harsmarvania57
Ultra Champion

Hi,

You can use below regular expression to extract those values

<yourBaseSearch> | rex field=uri_path "^(?<extracted_uri>\/\w+\/\w+\/\w+\/?)"
0 Karma
Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

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

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  &#x1f680; Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...