Skip to content

Commit e4efcf0

Browse files
author
kaiyan-sheng
committed
add source_region field
1 parent c6c351f commit e4efcf0

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

packages/aws/changelog.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# newer versions go on top
22
- version: "6.3.1"
33
changes:
4-
- description: Fix s3access ingest pipeline to handle special characters in S3 bucket names.
4+
- description: Fix s3access ingest pipeline to handle host headers with ports and Source region field parsing.
55
type: bugfix
66
link: https://github.com/elastic/integrations/pull/17748
77
- version: "6.3.0"

packages/aws/data_stream/s3access/_dev/test/pipeline/test-s3-server-access.log-expected.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,6 @@
10601060
"@timestamp": "2026-03-09T18:02:43.000Z",
10611061
"aws": {
10621062
"s3access": {
1063-
"aclrequired": "us-east-1",
10641063
"bucket": "flow-log-test",
10651064
"bucket_owner": "28bdbd9102b76c3da07c44e094b16b382f90f94be71626f4d9589b1309d2d7ef",
10661065
"bytes_sent": 243,
@@ -1072,6 +1071,7 @@
10721071
"remote_ip": "89.160.20.156",
10731072
"request_id": "366DB3C4B325AB11",
10741073
"request_uri": "GET / HTTP/1.1",
1074+
"source_region": "us-east-1",
10751075
"total_time": 13,
10761076
"user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/143.0.7499.4 Safari/537.36"
10771077
}

packages/aws/data_stream/s3access/elasticsearch/ingest_pipeline/default.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
description: "Pipeline for s3 server access logs"
2+
description: "Pipeline for S3 server access logs"
33

44
processors:
55
- set:
@@ -33,15 +33,16 @@ processors:
3333
(?:-|%{NUMBER:aws.s3access.object_size:long}) (?:-|%{NUMBER:aws.s3access.total_time:long}) (?:-|%{NUMBER:aws.s3access.turn_around_time:long})
3434
(?:-|\"-\"|\"%{DATA:aws.s3access.referrer}\") (?:-|\"(-|%{DATA:aws.s3access.user_agent})\") (?:-|%{S3KEY:aws.s3access.version_id})
3535
(?:-|%{S3ID:aws.s3access.host_id}) (?:-|%{S3VERSION:aws.s3access.signature_version}) (?:-|%{S3KEY:aws.s3access.cipher_suite})
36-
(?:-|%{WORD:aws.s3access.authentication_type}) (?:-|%{S3ID:aws.s3access.host_header}) (?:-|%{S3VERSION:aws.s3access.tls_version})(?: (?:-|%{S3REQUESTER:aws.s3access.access_point_arn}))?(?: (?:-|%{S3ACLREQUIRED:aws.s3access.aclrequired}))?
36+
(?:-|%{WORD:aws.s3access.authentication_type}) (?:-|%{S3ID:aws.s3access.host_header}) (?:-|%{S3VERSION:aws.s3access.tls_version})(?: (?:-|%{S3REQUESTER:aws.s3access.access_point_arn}))?(?: (?:-|%{S3ACLREQUIRED:aws.s3access.aclrequired}))?(?: (?:-|%{S3REGION:aws.s3access.source_region}))?(?: %{S3REGION:aws.s3access.source_region})?
3737
pattern_definitions:
3838
S3REQUESTER: "[a-zA-Z0-9\\/_\\.\\-%:@]+"
3939
S3REQUESTID: "[a-zA-Z0-9]+"
4040
S3OPERATION: "%{WORD}.%{WORD}.%{WORD}"
4141
S3KEY: "[a-zA-Z0-9\\/\\_\\!\\-\\.\\*\\'\\(\\)\\%\\+]+"
4242
S3ID: "[a-zA-Z0-9\\/_\\.\\-%+=:]+"
4343
S3VERSION: "[a-zA-Z0-9.]+"
44-
S3ACLREQUIRED: "[a-zA-Z0-9_-]+"
44+
S3ACLREQUIRED: "(-|Yes)"
45+
S3REGION: "[a-zA-Z][a-zA-Z0-9-]*"
4546
- grok:
4647
field: aws.s3access.host_header
4748
ignore_missing: true
@@ -188,6 +189,10 @@ processors:
188189
field: aws.s3access.aclrequired
189190
value: '{{aws.s3access.aclrequired}}'
190191
ignore_empty_value: true
192+
- set:
193+
field: aws.s3access.source_region
194+
value: '{{aws.s3access.source_region}}'
195+
ignore_empty_value: true
191196
- set:
192197
field: cloud.provider
193198
value: aws

packages/aws/data_stream/s3access/fields/fields.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@
9797
type: keyword
9898
description: |
9999
Whether the ACL was required for the request.
100+
- name: source_region
101+
type: keyword
102+
description: |
103+
The AWS Region from which the request originated.
100104
- name: access_point_arn
101105
type: keyword
102106
description: |

packages/aws/docs/s3.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ Refer to the following [document](https://www.elastic.co/guide/en/ecs/current/ec
8282
| aws.s3access.request_uri | The Request-URI part of the HTTP request message. | keyword |
8383
| aws.s3access.requester | The canonical user ID of the requester, or a - for unauthenticated requests. | keyword |
8484
| aws.s3access.signature_version | The signature version, SigV2 or SigV4, that was used to authenticate the request or a - for unauthenticated requests. | keyword |
85+
| aws.s3access.source_region | The AWS Region from which the request originated. | keyword |
8586
| aws.s3access.tls_version | The Transport Layer Security (TLS) version negotiated by the client. | keyword |
8687
| aws.s3access.total_time | The total amount of time in milliseconds the request was in flight from the server's perspective. | long |
8788
| aws.s3access.turn_around_time | The total amount of time in milliseconds that Amazon S3 spent processing your request. | long |

0 commit comments

Comments
 (0)