Splunk Search

field extraction

sandeepmakkena
Contributor

I have a filed that has value something like this:

ww.abcd.hongkong
ww.abcd.cn
ww.abcd.asiaenglish.ph
ww.abc.us

I want to extract last part of this as country filed. Can someone help with regular expression please.

Thank you.

0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi sandeepmakkena,
try this regex:

! rex field=my_field "(?<contry>\w+)$"

You can test it at https://regex101.com/r/gNwfuc/1

Bye.
Giuseppe

View solution in original post

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi sandeepmakkena,
try this regex:

! rex field=my_field "(?<contry>\w+)$"

You can test it at https://regex101.com/r/gNwfuc/1

Bye.
Giuseppe

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

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, ...