mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
- Add config docs
This commit is contained in:
parent
6a28e92dad
commit
5e1b40c78f
4 changed files with 51 additions and 15 deletions
|
@ -1,15 +1,23 @@
|
|||
require "logstash/filters/base"
|
||||
require "logstash/namespace"
|
||||
require "logstash/time"
|
||||
require "java"
|
||||
|
||||
class LogStash::Filters::Date < LogStash::Filters::Base
|
||||
|
||||
config_name "date"
|
||||
|
||||
# Config for date is:
|
||||
# fieldname: dateformat
|
||||
# Allow arbitrary keys for this config.
|
||||
# fieldname => dateformat
|
||||
#
|
||||
# The date formats allowed are the string 'ISO8601' or whatever is supported
|
||||
# by Joda; generally: [java.text.SimpleDateFormat][dateformats]
|
||||
#
|
||||
# For example, if you have a field 'logdate' and with a value that looks like 'Aug 13 2010 00:03:44'
|
||||
# you would use this configuration:
|
||||
#
|
||||
# logdate => "MMM dd yyyy HH:mm:ss"
|
||||
#
|
||||
# [dateformats]: http://download.oracle.com/javase/1.4.2/docs/api/java/text/SimpleDateFormat.html
|
||||
config /[A-Za-z0-9_-]+/, :validate => :string
|
||||
|
||||
# LOGSTASH-34
|
||||
|
@ -42,7 +50,7 @@ class LogStash::Filters::Date < LogStash::Filters::Base
|
|||
|
||||
public
|
||||
def register
|
||||
#@formatter = org.joda.time.format.DateTimeFormat.forPattern
|
||||
require "java"
|
||||
@config.each do |fieldname, value|
|
||||
next if fieldname == "type"
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
require "bunny" # rubygem 'bunny'
|
||||
require "logstash/inputs/base"
|
||||
require "logstash/namespace"
|
||||
|
||||
|
@ -7,15 +6,32 @@ class LogStash::Inputs::Amqp < LogStash::Inputs::Base
|
|||
|
||||
config_name "amqp"
|
||||
|
||||
config :host, :validate => :string, :required => true
|
||||
config :port, :validate => :number
|
||||
config :user, :validate => :string, :required => true
|
||||
config :password, :validate => :string, :required => true
|
||||
# The host to connect to
|
||||
config :host, :validate => :string, :required => true, :default => "localhost"
|
||||
|
||||
# The AMQP port to connect on
|
||||
config :port, :validate => :number, :default => 5672
|
||||
|
||||
# Your amqp username
|
||||
config :user, :validate => :string, :required => true, :default => "guest"
|
||||
|
||||
# Your amqp password
|
||||
config :password, :validate => :string, :required => true, :default => "guest"
|
||||
|
||||
# The exchange type (fanout, topic, direct)
|
||||
config :exchange_type, :validate => :string, :required => true
|
||||
|
||||
# The name of the exchange
|
||||
config :name, :validate => :string, :required => true
|
||||
config :vhost, :validate => :string
|
||||
config :durable, :validate => :boolean
|
||||
config :debug, :validate => :boolean
|
||||
|
||||
# The vhost to use
|
||||
config :vhost, :validate => :string, :default => "/"
|
||||
|
||||
# Is this exchange durable?
|
||||
config :durable, :validate => :boolean, :default => false
|
||||
|
||||
# Enable or disable debugging
|
||||
config :debug, :validate => :boolean, :default => false
|
||||
|
||||
public
|
||||
def initialize(params)
|
||||
|
@ -32,6 +48,7 @@ class LogStash::Inputs::Amqp < LogStash::Inputs::Base
|
|||
|
||||
public
|
||||
def register
|
||||
require "bunny" # rubygem 'bunny'
|
||||
@logger.info("Registering input #{@url}")
|
||||
amqpsettings = {
|
||||
:vhost => (@vhost or "/"),
|
||||
|
|
|
@ -8,6 +8,8 @@ class LogStash::Inputs::Base
|
|||
attr_accessor :logger
|
||||
|
||||
config_name "input"
|
||||
|
||||
# Label this input with a type.
|
||||
config :type, :validate => :string, :required => true
|
||||
|
||||
config :tags, :validate => (lambda do |value|
|
||||
|
|
|
@ -1,19 +1,28 @@
|
|||
require "logstash/file/manager"
|
||||
require "logstash/inputs/base"
|
||||
require "logstash/namespace"
|
||||
require "socket" # for Socket.gethostname
|
||||
|
||||
# Stream events from files.
|
||||
#
|
||||
# By default, each event is assumed to be one line. If you
|
||||
# want to join lines, you'll want to use the multiline filter.
|
||||
#
|
||||
# Files are followed in a manner similar to "tail -0F". File rotation
|
||||
# is detected and handled by this input.
|
||||
class LogStash::Inputs::File < LogStash::Inputs::Base
|
||||
|
||||
@@filemanager = nil
|
||||
@@filemanager_lock = Mutex.new
|
||||
|
||||
config_name "file"
|
||||
|
||||
# The path to the file to use as an input.
|
||||
# You can use globs here, such as "/var/log/*.log"
|
||||
#
|
||||
config :path, :required => true
|
||||
|
||||
public
|
||||
def register
|
||||
# nothing
|
||||
require "logstash/file/manager"
|
||||
end # def register
|
||||
|
||||
public
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue