Class: FFluentdLine
- Inherits:
-
Object
- Object
- FFluentdLine
- Defined in:
- lib/rforward/ffluentd_line.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#host ⇒ Object
Returns the value of attribute host.
-
#port ⇒ Object
Returns the value of attribute port.
-
#tag ⇒ Object
Returns the value of attribute tag.
Instance Method Summary collapse
- #call(line) ⇒ Object
-
#initialize ⇒ FFluentdLine
constructor
A new instance of FFluentdLine.
Constructor Details
#initialize ⇒ FFluentdLine
Returns a new instance of FFluentdLine.
6 7 8 |
# File 'lib/rforward/ffluentd_line.rb', line 6 def initialize @client = Config.resolve Config::FLUENTD end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
4 5 6 |
# File 'lib/rforward/ffluentd_line.rb', line 4 def client @client end |
#host ⇒ Object
Returns the value of attribute host.
4 5 6 |
# File 'lib/rforward/ffluentd_line.rb', line 4 def host @host end |
#port ⇒ Object
Returns the value of attribute port.
4 5 6 |
# File 'lib/rforward/ffluentd_line.rb', line 4 def port @port end |
#tag ⇒ Object
Returns the value of attribute tag.
4 5 6 |
# File 'lib/rforward/ffluentd_line.rb', line 4 def tag @tag end |
Instance Method Details
#call(line) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/rforward/ffluentd_line.rb', line 10 def call line json = JSON.parse line @client.post Config.instance[:tag], json true rescue Exception => e RLogger.instance.error "(#{e.message}) (line: #{line})" false end |