Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not setting queue_url bucket_arn or non_aws_bucket_name returns error #28666

Merged
merged 5 commits into from
Oct 28, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Remove deprecated fields in coredns module. {pull}28196[28196]
- Remove old `httpjson` config implementation. {pull}28054[28054]
- Added dataset `threatq` to the `threatintel` module to ingest indicators from ThreatQ {issue}27423[27423]
- Fail to start Filebat if none between `queue_url`, `bucket_arn` or `non_aws_bucket_name` is set for a configured aws-s3 input {issue}13911[13911] {pull}28666[28666]

*Heartbeat*

Expand Down Expand Up @@ -333,6 +334,7 @@ for a few releases. Please use other tools provided by Elastic to fetch data fro
- Fix initialization of http client in Cloudfoundry input. {issue}28271[28271] {pull}28277[28277]
- Fix aws-s3 input by checking if GetObject API call response content type exists. {pull}28457[28457]


kaiyan-sheng marked this conversation as resolved.
Show resolved Hide resolved
*Heartbeat*

- Fixed excessive memory usage introduced in 7.5 due to over-allocating memory for HTTP checks. {pull}15639[15639]
Expand Down
4 changes: 1 addition & 3 deletions x-pack/filebeat/input/awss3/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (

"github.com/elastic/beats/v7/libbeat/common/cfgtype"
"github.com/elastic/beats/v7/libbeat/common/match"
"github.com/elastic/beats/v7/libbeat/logp"
"github.com/elastic/beats/v7/libbeat/reader/parser"
"github.com/elastic/beats/v7/libbeat/reader/readfile"
"github.com/elastic/beats/v7/libbeat/reader/readfile/encoding"
Expand Down Expand Up @@ -65,8 +64,7 @@ func (c *config) Validate() error {
}
}
if len(enabled) == 0 {
logp.NewLogger(inputName).Warnf("neither queue_url, bucket_arn, non_aws_bucket_name were provided, input %s will stop", inputName)
return nil
return errors.New("neither queue_url, bucket_arn nor non_aws_bucket_name were provided")
} else if len(enabled) > 1 {
return fmt.Errorf("queue_url <%v>, bucket_arn <%v>, non_aws_bucket_name <%v> "+
"cannot be set at the same time", c.QueueURL, c.BucketARN, c.NonAWSBucketName)
Expand Down
13 changes: 6 additions & 7 deletions x-pack/filebeat/input/awss3/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,17 @@ func TestConfig(t *testing.T) {
},
},
{
"error on no queueURL and s3Bucket",
"error on no queueURL and s3Bucket and nonAWSS3Bucket",
"",
"",
"",
common.MapStr{
"queue_url": "",
"bucket_arn": "",
},
"",
func(queueURL, s3Bucket string, nonAWSS3Bucket string) config {
return makeConfig("", "", "")
"queue_url": "",
"bucket_arn": "",
"non_aws_bucket_name": "",
},
"neither queue_url, bucket_arn nor non_aws_bucket_name were provided",
nil,
},
{
"error on both queueURL and s3Bucket",
Expand Down