在服务索引中 OpenSearch 存储和格式化 Amazon SNS 通知 - Amazon Simple Notification Service
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

在服务索引中 OpenSearch 存储和格式化 Amazon SNS 通知

以下示例演示了向名为的亚马逊 OpenSearch 服务(OpenSearch 服务)索引发送的 Amazon SNS 通知。my-index此索引在 Timestamp 字段中具有时间筛选字段。SNS 通知放置在负载的 _source 属性中。

注意

在此示例中,已发布消息的原始消息传输被禁用。禁用原始邮件传输时,Amazon SNS 会将 JSON 元数据添加到消息中,其中包括以下属性:

  • Type

  • MessageId

  • TopicArn

  • Subject

  • Timestamp

  • UnsubscribeURL

  • MessageAttributes

有关原始消息传输的更多信息,请参阅 Amazon SNS 原始消息传输

{ "_index": "my-index", "_type": "_doc", "_id": "49613100963111323203250405402193283794773886550985932802.0", "_version": 1, "_score": null, "_source": { "Type": "Notification", "MessageId": "bf32e294-46e3-5dd5-a6b3-bad65162e136", "TopicArn": "arn:aws:sns:us-east-1:111111111111:my-topic", "Subject": "Sample subject", "Message": "Sample message", "Timestamp": "2020-12-02T22:29:21.189Z", "UnsubscribeURL": "https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1:111111111111:my-topic:b5aa9bc1-9c3d-452b-b402-aca2cefc63c9", "MessageAttributes": { "my_attribute": { "Type": "String", "Value": "my_value" } } }, "fields": { "Timestamp": [ "2020-12-02T22:29:21.189Z" ] }, "sort": [ 1606948161189 ] }