Class: Fluent::ApacheLogFormat
- Inherits:
-
Output
- Object
- Output
- Fluent::ApacheLogFormat
- Defined in:
- lib/fluent/plugin/out_alf.rb
Instance Method Summary collapse
-
#configure(conf) ⇒ Object
TODO: Add params to allow different field names for the log “%h %l %u %t "%r" %>s %b "%Refereri" "%User-Agenti" %D” config_param :host, :string config_param :time, :string config_param :method, :string config_param :path, :string config_param :status, :string config_param :size, :integer, :default => 0 config_param :referer, :string, :default => ” config_param :user_agent, :string, :default => ” config_param :response_time, :integer, :default => ”.
-
#emit(tag, es, chain) ⇒ Object
This method is called when an event reaches Fluentd.
-
#initialize ⇒ ApacheLogFormat
constructor
A new instance of ApacheLogFormat.
- #shutdown ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize ⇒ ApacheLogFormat
Returns a new instance of ApacheLogFormat.
25 26 27 |
# File 'lib/fluent/plugin/out_alf.rb', line 25 def initialize super end |
Instance Method Details
#configure(conf) ⇒ Object
TODO: Add params to allow different field names for the log “%h %l %u %t "%r" %>s %b "%Refereri" "%User-Agenti" %D” config_param :host, :string config_param :time, :string config_param :method, :string config_param :path, :string config_param :status, :string config_param :size, :integer, :default => 0 config_param :referer, :string, :default => ” config_param :user_agent, :string, :default => ” config_param :response_time, :integer, :default => ”
21 22 23 |
# File 'lib/fluent/plugin/out_alf.rb', line 21 def configure(conf) super end |
#emit(tag, es, chain) ⇒ Object
This method is called when an event reaches Fluentd. ‘es’ is a Fluent::EventStream object that includes multiple events. You can use ‘es.each {|time,record| … }’ to retrieve events. ‘chain’ is an object that manages transactions. Call ‘chain.next’ at appropriate points and rollback if it raises an exception.
NOTE! This method is called by Fluentd’s main thread so you should not write slow routine here. It causes Fluentd’s performance degression.
44 45 46 47 48 49 50 |
# File 'lib/fluent/plugin/out_alf.rb', line 44 def emit(tag, es, chain) chain.next es.each {|time,record| puts output_record(record) } end |
#shutdown ⇒ Object
33 34 35 |
# File 'lib/fluent/plugin/out_alf.rb', line 33 def shutdown super end |
#start ⇒ Object
29 30 31 |
# File 'lib/fluent/plugin/out_alf.rb', line 29 def start super end |