Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot send logstash output to InfluxDB 0.9.6.1 #5

Open
lstep opened this issue Jan 29, 2016 · 0 comments
Open

Cannot send logstash output to InfluxDB 0.9.6.1 #5

lstep opened this issue Jan 29, 2016 · 0 comments

Comments

@lstep
Copy link

lstep commented Jan 29, 2016

Hello,
I'm trying to export data I collected from a PostgreSQL to an InfluxDB database, as I want to use Grafana, but Grafana doesn't (yet) support PostgreSQL. For this I'm trying to put a logstash between the PostgreSQL and the InfluxDB, using as logstash input the JDBC plugin (works fine 👍), and the logstash output plugin for InfluxDB.
As the influxdb plugin doesn't support InfluxDB 0.9.x servers (yet 😄), I replaced all the official InfluxDB plugin files in /opt/logstash/vendor/bundle/jruby/1.9/gems with the ones from your repository/fork contentfree/logstash-output-influxdb.

Alas, it still doesn't work. When trying to flush the data (sending it to InfluxDB), I get the following error:

Flushing 1 events to http://127.0.0.1:8086/write?db=pmacct&rp=default&precision=ms&u=admin&p=XXXXX - Teardown?  {:level=>:debug, :file=>"logstash/outputs/influxdb.rb", :line=>"170", :method=>"flush"}
Failed to flush outgoing items {:outgoing_count=>1, :exception=>"NoMethodError", :backtrace=>["/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-influxdb-2.0.2/lib/logstash/outputs/influxdb.rb:338:in `quoted'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-influxdb-2.0.2/lib/logstash/outputs/influxdb.rb:222:in `events_to_request_body'", "org/jruby/RubyHash.java:1342:in `each'", "org/jruby/RubyEnumerable.java:757:in `map'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-influxdb-2.0.2/lib/logstash/outputs/influxdb.rb:222:in `events_to_request_body'", "org/jruby/RubyArray.java:2414:in `map'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-influxdb-2.0.2/lib/logstash/outputs/influxdb.rb:219:in `events_to_request_body'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-influxdb-2.0.2/lib/logstash/outputs/influxdb.rb:171:in `flush'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/stud-0.0.22/lib/stud/buffer.rb:219:in `buffer_flush'", "org/jruby/RubyHash.java:1342:in `each'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/stud-0.0.22/lib/stud/buffer.rb:216:in `buffer_flush'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/stud-0.0.22/lib/stud/buffer.rb:159:in `buffer_receive'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-influxdb-2.0.2/lib/logstash/outputs/influxdb.rb:165:in `receive'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.1.1-java/lib/logstash/outputs/base.rb:81:in `handle'", "(eval):26:in `output_func'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.1.1-java/lib/logstash/pipeline.rb:277:in `outputworker'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.1.1-java/lib/logstash/pipeline.rb:194:in `start_outputs'"], :level=>:warn, :file=>"stud/buffer.rb", :line=>"231", :method=>"buffer_flush"}

I'm not a Ruby user, so I don't exactly understand the problem. It says exception=>"NoMethodError" around the line:

  def quoted(value)
    Numeric === value ? value : %Q|"#{value.gsub('"','\"')}"|
  end

Do I need a particular version of Ruby? I'm on an Ubuntu Server (Trusty), with Ruby 1.9.3.4.

  • Logstash version 2.1.1-1
  • InfluxDB version 0.9.6.1

If that can help understanding the problem is my logstash output block conf file:

output {
   influxdb {
           host => "127.0.0.1"
           user => "admin"
           password => "XXXXX"
           db => "pmacct"
           coerce_values => {
                "port_src" => "integer"
                "port_dst" => "integer"
                "packets" => "integer"
                "bytes" => "integer"
           }
           data_points => {
                "ip_src" => "%{ip_src}"
                "ip_dst" => "%{ip_dst}"
                "port_src" => "%{port_src}"
                "port_dst" => "%{port_dst}"
                "packets" => "%{packets}"
                "bytes" => "%{bytes}"
                "stamp_inserted" => "%{stamp_inserted}"
                "stamp_updated" => "%{stamp_updated}"
           }
        }
}

Thanks for your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant