Skip to content

Commit

Permalink
x-pack/filebeat/input/awss3: fix priority of region name configurations
Browse files Browse the repository at this point in the history
The code currently prioritises the region_name configuration, even when
it is not provided, against the claims of the documentation. Make a
check whether it is empty before claiming a conflict and using it.
  • Loading branch information
efd6 committed Jul 12, 2023
1 parent 91bbccf commit 468122d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff]
- Improve error reporting and fix IPv6 handling of TCP and UDP metric collection. {pull}35996[35996]
- Fix handling of NUL-terminated log lines in Fortinet Firewall module. {issue}36026[36026] {pull}36027[36027]
- Make redact field configuration recommended in CEL input and log warning if missing. {pull}36008[36008]
- Fix handling of region name configuration in awss3 input {pull}36034[36034]

*Heartbeat*

Expand Down
2 changes: 1 addition & 1 deletion x-pack/filebeat/input/awss3/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (in *s3Input) Run(inputContext v2.Context, pipeline beat.Pipeline) error {
if err != nil && in.config.RegionName == "" {
return fmt.Errorf("failed to get AWS region from queue_url: %w", err)
}
if regionName != in.config.RegionName {
if in.config.RegionName != "" && regionName != in.config.RegionName {
inputContext.Logger.Warnf("configured region disagrees with queue_url region: %q != %q: using %[1]q",
in.config.RegionName, regionName)
regionName = in.config.RegionName
Expand Down

0 comments on commit 468122d

Please sign in to comment.