简体   繁体   English

AWS Lambda - 可以用 Fluentd 代替 CloudWatch 吗?

[英]AWS Lambda - Fluentd instead of CloudWatch possible?

I want to move my logging for AWS Lambda from CloudWatch to Elasticsearch and Kibana, using Fluentd.我想使用 Fluentd 将 AWS Lambda 的日志记录从 CloudWatch 移动到 Elasticsearch 和 Kibana。 I understand that I need to use Lambda outputs as an input to Fluentd, which I already have set up.我知道我需要使用 Lambda 输出作为我已经设置好的 Fluentd 的输入。 All my Lambda functions are in Python.我所有的 Lambda 函数都在 Python 中。

Is it possible to capture Lambda output with Fluentd without additional plugins, ie using just tail?是否可以在没有其他插件的情况下使用 Fluentd 捕获 Lambda 输出,即仅使用尾部? I do not see any Lambda input plugin in the Fluentd list , only the output one.我在Fluentd 列表中没有看到任何 Lambda 输入插件,只有输出一个。 If not, is there any possible workaround, or do I have to write plugin specifically for this?如果没有,是否有任何可能的解决方法,还是我必须专门为此编写插件? Or would simply inserting data into Elasticsearch suffice, omitting Fluentd altogether?或者只是将数据插入 Elasticsearch 就足够了,完全忽略 Fluentd?

EDIT: to clarify, I want to get rid of CloudWatch, with no streaming to it at all.编辑:澄清一下,我想摆脱 CloudWatch,根本没有流式传输。

You won't be able to do it without additional 'plugins' but you can do it with a Lambda Extension.如果没有额外的“插件”,您将无法做到这一点,但您可以使用 Lambda 扩展来做到这一点。

This code sample gives you an example.此代码示例为您提供了一个示例。

https://github.com/aws-samples/aws-lambda-extensions/tree/main/python-example-elasticsearch-extension https://github.com/aws-samples/aws-lambda-extensions/tree/main/python-example-elasticsearch-extension

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

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