Splunk Search

Remove first word with rex

JohannesGmelin
Path Finder

Hey Community,

I'm trying to remove the first word of a Uri with a rex.

/test/contentA/contentB.html

It should only display something like this:

contentA/contentB.html

How can I deal with this?

0 Karma
1 Solution

dineshraj9
Builder

Do it this way -

| rex field=field1 "\/\w*\/(?<field1 >.+)"

View solution in original post

0 Karma

dineshraj9
Builder

Do it this way -

| rex field=field1 "\/\w*\/(?<field1 >.+)"
0 Karma

JohannesGmelin
Path Finder

This worked for me:

s/\/\w*\/(.+)$/\\1/

Thanks for your thought for thought.

0 Karma
Get Updates on the Splunk Community!

Splunk Observability Cloud's AI Assistant in Action Series: Auditing Compliance and ...

This is the third post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

What You Read The Most: Splunk Lantern’s Most Popular Articles!

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...