Skip to content

Remove deprecated config for 5.0 #34

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
25 changes: 17 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
## 3.1.0
- breaking,config: Remove deprecated config `queue`. Please use `key` and `data_type`.
- breaking,config: Remove deprecated config `name`.

## 3.0.1
- Republish all the gems under jruby.
- Republish all the gems under jruby.

## 3.0.0
- Update the plugin to the version 2.0 of the plugin api, this change is required for Logstash 5.0 compatibility. See https://github.com/elastic/logstash/issues/5141
# 2.0.5
- Fix LocalJumpError exception see https://github.com/logstash-plugins/logstash-output-redis/pull/27
# 2.0.4
- Depend on logstash-core-plugin-api instead of logstash-core, removing the need to mass update plugins on major releases of logstash
# 2.0.3
- New dependency requirements for logstash-core for the 5.0 release
- Update the plugin to the version 2.0 of the plugin api, this change is required for Logstash 5.0 compatibility. See https://github.com/elastic/logstash/issues/5141

## 2.0.5
- Fix LocalJumpError exception see https://github.com/logstash-plugins/logstash-output-redis/pull/27

## 2.0.4
- Depend on logstash-core-plugin-api instead of logstash-core, removing the need to mass update plugins on major releases of logstash

## 2.0.3
- New dependency requirements for logstash-core for the 5.0 release

## 2.0.0
- Plugins were updated to follow the new shutdown semantic, this mainly allows Logstash to instruct input plugins to terminate gracefully,
instead of using Thread.raise on the plugins' threads. Ref: https://github.com/elastic/logstash/pull/3895
Expand Down
33 changes: 3 additions & 30 deletions lib/logstash/outputs/redis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ class LogStash::Outputs::Redis < LogStash::Outputs::Base

default :codec, "json"

# Name is used for logging in case there are multiple instances.
config :name, :validate => :string, :default => 'default',
:deprecated => true

# The hostname(s) of your Redis server(s). Ports may be specified on any
# hostname, which will override the global port config.
#
Expand All @@ -49,17 +45,13 @@ class LogStash::Outputs::Redis < LogStash::Outputs::Base
# Password to authenticate with. There is no authentication by default.
config :password, :validate => :password

# The name of the Redis queue (we'll use RPUSH on this). Dynamic names are
# valid here, for example `logstash-%{type}`
config :queue, :validate => :string, :deprecated => true

# The name of a Redis list or channel. Dynamic names are
# valid here, for example `logstash-%{type}`.
config :key, :validate => :string, :required => false
config :key, :validate => :string, :required => true

# Either list or channel. If `redis_type` is list, then we will set
# RPUSH to key. If `redis_type` is channel, then we will PUBLISH to `key`.
config :data_type, :validate => [ "list", "channel" ], :required => false
config :data_type, :validate => [ "list", "channel" ], :required => true

# Set to true if you want Redis to batch up values and send 1 RPUSH command
# instead of one command per value to push on the list. Note that this only
Expand Down Expand Up @@ -96,25 +88,6 @@ class LogStash::Outputs::Redis < LogStash::Outputs::Base
def register
require 'redis'

# TODO remove after setting key and data_type to true
if @queue
if @key or @data_type
raise RuntimeError.new(
"Cannot specify queue parameter and key or data_type"
)
end
@key = @queue
@data_type = 'list'
end

if not @key or not @data_type
raise RuntimeError.new(
"Must define queue, or key and data_type parameters"
)
end
# end TODO


if @batch
if @data_type != "list"
raise RuntimeError.new(
Expand Down Expand Up @@ -222,7 +195,7 @@ def connect

# A string used to identify a Redis instance in log messages
def identity
@name || "redis://#{@password}@#{@current_host}:#{@current_port}/#{@db} #{@data_type}:#{@key}"
"redis://#{@password}@#{@current_host}:#{@current_port}/#{@db} #{@data_type}:#{@key}"
end

def send_to_redis(event, payload)
Expand Down
2 changes: 1 addition & 1 deletion logstash-output-redis.gemspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Gem::Specification.new do |s|

s.name = 'logstash-output-redis'
s.version = '3.0.1'
s.version = '3.1.0'
s.licenses = ['Apache License (2.0)']
s.summary = "This output will send events to a Redis queue using RPUSH"
s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
Expand Down