mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
- cherrypick petef's stdout:///debug support
This commit is contained in:
parent
c0551dfaaf
commit
31e2bebde7
1 changed files with 17 additions and 3 deletions
|
@ -3,12 +3,26 @@ require "logstash/namespace"
|
|||
|
||||
class LogStash::Outputs::Stdout < LogStash::Outputs::Base
|
||||
public
|
||||
def register
|
||||
# nothing to do
|
||||
def initialize(*args)
|
||||
super
|
||||
|
||||
@opts = {}
|
||||
if @url.path != "/"
|
||||
@opts = @url.path[1..-1].split(",")
|
||||
end
|
||||
end # def register
|
||||
|
||||
public
|
||||
def receive(event)
|
||||
puts event
|
||||
if debug?
|
||||
ap event
|
||||
else
|
||||
puts event
|
||||
end
|
||||
end # def event
|
||||
|
||||
public
|
||||
def debug?
|
||||
return @opts.member?("debug")
|
||||
end
|
||||
end # class LogStash::Outputs::Stdout
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue