尝试使用 Logstash 从 Cloudwatch 日志中建立索引

Gab*_*iel 5 amazon-web-services elasticsearch logstash amazon-cloudwatchlogs

因此,我们将日志(apache、tomcat 等)存储在 Amazon CloudWatch Logs 中。我正在尝试使用 Logstash 从 AWS 建立索引并将它们发送到 Elasticsearch/Kibana。

我似乎找不到一个插件来完成这个。有没有人试过这个并成功了?我不需要指标,只需要存储在 AWS Logs 中的日志。

Luk*_*ite 5

其他发帖人提到 CloudFormation 模板可以将您的日志流式传输到 Amazon Elasticsearch,但如果您想先通过 Logstash,这个 logstash 插件可能对您有用:

https://github.com/lukewaite/logstash-input-cloudwatch-logs/

此插件允许您将特定的 CloudWatch 日志组或一系列与前缀匹配的组提取到您的 Logstash 管道中,并按照您的意愿处理数据。它发布在 RubyGems 上,可以像普通的 Logstash 插件一样安装:bin/logstash-plugin install logstash-input-cloudwatch_logs.


Ste*_*pel 3

正如 BMW 已经指出的那样,AWS 刚刚推出了专用的CloudWatch Logs Subscription Consumer,它通过 resp 提供对完整 CloudWatch Logs + Elasticsearch + Kibana 堆栈的一键访问。AWS CloudFormation模板,如介绍性博客文章中进一步说明。

鉴于您似乎有一个现成的 ELK 堆栈,调整 AWS示例模板以定位您自己的端点应该不会太复杂。