diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index d8e8b320023d..4cc924c427f9 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -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* diff --git a/x-pack/filebeat/input/awss3/config.go b/x-pack/filebeat/input/awss3/config.go index d1d4989ead80..5b8308d1771e 100644 --- a/x-pack/filebeat/input/awss3/config.go +++ b/x-pack/filebeat/input/awss3/config.go @@ -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" @@ -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) diff --git a/x-pack/filebeat/input/awss3/config_test.go b/x-pack/filebeat/input/awss3/config_test.go index e7ece7a62693..189ce447ff85 100644 --- a/x-pack/filebeat/input/awss3/config_test.go +++ b/x-pack/filebeat/input/awss3/config_test.go @@ -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",