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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

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