Security

What is regex for website URL? regex

karu0711
Communicator
Labels (2)
Tags (1)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @karu0711,

if the rule is that you want only 4 sections of your url, you could use this regex

| rex "^(?<url>\w+:\/(\/[^\/]+){4})"

that you can test at https://regex101.com/r/r7SZYY/1

Ciao.

Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi @karu0711,

if the rule is that you want only 4 sections of your url, you could use this regex

| rex "^(?<url>\w+:\/(\/[^\/]+){4})"

that you can test at https://regex101.com/r/r7SZYY/1

Ciao.

Giuseppe

gcusello
SplunkTrust
SplunkTrust

Hi @karu0711,

if one answer solves your need, please accept one answer for the other people of Community or tell me how I can help you.

Ciao and happy splunking

Giuseppe

P.S.: Karma Points are appreciated 😉

Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

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