

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

# 将 Amazon Chime SDK 媒体管道事件发送至 CloudTrail
<a name="pipeline-cloudtrail"></a>

AWS 在您创建 AWS 账户时 CloudTrail 为您启用。当用户在媒体管道 SDK 中调用支持的 API 时，会在**事件历史 CloudTrail **记录中记录该 API 的活动以及其他 AWS 事件。您可以在 AWS 账户中查看、搜索和下载媒体管道事件。有关更多信息，请参阅《*CloudTrail 用户指南》*中的[使用 CloudTrail 事件历史记录查看事件](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html)。

要持续记录媒体管道事件，可创建*跟踪*。跟踪允许 CloudTrail 将日志文件传输到您的 Amazon S3 存储桶。以下示例显示媒体管道跟踪。数据包括调用 API 的用户、用于调用 API 的 IAM 角色和时间戳。有关使用的更多信息， CloudTrail 请参阅 *Amazon Chime SDK 管理员*指南中的[日志和监控](https://docs.aws.amazon.com/chime-sdk/latest/ag/monitoring-overview.html)。

```
{
   "Records": [    
   {
      "eventVersion": "1.08",
      "userIdentity": {
          "type": "AssumedRole",
          "principalId": "{{ABCDEFGHIJKLMNOPQRSTUV}}:{{user-name}}",
          "arn": "arn:aws:sts::{{123456789101}}:assumed-role/{{role-name}}/{{user-name}}",
          "accountId": "{{109876543210}}",
          "accessKeyId": "{{ABCDEFGHIJKLMNOPQRSTUV}}",
          "sessionContext": {
              "sessionIssuer": {
                  "type": "Role",
                  "principalId": "{{ABCDEFGHIJKLMNOPQRSTUV}}",
                  "arn": "arn:aws:iam::{{109876543210}}:role/{{role-name}}",
                  "accountId": "{{012345678910}}",
                  "userName": "{{user-name}}"
                  },
          "webIdFederationData": {},
          "attributes": {
              "mfaAuthenticated": "false",
              "creationDate": "{{2022-03-08T19:34:55Z}}"
              }
          }
      },
      "eventTime": "{{2022-03-08T20:28:41Z}}",
     "eventSource": "chime-sdk-media-pipelines.amazonaws.com",
     "eventName": "CreateMediaCapturePipeline",
     "awsRegion": "{{us-east-1}}",
     "sourceIPAddress": "{{127.0.0.1}}",
     "userAgent": "[]/[]",
     "requestParameters": {
         "sourceType": "ChimeSdkMeeting",
         "sourceArn": "{{Hidden_For_Security_Reasons}}",
         "sinkType": "S3Bucket",
         "sinkArn": "{{Hidden_For_Security_Reasons}}",
         "chimeSdkMeetingConfiguration": {
             "artifactsConfiguration": {
                 "audio": {
                    "muxType": "AudioOnly"
                 },
            "video": {
                "state": "Enabled",
                "muxType": "VideoOnly"
                },
            "content": {
                "state": "Enabled",
                "muxType": "ContentOnly"
                }
            }
        }
      },
     "responseElements": {
        "mediaCapturePipeline": {
        "mediaPipelineId": "{{pipeline-uuid}}",
        "sourceType": "ChimeSdkMeeting",
        "sourceArn": "{{Hidden_For_Security_Reasons}}",
        "status": "Initializing",
        "sinkType": "S3Bucket",
        "sinkArn": "{{Hidden_For_Security_Reasons}}",
        "createdTimestamp": "{{2022-03-08T20:28:41.336Z}}",
        "updatedTimestamp": "{{2022-03-08T20:28:41.463Z}}",
        "chimeSdkMeetingConfiguration": {
            "artifactsConfiguration": {
                "audio": {
                    "muxType": "AudioOnly"
                },
            "video": {
                "state": "Enabled",
                 "muxType": "VideoOnly"
                 },
             "content": {
                 "state": "Enabled",
                 "muxType": "ContentOnly"
                 }
              }
            }
          }
      },
      "requestID": "{{request-id}}",
      "eventID": "{{event-id}}",
     "readOnly": false,
      "eventType": "AwsApiCall",
      "managementEvent": true,
      "eventCategory": "Management",
      "recipientAccountId": "{{112233445566}}",
      "tlsDetails": {
          "tlsVersion": "TLSv1.2",
          "clientProvidedHostHeader": "{{example.com}}"
       }
    },  
  ]
}
```