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!

Automatic Discovery Part 1: What is Automatic Discovery in Splunk Observability Cloud ...

If you’ve ever deployed a new database cluster, spun up a caching layer, or added a load balancer, you know it ...

Real-Time Fraud Detection: How Splunk Dashboards Protect Financial Institutions

Financial fraud isn't slowing down. If anything, it's getting more sophisticated. Account takeovers, credit ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...