mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
Adds access modifiers :P
This commit is contained in:
parent
cf75463e30
commit
2aa21df735
1 changed files with 4 additions and 0 deletions
|
@ -31,11 +31,13 @@ class LogStash::Outputs::Redis < LogStash::Outputs::Base
|
|||
# If redis_type is channel, then we will PUBLISH to key.
|
||||
config :data_type, :validate => [ "list", "channel" ], :required => true
|
||||
|
||||
public
|
||||
def register
|
||||
require 'redis'
|
||||
@redis = nil
|
||||
end # def register
|
||||
|
||||
private
|
||||
def connect
|
||||
Redis.new(
|
||||
:host => @host,
|
||||
|
@ -47,11 +49,13 @@ class LogStash::Outputs::Redis < LogStash::Outputs::Base
|
|||
end # def connect
|
||||
|
||||
# A string used to identify a redis instance in log messages
|
||||
private
|
||||
def identity
|
||||
"redis://#{@password}@#{@host}:#{@port}/#{@db} #{@data_type}:#{@key}"
|
||||
end
|
||||
|
||||
|
||||
public
|
||||
def receive(event)
|
||||
begin
|
||||
@redis ||= connect
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue