无法将日志从 kinesis firehose 发送到 opensearch

发布于 2025-01-11 05:23:23 字数 449 浏览 0 评论 0 原文

我有一个工作流程,其中:

  • 所有 cloudwatch 日志都将流式传输到 Kinesis Firehose Delivery Stream。
  • 它将从 Kinesis Firehose Delivery Stream 发送到 Opensearch。

但是,Kinesis 无法将数据放入 opensearch 并返回错误

The Amazon OpenSearch Service cluster returned a JsonParseException. Ensure that the data being put is valid.

我也尝试了Firehose 的所有可用 Lambda 蓝图来转换记录,但没有成功。

任何建议表示赞赏。

谢谢。

I have a workflow, where:

  • All cloudwatch logs will be streamed to Kinesis Firehose Delivery Stream.
  • From Kinesis Firehose Delivery Stream, it will be sent to Opensearch.

However, Kinesis is failed to put data to opensearch and returning the error:

The Amazon OpenSearch Service cluster returned a JsonParseException. Ensure that the data being put is valid.

I have tried all available Lambda blueprints for firehose to transform records as well, but no luck.

Any suggestions are appreciated.

Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

来日方长 2025-01-18 05:23:23

我提出了 AWS 票证并得到了此回复

据我所知,您正在实施以下数据流:

记录器 Lambda--> Cloudwatch日志组-->消防水带(拉姆达
转型)-->流式传输到 Opensearch

您遇到来自 OpenSearch 服务的以下错误消息:

-- 错误消息:Amazon OpenSearch Service 集群返回了 JsonParseException。确保数据被放入
是有效的。错误代码:OS.JsonParseException

根据错误消息,它表明数据正在发送到
OpenSearch 集群不是有效的 JSON 对象。 Cloudwatch 日志组
将针对 firehose 在一条记录中发送多个日志,结果是
发送到 OpenSearch 集群的 JSON 无效,因为 OpenSearch
仅接受单个 JSON 对象作为数据格式。同时,
Firehose 不允许传回的记录多于已传递的记录
到它的转换 Lambda 函数。因此,不可能
使用当前管道。

AWS 支持

  1. CloudWatch Logs 建议的解决方法 -> Kinesis 数据流 ->拉姆达->消防水带 -> OpenSearch
  2. CloudWatch 日志 ->拉姆达->消防水带 -> OpenSearch
  3. CloudWatch 日志(订阅过滤器)-> OpenSearch

我想知道您对此的想法。

I raised an AWS ticket and got this reply

I understand that you are implementing the below data flow:

Logger Lambda--> Cloudwatch log group--> Firehose (Lambda
transformation) --> Streaming to Opensearch

you encountered the below error message from OpenSearch services:

-- Error Message: The Amazon OpenSearch Service cluster returned a JsonParseException. Ensure that the data being put
is valid. Error Code: OS.JsonParseException

As per the error message, it indicated the data being sent to the
OpenSearch cluster is not a valid JSON object. Cloudwatch log group
will send multiple logs in one record against firehose, which resulted
invalid JSON being sent to the OpenSearch cluster, because OpenSearch
only accepts single JSON object as the data format. Meanwhile,
Firehose does not allow passing back more records than what was passed
to its transformation Lambda function. Therefore, it is not possible
to use the current pipeline.

Suggested workarounds by AWS support

  1. CloudWatch Logs -> Kinesis Data Stream -> Lambda -> Firehose -> OpenSearch
  2. CloudWatch logs -> Lambda -> Firehose -> OpenSearch
  3. CloudWatch logs (subscription filter) -> OpenSearch

I would like to know your thoughts on this.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文