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!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...