Logstash - 是流入数据库的输出吗?

Sum*_*ngi 6 logstash influxdb

我想从Logstash获得Influx DB的输出,有没有这样的插件可用?

输出设置为graphite.这是涌入配置:

[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
Run Code Online (Sandbox Code Playgroud)

这是logstash配置:

output {
    stdout {}
    graphite {
            host => "localhost"
            port => 2003
    }
}
Run Code Online (Sandbox Code Playgroud)

我在控制台(stdout)中看到输出但没有其他消息,并且没有任何内容被发布到涌入.我也检查了潮流日志,没有.

我尝试通过http直接发布相同的消息到涌入并且它有效,所以消息或涌入安装没有问题.

Sum*_*ngi 7

解决了它.我需要通过logstash传递已经准备好的涌入兼容字符串到涌入.

以下是logstash配置代码段,它完成了这一操作:

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 {}
}
Run Code Online (Sandbox Code Playgroud)

注意:如果使用格式"json",则logstash将主体包裹在导致问题的"消息"字段周围.