From ccfb332126b4f013adbc7e4b8222c9995097e1ab Mon Sep 17 00:00:00 2001 From: Steffen Siering Date: Wed, 23 Jan 2019 13:43:34 +0100 Subject: [PATCH] Mark redis/logstash port settings as deprecated (#9915) The port settigns for redis/logstash have been marked as deprecated since 5.0. This change will print a deprecation warning if the settings are used. We will remove the setting in 7.0. --- CHANGELOG.next.asciidoc | 1 + auditbeat/auditbeat.reference.yml | 4 ---- filebeat/filebeat.reference.yml | 4 ---- heartbeat/heartbeat.reference.yml | 4 ---- journalbeat/journalbeat.reference.yml | 4 ---- libbeat/_meta/config.reference.yml | 4 ---- libbeat/outputs/logstash/logstash.go | 5 +++++ libbeat/outputs/redis/redis.go | 5 +++++ metricbeat/metricbeat.reference.yml | 4 ---- packetbeat/packetbeat.reference.yml | 4 ---- winlogbeat/winlogbeat.reference.yml | 4 ---- x-pack/auditbeat/auditbeat.reference.yml | 4 ---- x-pack/filebeat/filebeat.reference.yml | 4 ---- x-pack/functionbeat/functionbeat.reference.yml | 4 ---- 14 files changed, 11 insertions(+), 44 deletions(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index a133d0a29b14..9e055622cb80 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -13,6 +13,7 @@ https://github.com/elastic/beats/compare/v6.6.0...6.x[Check the HEAD diff] - Dissect syntax change, use * instead of ? when working with field reference. {issue}8054[8054] - Fix registry handle leak on Windows (https://github.com/elastic/go-sysinfo/pull/33). {pull}9920[9920] - Allow to unenroll a Beat from the UI. {issue}9452[9452] +- Port settings have been deprecated in redis/logstash output and will be removed in 7.0. {pull}9915[9915] *Auditbeat* diff --git a/auditbeat/auditbeat.reference.yml b/auditbeat/auditbeat.reference.yml index 567cfd10093b..26a10b71b797 100644 --- a/auditbeat/auditbeat.reference.yml +++ b/auditbeat/auditbeat.reference.yml @@ -727,10 +727,6 @@ output.elasticsearch: # unreachable, the events are distributed to the reachable servers only. #hosts: ["localhost:6379"] - # The Redis port to use if hosts does not contain a port number. The default - # is 6379. - #port: 6379 - # The name of the Redis list or channel the events are published to. The # default is auditbeat. #key: auditbeat diff --git a/filebeat/filebeat.reference.yml b/filebeat/filebeat.reference.yml index 49a98e0f8ea9..fd14dddc7e75 100644 --- a/filebeat/filebeat.reference.yml +++ b/filebeat/filebeat.reference.yml @@ -1425,10 +1425,6 @@ output.elasticsearch: # unreachable, the events are distributed to the reachable servers only. #hosts: ["localhost:6379"] - # The Redis port to use if hosts does not contain a port number. The default - # is 6379. - #port: 6379 - # The name of the Redis list or channel the events are published to. The # default is filebeat. #key: filebeat diff --git a/heartbeat/heartbeat.reference.yml b/heartbeat/heartbeat.reference.yml index ceec576adb92..5a50ae7dfbfb 100644 --- a/heartbeat/heartbeat.reference.yml +++ b/heartbeat/heartbeat.reference.yml @@ -876,10 +876,6 @@ output.elasticsearch: # unreachable, the events are distributed to the reachable servers only. #hosts: ["localhost:6379"] - # The Redis port to use if hosts does not contain a port number. The default - # is 6379. - #port: 6379 - # The name of the Redis list or channel the events are published to. The # default is heartbeat. #key: heartbeat diff --git a/journalbeat/journalbeat.reference.yml b/journalbeat/journalbeat.reference.yml index fc0a767ff712..e76dedf5c562 100644 --- a/journalbeat/journalbeat.reference.yml +++ b/journalbeat/journalbeat.reference.yml @@ -678,10 +678,6 @@ output.elasticsearch: # unreachable, the events are distributed to the reachable servers only. #hosts: ["localhost:6379"] - # The Redis port to use if hosts does not contain a port number. The default - # is 6379. - #port: 6379 - # The name of the Redis list or channel the events are published to. The # default is journalbeat. #key: journalbeat diff --git a/libbeat/_meta/config.reference.yml b/libbeat/_meta/config.reference.yml index d209f058e0ea..18742e2483e2 100644 --- a/libbeat/_meta/config.reference.yml +++ b/libbeat/_meta/config.reference.yml @@ -620,10 +620,6 @@ output.elasticsearch: # unreachable, the events are distributed to the reachable servers only. #hosts: ["localhost:6379"] - # The Redis port to use if hosts does not contain a port number. The default - # is 6379. - #port: 6379 - # The name of the Redis list or channel the events are published to. The # default is beatname. #key: beatname diff --git a/libbeat/outputs/logstash/logstash.go b/libbeat/outputs/logstash/logstash.go index db9dbebe4edb..cf6a40ed88f8 100644 --- a/libbeat/outputs/logstash/logstash.go +++ b/libbeat/outputs/logstash/logstash.go @@ -20,6 +20,7 @@ package logstash import ( "github.com/elastic/beats/libbeat/beat" "github.com/elastic/beats/libbeat/common" + "github.com/elastic/beats/libbeat/common/cfgwarn" "github.com/elastic/beats/libbeat/common/transport/tlscommon" "github.com/elastic/beats/libbeat/logp" "github.com/elastic/beats/libbeat/outputs" @@ -51,6 +52,10 @@ func makeLogstash( return outputs.Fail(err) } + if cfg.HasField("port") { + cfgwarn.Deprecate("7.0.0", "The Logstash outputs port setting") + } + hosts, err := outputs.ReadHostList(cfg) if err != nil { return outputs.Fail(err) diff --git a/libbeat/outputs/redis/redis.go b/libbeat/outputs/redis/redis.go index ea6e0801a235..fb27daafaca2 100644 --- a/libbeat/outputs/redis/redis.go +++ b/libbeat/outputs/redis/redis.go @@ -23,6 +23,7 @@ import ( "github.com/elastic/beats/libbeat/beat" "github.com/elastic/beats/libbeat/common" + "github.com/elastic/beats/libbeat/common/cfgwarn" "github.com/elastic/beats/libbeat/common/transport/tlscommon" "github.com/elastic/beats/libbeat/logp" "github.com/elastic/beats/libbeat/outputs" @@ -56,6 +57,10 @@ func makeRedis( cfg.SetString("index", -1, beat.Beat) } + if cfg.HasField("port") { + cfgwarn.Deprecate("7.0.0", "The Redis outputs port setting") + } + // ensure we have a `key` field in settings if !cfg.HasField("key") { s, err := cfg.String("index", -1) diff --git a/metricbeat/metricbeat.reference.yml b/metricbeat/metricbeat.reference.yml index 7a1aeb670555..0254392debe5 100644 --- a/metricbeat/metricbeat.reference.yml +++ b/metricbeat/metricbeat.reference.yml @@ -1307,10 +1307,6 @@ output.elasticsearch: # unreachable, the events are distributed to the reachable servers only. #hosts: ["localhost:6379"] - # The Redis port to use if hosts does not contain a port number. The default - # is 6379. - #port: 6379 - # The name of the Redis list or channel the events are published to. The # default is metricbeat. #key: metricbeat diff --git a/packetbeat/packetbeat.reference.yml b/packetbeat/packetbeat.reference.yml index 1f89426293a2..2258cbb38155 100644 --- a/packetbeat/packetbeat.reference.yml +++ b/packetbeat/packetbeat.reference.yml @@ -1101,10 +1101,6 @@ output.elasticsearch: # unreachable, the events are distributed to the reachable servers only. #hosts: ["localhost:6379"] - # The Redis port to use if hosts does not contain a port number. The default - # is 6379. - #port: 6379 - # The name of the Redis list or channel the events are published to. The # default is packetbeat. #key: packetbeat diff --git a/winlogbeat/winlogbeat.reference.yml b/winlogbeat/winlogbeat.reference.yml index 7d3f6c1d3fca..5ac07d63522d 100644 --- a/winlogbeat/winlogbeat.reference.yml +++ b/winlogbeat/winlogbeat.reference.yml @@ -649,10 +649,6 @@ output.elasticsearch: # unreachable, the events are distributed to the reachable servers only. #hosts: ["localhost:6379"] - # The Redis port to use if hosts does not contain a port number. The default - # is 6379. - #port: 6379 - # The name of the Redis list or channel the events are published to. The # default is winlogbeat. #key: winlogbeat diff --git a/x-pack/auditbeat/auditbeat.reference.yml b/x-pack/auditbeat/auditbeat.reference.yml index dd01651c310b..090cbe3c48d8 100644 --- a/x-pack/auditbeat/auditbeat.reference.yml +++ b/x-pack/auditbeat/auditbeat.reference.yml @@ -753,10 +753,6 @@ output.elasticsearch: # unreachable, the events are distributed to the reachable servers only. #hosts: ["localhost:6379"] - # The Redis port to use if hosts does not contain a port number. The default - # is 6379. - #port: 6379 - # The name of the Redis list or channel the events are published to. The # default is auditbeat. #key: auditbeat diff --git a/x-pack/filebeat/filebeat.reference.yml b/x-pack/filebeat/filebeat.reference.yml index bb06ef6e6d07..0dce53fea08a 100644 --- a/x-pack/filebeat/filebeat.reference.yml +++ b/x-pack/filebeat/filebeat.reference.yml @@ -1459,10 +1459,6 @@ output.elasticsearch: # unreachable, the events are distributed to the reachable servers only. #hosts: ["localhost:6379"] - # The Redis port to use if hosts does not contain a port number. The default - # is 6379. - #port: 6379 - # The name of the Redis list or channel the events are published to. The # default is filebeat. #key: filebeat diff --git a/x-pack/functionbeat/functionbeat.reference.yml b/x-pack/functionbeat/functionbeat.reference.yml index da7ee200f924..621580d6fec6 100644 --- a/x-pack/functionbeat/functionbeat.reference.yml +++ b/x-pack/functionbeat/functionbeat.reference.yml @@ -714,10 +714,6 @@ output.elasticsearch: # unreachable, the events are distributed to the reachable servers only. #hosts: ["localhost:6379"] - # The Redis port to use if hosts does not contain a port number. The default - # is 6379. - #port: 6379 - # The name of the Redis list or channel the events are published to. The # default is functionbeat. #key: functionbeat