logstash-plugins / logstash-output-influxdb

Apache License 2.0
58 stars 79 forks source link

Undefined method to_json #19

Closed AlexeyKupershtokh closed 9 years ago

AlexeyKupershtokh commented 9 years ago

Hello. I've just installed the plugin and I see the following error message in the logstash log.

==> /var/log/logstash/logstash.log <==

{
  :timestamp=>"2015-04-17T04:56:17.436000+0300",
  :message=>"Failed to flush outgoing items",
  :outgoing_count=>1,
  :exception=>#<NoMethodError: undefined method `to_json' for #<Array:0x2f0dbcff>>,
  :backtrace=>[
    "/opt/logstash/lib/logstash/outputs/influxdb.rb:190:in `flush'",
    "/opt/logstash/vendor/bundle/jruby/1.9/gems/stud-0.0.19/lib/stud/buffer.rb:219:in `buffer_flush'",
    "org/jruby/RubyHash.java:1341:in `each'",
    "/opt/logstash/vendor/bundle/jruby/1.9/gems/stud-0.0.19/lib/stud/buffer.rb:216:in `buffer_flush'",
    "/opt/logstash/vendor/bundle/jruby/1.9/gems/stud-0.0.19/lib/stud/buffer.rb:193:in `buffer_flush'",
    "/opt/logstash/vendor/bundle/jruby/1.9/gems/stud-0.0.19/lib/stud/buffer.rb:159:in `buffer_receive'",
    "/opt/logstash/lib/logstash/outputs/influxdb.rb:155:in `receive'",
    "/opt/logstash/lib/logstash/outputs/base.rb:88:in `handle'",
    "(eval):117:in `initialize'", "org/jruby/RubyArray.java:1613:in `each'",
    "org/jruby/RubyEnumerable.java:805:in `flat_map'",
    "(eval):103:in `initialize'",
    "org/jruby/RubyProc.java:271:in `call'",
    "/opt/logstash/lib/logstash/pipeline.rb:279:in `output'",
    "/opt/logstash/lib/logstash/pipeline.rb:235:in `outputworker'",
    "/opt/logstash/lib/logstash/pipeline.rb:163:in `start_outputs'"
  ],
  :level=>:warn
}

System is Ubuntu 12.04.3 LTS. Logstash 1.5.0RC2. The plugin was installed 30 minutes ago using bin/plugin install logstash-output-influxdb.

Logstash config:

output {
  if [type] == "gelf-ft-production-2.2" {
    influxdb {
      data_points => {
        'type' => 'type'
        'message' => 'message'
      }
      host => "localhost"
      user => "epic"
      password => "epic"
      db => "epic-forces-production"
    }
    if [level] <= 7 {
      elasticsearch {
        protocol => "http"
        host => "127.0.0.1"
        index => "ft-production-%{+YYYY.MM.dd}"
      }
    }
  }
}
AlexeyKupershtokh commented 9 years ago

Seems like a duplicate of #17.

suyograo commented 9 years ago

Fixed

suyograo commented 9 years ago

https://github.com/logstash-plugins/logstash-output-influxdb/pull/8

AlexeyKupershtokh commented 9 years ago

Thanks a lot! On Apr 18, 2015 12:14 AM, "Suyog Rao" notifications@github.com wrote:

8 https://github.com/logstash-plugins/logstash-output-influxdb/pull/8

— Reply to this email directly or view it on GitHub https://github.com/logstash-plugins/logstash-output-influxdb/issues/19#issuecomment-94043033 .