Splunk Search

Hi team, i need to extract the locale field in BOLD , can you help me with it

Hemant1
Explorer

/en_sek/klarna

Labels (1)
0 Karma

paulbannister
Communicator

Hi There,

\/(?P<locale>[^\/]+)\/klarna

Or within the Splunk search itself:

 

|rex field= ##INSERT RELEVANT FIELDNAME## "\/(?P<locale>[^\/]+)\/klarna"

0 Karma

paulbannister
Communicator

Hi There,

If you mean via REGEX then try the following:

\.com\/(?P<locale>[^\/]+)\/


Or within the Splunk search itself:

 

|rex field=_raw "\.com\/(?P<locale>[^\/]+)\/"

 

 

EDIT:
Slightly improved regex to incorporate address such as ".co.uk":

 

((\.\w{2,3}\.\w{2,3})|\.\w{2,3})\/(?P<locale>[^\/]+)\/

or

|rex field=_raw "((\.\w{2,3}\.\w{2,3})|\.\w{2,3})\/(?P<locale>[^\/]+)\/"

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

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