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!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...