Splunk Search

How to extract string after particular word?

labaningombam
Explorer

Hi,

I have a line in the event like

"/v1/locations/7b-cec6-4820-b699-ec" 

I need to extract  7b-cec6-4820-b699-ec, or which ever comes after  /v1/locations/ and before a "

Please help on the same.

Thank you.

Labels (2)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Try something like this

| rex "/v1/locations/(?<field>[^\"]+)"

View solution in original post

0 Karma

vnravikumar
Champion

@labaningombam , you want to extract only after  '/v1/locations/' or any multiple conditions there?

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try something like this

| rex "/v1/locations/(?<field>[^\"]+)"
0 Karma
Get Updates on the Splunk Community!

Splunk Observability Cloud’s AI Assistant in Action Series: Analyzing and ...

This is the second post in our Splunk Observability Cloud’s AI Assistant in Action series, in which we look at ...

Elevate Your Organization with Splunk’s Next Platform Evolution

 Thursday, July 10, 2025  |  11AM PDT / 2PM EDT Whether you're managing complex deployments or looking to ...

Splunk Answers Content Calendar, June Edition

Get ready for this week’s post dedicated to Splunk Dashboards! We're celebrating the power of community by ...