Skip to content

Commit

Permalink
[libbeat] Change aws_elb autodiscover provider field name to aws.elb.* (
Browse files Browse the repository at this point in the history
#16402)

* Change aws_elb autodiscover provider field name to aws.elb.*

* add changelog
  • Loading branch information
kaiyan-sheng authored Feb 21, 2020
1 parent 6076de6 commit f9fe104
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 19 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d

- The document id fields has been renamed from @metadata.id to @metadata._id {pull}15859[15859]
- Variable substitution from environment variables is not longer supported. {pull}15937{15937}
- Change aws_elb autodiscover provider field name from elb_listener.* to aws.elb.*. {issue}16219[16219] {pull}16402{16402}

*Auditbeat*

Expand Down
32 changes: 19 additions & 13 deletions libbeat/docs/shared-autodiscover.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -328,22 +328,28 @@ configs are the same only one will actually run.

This provider will load AWS credentials using the standard AWS environment variables and shared credentials files see https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html[Best Practices for Managing AWS Access Keys] for more information. If you do not wish to use these, you may explicitly set the `access_key_id` and `secret_access_key` variables.

These are the available fields during within config templating. The `elb_listener.*` fields will be available on each emitted event.
These are the available fields during within config templating. The `aws.elb.*` fields will be available on each emitted event.

* host
* port
* elb_listener.listener_arn
* elb_listener.load_balancer_arn
* elb_listener.protocol
* elb_listener.type
* elb_listener.scheme
* elb_listener.availability_zones
* elb_listener.created
* elb_listener.state
* elb_listener.ip_address_type
* elb_listener.security_groups
* elb_listener.vpc_id
* elb_listener.ssl_policy

* cloud.availability_zone
* cloud.provider
* cloud.region

* aws.elb.listener_arn
* aws.elb.load_balancer_arn
* aws.elb.protocol
* aws.elb.type
* aws.elb.scheme
* aws.elb.availability_zones
* aws.elb.created
* aws.elb.state.code
* aws.elb.state.reason
* aws.elb.ip_address_type
* aws.elb.security_groups
* aws.elb.vpc_id
* aws.elb.ssl_policy

include::../../{beatname_lc}/docs/autodiscover-aws-elb-config.asciidoc[]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
- key: elb_listener
- key: aws.elb
title: "ELB Listener"
description: >
AWS ELB Listeners
short_config: false
release: experimental
fields:
- name: elb_listener
- name: aws.elb
type: group
description: >
Represents an AWS ELB Listener, e.g. a port on an ELB.
Expand Down
10 changes: 8 additions & 2 deletions x-pack/libbeat/autodiscover/providers/aws/elb/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,15 @@ func (p *Provider) onWatcherStart(arn string, lbl *lbListener) {
"id": arn,
"host": lblMap["host"],
"port": lblMap["port"],
"aws": common.MapStr{
"elb": lbl.toMap(),
},
"cloud": lbl.toCloudMap(),
"meta": common.MapStr{
"elb_listener": lbl.toMap(),
"cloud": lbl.toCloudMap(),
"aws": common.MapStr{
"elb": lbl.toMap(),
},
"cloud": lbl.toCloudMap(),
},
}

Expand Down
10 changes: 8 additions & 2 deletions x-pack/libbeat/autodiscover/providers/aws/elb/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,15 @@ func Test_internalBuilder(t *testing.T) {
"start": true,
"host": *lbl.lb.DNSName,
"port": *lbl.listener.Port,
"aws": common.MapStr{
"elb": lbl.toMap(),
},
"cloud": lbl.toCloudMap(),
"meta": common.MapStr{
"elb_listener": lbl.toMap(),
"cloud": lbl.toCloudMap(),
"aws": common.MapStr{
"elb": lbl.toMap(),
},
"cloud": lbl.toCloudMap(),
},
}

Expand Down

0 comments on commit f9fe104

Please sign in to comment.