Splunk Search

Need to extract aws-region from host name

smaran06
Path Finder

Hi Team,

I want to extract aws-region from host name. 

host= "my-service-name-.ip-101-99-126-252-us-west-2c".

 

I want to extract us-west-2 from the host. How I can achieve this.

Labels (3)
0 Karma

ashvinpandey
Contributor

@smaran06 Try using the below command:

| rex field=host "\.\w+.\d+.\d+.\d+.\d+.(?P<aws_region>.*)"

Also, If this reply helps you, an upvote would be appreciated.

0 Karma
Get Updates on the Splunk Community!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...