Class: Fluent::FlumeInput::FluentFlumeHandler
- Inherits:
-
Object
- Object
- Fluent::FlumeInput::FluentFlumeHandler
- Defined in:
- lib/fluent/plugin/in_flume.rb
Instance Attribute Summary collapse
-
#add_prefix ⇒ Object
Returns the value of attribute add_prefix.
-
#default_tag ⇒ Object
Returns the value of attribute default_tag.
-
#log ⇒ Object
Returns the value of attribute log.
-
#msg_format ⇒ Object
Returns the value of attribute msg_format.
-
#tag_field ⇒ Object
Returns the value of attribute tag_field.
Instance Method Summary collapse
Instance Attribute Details
#add_prefix ⇒ Object
Returns the value of attribute add_prefix.
118 119 120 |
# File 'lib/fluent/plugin/in_flume.rb', line 118 def add_prefix @add_prefix end |
#default_tag ⇒ Object
Returns the value of attribute default_tag.
117 118 119 |
# File 'lib/fluent/plugin/in_flume.rb', line 117 def default_tag @default_tag end |
#log ⇒ Object
Returns the value of attribute log.
120 121 122 |
# File 'lib/fluent/plugin/in_flume.rb', line 120 def log @log end |
#msg_format ⇒ Object
Returns the value of attribute msg_format.
119 120 121 |
# File 'lib/fluent/plugin/in_flume.rb', line 119 def msg_format @msg_format end |
#tag_field ⇒ Object
Returns the value of attribute tag_field.
116 117 118 |
# File 'lib/fluent/plugin/in_flume.rb', line 116 def tag_field @tag_field end |
Instance Method Details
#ackedAppend(evt) ⇒ Object
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
# File 'lib/fluent/plugin/in_flume.rb', line 149 def ackedAppend(evt) begin record = create_record(evt) if @tag_field tag = evt.fieldss[@tag_field] || @default_tag unless tag return # ignore end else tag = @default_tag end = evt..to_i if @add_prefix Engine.emit(@add_prefix + '.' + tag, , record) else Engine.emit(tag, , record) end return EventStatus::ACK rescue => e log.error "unexpected error", :error=>$!.to_s log.error_backtrace return EventStatus::ERR end end |
#append(evt) ⇒ Object
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/fluent/plugin/in_flume.rb', line 122 def append(evt) begin record = create_record(evt) if @tag_field tag = evt.fieldss[@tag_field] || @default_tag unless tag return # ignore end else tag = @default_tag end = evt..to_i if @add_prefix Engine.emit(@add_prefix + '.' + tag, , record) else Engine.emit(tag, , record) end rescue => e log.error "unexpected error", :error=>$!.to_s log.error_backtrace end end |
#close ⇒ Object
174 175 |
# File 'lib/fluent/plugin/in_flume.rb', line 174 def close() end |
#rawAppend(evt) ⇒ Object
145 146 147 |
# File 'lib/fluent/plugin/in_flume.rb', line 145 def rawAppend(evt) log.error "rawAppend is not implemented yet: #{evt}" end |