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!

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

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...