Class: LogStash::Inputs::Base
- Includes:
- Config::Mixin
- Defined in:
- lib/logstash/inputs/base.rb
Overview
This is the base class for logstash inputs.
Direct Known Subclasses
Collectd, DrupalDblog, Elasticsearch, EventLog, Exec, File, Ganglia, Gelf, Heroku, IMAP, Irc, Log4j, Lumberjack, Pipe, Relp, S3, Snmptrap, Sqlite, Stdin, Stomp, Syslog, Tcp, Threadable, Twitter, Udp, Unix, WMI, Websocket, Xmpp, ZeroMQ
Constant Summary
Constants included from Config::Mixin
Instance Attribute Summary collapse
-
#params ⇒ Object
Returns the value of attribute params.
-
#threadable ⇒ Object
Returns the value of attribute threadable.
Attributes included from Config::Mixin
Attributes inherited from Plugin
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Base
constructor
A new instance of Base.
- #register ⇒ Object
- #tag(newtag) ⇒ Object
Methods included from Config::Mixin
Methods inherited from Plugin
#eql?, #finished, #finished?, #hash, #inspect, lookup, #reload, #running?, #shutdown, #teardown, #terminating?, #to_s
Constructor Details
#initialize(params = {}) ⇒ Base
Returns a new instance of Base.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/logstash/inputs/base.rb', line 70 def initialize(params={}) super @threadable = false config_init(params) @tags ||= [] if @charset && @codec.class.get_config.include?("charset") # charset is deprecated on inputs, but provide backwards compatibility # by copying the charset setting into the codec. @logger.info("Copying input's charset setting into codec", :input => self, :codec => @codec) charset = @charset @codec.instance_eval { @charset = charset } end # Backwards compat for the 'format' setting case @format when "plain"; # do nothing when "json" @codec = LogStash::Plugin.lookup("codec", "json").new when "json_event" @codec = LogStash::Plugin.lookup("codec", "oldlogstashjson").new end end |
Instance Attribute Details
#params ⇒ Object
Returns the value of attribute params.
66 67 68 |
# File 'lib/logstash/inputs/base.rb', line 66 def params @params end |
#threadable ⇒ Object
Returns the value of attribute threadable.
67 68 69 |
# File 'lib/logstash/inputs/base.rb', line 67 def threadable @threadable end |
Instance Method Details
#register ⇒ Object
97 98 99 |
# File 'lib/logstash/inputs/base.rb', line 97 def register raise "#{self.class}#register must be overidden" end |
#tag(newtag) ⇒ Object
102 103 104 |
# File 'lib/logstash/inputs/base.rb', line 102 def tag(newtag) @tags << newtag end |