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 Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...