本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
日誌 Amazon Kinesis Video Streams API 呼叫 AWS CloudTrail
Amazon Kinesis Video Streams 可與服務搭配使用者 AWS CloudTrail、角色或 Amazon Kinesis Video Streams AWS 服務 中所採取的動作記錄。 CloudTrail 以事件形式擷取 Amazon Kinesis Video Streams 的所有API呼叫。擷取的呼叫包括來自 Amazon Kinesis Video Streams 主控台的呼叫,以及對 Amazon Kinesis Video Streams API 操作的程式碼呼叫。如果您建立追蹤,您可以啟用持續交付 CloudTrail 事件到 Amazon S3 儲存貯體,包括 Amazon Kinesis Video Streams 的事件。如果您未設定追蹤,您仍然可以在 [事件歷程記錄] 中檢視 CloudTrail 主控台中最近的事件。使用收集的資訊 CloudTrail,您可以判斷向 Amazon Kinesis Video Streams 提出的請求、提出請求的來源 IP 地址、提出請求的人員、提出請求的時間以及其他詳細資訊。
若要進一步了解 CloudTrail,包括如何設定和啟用它,請參閱AWS CloudTrail 使用者指南。
Amazon Kinesis Video Streams 和 CloudTrail
CloudTrail 在您創建 AWS 帳戶時,您的帳戶已啟用。當 Amazon Kinesis Video Streams 中發生受支援的事件活動時,該活動會與事件歷史記錄中的其他 AWS 服務 CloudTrail 事件一起記錄在事件中。您可以在帳戶中查看,搜索和下載最近的事 AWS 件。如需詳細資訊,請參閱檢視具有事 CloudTrail 件記錄的事件。
如需 AWS 帳戶中持續記錄事件 (包括 Amazon Kinesis Video Streams 的事件),請建立追蹤。追蹤可 CloudTrail 將日誌檔交付到 Amazon S3 儲存貯體。依預設,當您在主控台中建立追蹤時,該追蹤會套用至所有的 AWS 區域。追蹤記錄來自 AWS 分區中所有區域的事件,並將日誌檔傳送到您指定的 Amazon S3 儲存貯體。此外,您可以設定其他, AWS 服務 以進一步分析 CloudTrail 記錄中收集的事件資料並採取行動。如需詳細資訊,請參閱下列內容:
Amazon Kinesis Video Streams 支援將下列動作記錄為記 CloudTrail 錄檔中的事件:
每一筆事件或日誌專案都會包含產生請求者的資訊。身分資訊可協助您判斷下列事項:
-
該請求是否使用根或 使用者登入資料提出
-
提出該請求時,是否使用了特定角色或聯合身分使用者的臨時安全憑證
-
該請求是否由另一項 AWS 服務服務提出。
如需詳細資訊,請參閱CloudTrail userIdentity 元素。
範例:Amazon Kinesis Video Streams 日誌檔項目
追蹤是一種組態,可讓事件以日誌檔的形式傳遞到您指定的 Amazon S3 儲存貯體。 CloudTrail 記錄檔包含一或多個記錄項目。一個事件為任何來源提出的單一請求,並包含請求動作、請求的日期和時間、請求參數等資訊。 CloudTrail 日誌文件不是公共API調用的有序堆棧跟踪,因此它們不會以任何特定順序顯示。
下列範例顯示示範CreateStream動作的 CloudTrail 記錄項目。
{
"Records": [
{
"eventVersion": "1.05",
"userIdentity": {
"type": "IAMUser",
"principalId": "EX_PRINCIPAL_ID",
"arn": "arn:aws:iam::123456789012:user/Alice",
"accountId": "123456789012",
"accessKeyId": "EXAMPLE_KEY_ID",
"userName": "Alice"
},
"eventTime": "2018-05-25T00:16:31Z",
"eventSource": " kinesisvideo.amazonaws.com",
"eventName": "CreateStream",
"awsRegion": "us-east-1",
"sourceIPAddress": "127.0.0.1",
"userAgent": "aws-sdk-java/unknown-version Linux/x.xx",
"requestParameters": {
"streamName": "VideoStream",
"dataRetentionInHours": 2,
"mediaType": "mediaType",
"kmsKeyId": "arn:aws:kms::us-east-1:123456789012:alias",
"deviceName": "my-device"
},
"responseElements": {
"streamARN":arn:aws:kinesisvideo:us-east-1:123456789012:stream/VideoStream/12345"
},
"requestID": "db6c59f8-c757-11e3-bc3b-57923b443c1c",
"eventID": "b7acfcd0-6ca9-4ee1-a3d7-c4e8d420d99b"
},
{
"eventVersion": "1.05",
"userIdentity": {
"type": "IAMUser",
"principalId": "EX_PRINCIPAL_ID",
"arn": "arn:aws:iam::123456789012:user/Alice",
"accountId": "123456789012",
"accessKeyId": "EXAMPLE_KEY_ID",
"userName": "Alice"
},
"eventTime": "2018-05-25:17:06Z",
"eventSource": " kinesisvideo.amazonaws.com",
"eventName": "DeleteStream",
"awsRegion": "us-east-1",
"sourceIPAddress": "127.0.0.1",
"userAgent": "aws-sdk-java/unknown-version Linux/x.xx",
"requestParameters": {
"streamARN": "arn:aws:kinesisvideo:us-east-1:012345678910:stream/VideoStream/12345",
"currentVersion": "keqrjeqkj9"
},
"responseElements": null,
"requestID": "f0944d86-c757-11e3-b4ae-25654b1d3136",
"eventID": "0b2f1396-88af-4561-b16f-398f8eaea596"
},
{
"eventVersion": "1.05",
"userIdentity": {
"type": "IAMUser",
"principalId": "EX_PRINCIPAL_ID",
"arn": "arn:aws:iam::123456789012:user/Alice",
"accountId": "123456789012",
"accessKeyId": "EXAMPLE_KEY_ID",
"userName": "Alice"
},
"eventTime": "2014-04-19T00:15:02Z",
"eventSource": " kinesisvideo.amazonaws.com",
"eventName": "DescribeStream",
"awsRegion": "us-east-1",
"sourceIPAddress": "127.0.0.1",
"userAgent": "aws-sdk-java/unknown-version Linux/x.xx",
"requestParameters": {
"streamName": "VideoStream"
},
"responseElements": null,
"requestID": "a68541ca-c757-11e3-901b-cbcfe5b3677a",
"eventID": "22a5fb8f-4e61-4bee-a8ad-3b72046b4c4d"
},
{
"eventVersion": "1.05",
"userIdentity": {
"type": "IAMUser",
"principalId": "EX_PRINCIPAL_ID",
"arn": "arn:aws:iam::123456789012:user/Alice",
"accountId": "123456789012",
"accessKeyId": "EXAMPLE_KEY_ID",
"userName": "Alice"
},
"eventTime": "2014-04-19T00:15:03Z",
"eventSource": "kinesisvideo.amazonaws.com",
"eventName": "GetDataEndpoint",
"awsRegion": "us-east-1",
"sourceIPAddress": "127.0.0.1",
"userAgent": "aws-sdk-java/unknown-version Linux/x.xx",
"requestParameters": {
"streamName": "VideoStream",
"aPIName": "LIST_FRAGMENTS"
"
},
"responseElements": null,
"requestID": "a6e6e9cd-c757-11e3-901b-cbcfe5b3677a",
"eventID": "dcd2126f-c8d2-4186-b32a-192dd48d7e33"
},
{
"eventVersion": "1.05",
"userIdentity": {
"type": "IAMUser",
"principalId": "EX_PRINCIPAL_ID",
"arn": "arn:aws:iam::123456789012:user/Alice",
"accountId": "123456789012",
"accessKeyId": "EXAMPLE_KEY_ID",
"userName": "Alice"
},
"eventTime": "2018-05-25T00:16:56Z",
"eventSource": "kinesisvideo.amazonaws.com",
"eventName": "ListStreams",
"awsRegion": "us-east-1",
"sourceIPAddress": "127.0.0.1",
"userAgent": "aws-sdk-java/unknown-version Linux/x.xx",
"requestParameters": {
"maxResults": 100,
"streamNameCondition": {"comparisonValue":"MyVideoStream" comparisonOperator":"BEGINS_WITH"}}
},
"responseElements": null,
"requestID": "e9f9c8eb-c757-11e3-bf1d-6948db3cd570",
"eventID": "77cf0d06-ce90-42da-9576-71986fec411f"
}
]
}