简体   繁体   English

Logstash和Flowdock集成

[英]Logstash and Flowdock integration

I'm trying to send a subset of messages to Flowdock as output from Logstash. 我正在尝试将消息的子集作为Logstash的输出发送到Flowdock。 Unfortunately, due to this issue I get essentially nothing back about why my messages aren't making it. 不幸的是,由于这个问题,我基本上没有得到关于为什么我的消息没有成功的反馈。 Stripping down to a basic example, I see the problem even if I change my output config to the following: 简单地讲一个基本示例,即使将输出配置更改为以下内容,我也看到了问题:

output {
  http {
    http_method => "post"
    url => "https://api.flowdock.com/v1/messages/team_inbox/API_TOKEN"
    format => "message"
    content_type => "application/json"
    message => "{\"source\":\"logstash\",\"from_address\":\"me@example.com\", \"subject\":\"Log Message\", \"content\":\"test\"}"
  }
}

I know, though, that output is generally working because if I add the following to output I see log messages written to the file: 不过,我知道该输出通常是有效的,因为如果在输出中添加以下内容,则会看到日志消息写入该文件:

file {
  path => "/mnt/test.log"
}

I also know that the http message I'm sending to Flowdock should work since 我也知道我发送给Flowdock的http消息应该可以正常工作

curl -X POST https://api.flowdock.com/v1/messages/team_inbox/API_TOKEN -d "{\"source\":\"logstash\",\"from_address\":\"me@example.com\",\"subject\":\"Log Message\",\"content\":\"test\"}" -H "Content-Type: application/json"

results in a message being posted to the team inbox. 导致将消息发布到团队收件箱。

Are there any ways to work around this issue to determine why my output from logstash is failing? 有什么方法可以解决此问题,以确定为什么我的logstash输出失败?

I would start debugging the issue by first sending the requests from Logstash to a service that just outputs the received request, for example RequestBin . 我将通过首先将Logstash的请求发送到仅输出接收到的请求的服务(例如RequestBin)来开始调试问题。

Something like: 就像是:

output {
  http {
    http_method => "post"
    url => "http://requestb.in/<created_id>"
    format => "message"
    content_type => "application/json"
    message => "{\"source\":\"logstash\",\"from_address\":\"me@example.com\",\"subject\":\"Log Message\", \"content\":\"test\"}"
  }
}

After you've made sure that the request Logstash is making is correct, take that request (preferably the exact data) and try to send it to Flowdock using curl or some other means. 确定Logstash发出的请求正确无误后,处理该请求(最好是准确的数据),然后尝试使用curl或其他方法将其发送到Flowdock。

At this point you should be able to tell why the request fails in either end and notify the party accordingly (ie open a ticket to https://logstash.jira.com/secure/Dashboard.jspa or send an email to support@flowdock.com). 在这一点上,您应该能够知道请求在任一端失败的原因,并相应地通知当事方(即打开https://logstash.jira.com/secure/Dashboard.jspa的票证或发送电子邮件至support @ flowdock .com)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM