Is logstash output for inflow database?

I want to have an output for Influx DB from Logstash, is there such a plugin?

The output is set to graphite. This is the inflow configuration:

[input_plugins] # Configure the graphite api [input_plugins.graphite] enabled = true port = 2003 database = "AirAnalytics" # store graphite data in this database # udp_enabled = true # enable udp interface on the same port as the tcp interface 

This is the logstash configuration:

 output { stdout {} graphite { host => "localhost" port => 2003 } } 

I see the output in the console (stdout), but no other message and nothing is published in the inflow. I also checked the inflow logs, nothing.

I tried sending the same message directly through http for the inflow, and it works, so there is no problem with the message or installing the inflow.

+5
source share
5 answers

I decided. I needed to pass an already prepared stream-compatible string for inflow through logstash.

Below is the logstash configuration snippet that did the trick:

 output { http { url => "http://localhost:8086/db/<influx db name>/series?u=<user name>&p=<pwd>" format => "message" content_type => "application/json" http_method => "post" message => "%{message}" verify_ssl => false } stdout {} } 

Note. If you use the "json" format, then logstash wraps the body around the "message" field, which causes the problem.

+6
source
+1
source

There is infuxdb output in the logstash-contrib file , however this was added after 1.4.2 was released.

With logstash 1.5, a new plugin management system has been added. If you are using 1.5, you can set the infuxdb output with:

 # assuming you're in the logstash directory $ ./bin/plugin install logstash-output-influxdb 
+1
source

Maybe this help:

http://influxdb.com/docs/v0.8/api/reading_and_writing_data.html

Have a look at this section: Writing data through the Graphite Protocol, perhaps you can use the logstash graphical output.

I think I'm going to try this this weekend.

0
source

The accepted answer, although it works, is not very flexible because:

  • This requires the actual JSON payload to be in %{message} or some kind of logstash variable in which you end up using
  • it does not send data points in a batch packet where possible (of course, if you do not have it in the JSON payload ... what ... in that case ... why do you even use logstash in the first place?)

As Paul and Wilfred noted, there is support for infuxdb written by Jordan Sissel himself, but it was released after 1.4.2 ... it's good that it works with 1.4.2 (I tried it myself) ... all you need to do This is to copy the influxdb.rb file to /lib/logstash/outputs and configure your logstash accordingly. As for the documentation, you can find it here ... I had a bit more effort to find it because googling "infuxdb logstash" doesnโ€™t take this link to the first page results.

0
source

Source: https://habr.com/ru/post/1202967/


All Articles