Security

What is regex for website URL? regex

karu0711
Communicator
Labels (1)
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!

Updated Data Type Articles, Anniversary Celebrations, and More on Splunk Lantern

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

A Prelude to .conf25: Your Guide to Splunk University

Heading to Boston this September for .conf25? Get a jumpstart by arriving a few days early for Splunk ...

4 Ways the Splunk Community Helps You Prepare for .conf25

.conf25 is right around the corner, and whether you’re a first-time attendee or a seasoned Splunker, the ...