Skip to content

Commit

Permalink
Mark redis/logstash port settings as deprecated (#9915)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Steffen Siering authored Jan 23, 2019
1 parent 82856b5 commit ccfb332
Show file tree
Hide file tree
Showing 14 changed files with 11 additions and 44 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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*

Expand Down
4 changes: 0 additions & 4 deletions auditbeat/auditbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions filebeat/filebeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions heartbeat/heartbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions journalbeat/journalbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions libbeat/_meta/config.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions libbeat/outputs/logstash/logstash.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions libbeat/outputs/redis/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 0 additions & 4 deletions metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions packetbeat/packetbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions winlogbeat/winlogbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions x-pack/auditbeat/auditbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions x-pack/filebeat/filebeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions x-pack/functionbeat/functionbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ccfb332

Please sign in to comment.