如何使用Logstash WebSocket输出插件输出JSON

时间:2019-02-25 14:07:14

标签: websocket logstash logstash-grok logstash-configuration logstash-forwarder

输出的json文件应采用以下格式,并应发送到Websocket服务器:

{
   "id" : "test"
   "type": "applogs"
   "data": "this will be in GREEDYDATA"
}

我正在尝试使用类似logstash的配置文件,但它不起作用:

input
{
    gelf {}
}

filter
{
    grok
    {
            match => { "message" => "%{GREEDYDATA:data}"}
    }
}

output
{
    websocket
    {
            host => "wss://some-site/ws/test"
            id => "test"
            type => "applogs"
            codec => json {}
    }
    stdout
    {
            codec => rubydebug
    }
}

0 个答案:

没有答案