

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 監控和記錄 AWS 支援
<a name="monitoring-overview"></a>

監控是維護 支援 及其他 AWS 解決方案的可靠性、可用性和效能的重要部分。 AWS 提供下列監控工具，讓您監看 支援、回報錯誤，並適時採取自動動作：
+ *Amazon EventBridge* 提供近乎即時的系統事件串流，描述 AWS 資源的變更。EventBridge 可啟用自動事件驅動運算，因為您可以撰寫規則來監控特定事件，並在發生這些事件 AWS 時觸發其他服務中的自動動作。如需詳細資訊，請參閱[「Amazon EventBridge 使用者指南」](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is.html)。
+ *AWS CloudTrail* 會擷取您 AWS 帳戶或代表您的帳戶發出的 API 呼叫和相關事件，並將日誌檔案交付至您指定的 Amazon S3 儲存貯體。您可以識別呼叫的使用者和帳戶 AWS、進行呼叫的來源 IP 地址，以及呼叫的時間。如需詳細資訊，請參閱「[AWS CloudTrail 使用者指南](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/)」。

**Topics**
+ [使用 Amazon EventBridge 整合 AWS 支援 到事件驅動型應用程式](eventbridge-integration.md)
+ [使用 記錄 AWS 支援 API 呼叫 AWS CloudTrail](logging-using-cloudtrail.md)
+ [使用 在 Slack API 呼叫中記錄 AWS 支援 應用程式 AWS CloudTrail](logging-using-cloudtrail-support-app.md)

# 使用 Amazon EventBridge 整合 AWS 支援 到事件驅動型應用程式
<a name="eventbridge-integration"></a>

您可以將 AWS 支援 納入事件驅動型應用程式 (EDAs)，該應用程式使用 中發生的事件 AWS 支援 ，在應用程式元件之間進行通訊並啟動下游程序。

例如，當您的帳戶發生下列 AWS 支援 事件時，您會收到通知：
+ 建立、解決或重新開啟支援案例
+ 通訊會新增至現有的支援案例

您可以使用 Amazon EventBridge 將事件從 路由 AWS 支援 到其他軟體元件來執行此操作。Amazon EventBridge 是一種無伺服器服務，使用事件將應用程式元件連接在一起，讓您更輕鬆地將 等 AWS 服務整合 AWS 支援 到事件驅動型架構中，而無需額外的程式碼和操作。

## EventBridge 如何路由 AWS 支援 事件
<a name="eventbridge-routes-service-events-aws.support"></a>

以下是 EventBridge 使用 AWS 支援 事件的方式：

如同許多 AWS 服務， AWS 支援 會產生事件並將其傳送至 EventBridge 預設*事件匯流排*。事件匯流排是接收事件並將其路由至您指定目的地或*目標*的路由器。目標可以包含其他服務 AWS 、自訂應用程式和 SaaS 合作夥伴應用程式。

EventBridge 會根據您在事件匯流排上建立的*規則*路由事件。對於每個規則，您可以指定篩選條件或*事件模式*，以僅選取您想要的事件。每當事件傳送到事件匯流排時，EventBridge 都會將其與每個規則進行比較。如果事件符合規則，EventBridge 會將事件路由到指定的目標 (s)。

![\[AWS 服務會將事件傳送至 EventBridge 預設事件匯流排。如果事件符合規則的事件模式，EventBridge 會將事件路由至該規則指定的目標。\]](http://docs.aws.amazon.com/zh_tw/awssupport/latest/user/images/eventbridge-integration-how-it-works.png)


## AWS 支援 事件
<a name="supported-events"></a>

AWS 支援 會自動將下列事件傳送至預設 EventBridge 事件匯流排。


| 事件詳細資訊類型 | Description | 
| --- | --- | 
|  [支援案例更新](event-detail-support-case-update.md)  |  代表支援案例中的變更。  | 

### 事件結構
<a name="eventbridge-event-structure"></a>

 AWS 服務中的所有事件都包含兩種類型的資料：
+ 包含事件中繼資料的常見欄位集，例如事件來源 AWS 的服務、產生事件的時間、事件發生的帳戶和區域，以及其他。如需這些一般欄位的定義，請參閱《*Amazon EventBridge Events Reference*》中的事件[結構](https://docs.aws.amazon.com/eventbridge/latest/ref/overiew-event-structure.html)。
+ 包含該特定服務事件特定資料`detail`的欄位。

### AWS 支援 透過 交付事件 AWS CloudTrail
<a name="eventbridge-events-via-cloudtrail"></a>

AWS 服務可以直接將事件傳送到 EventBridge 預設事件匯流排。此外， 也會 AWS CloudTrail 將來自許多 AWS 服務的事件傳送至 EventBridge。這些事件可能包括 API 呼叫、主控台登入和動作、服務事件和 CloudTrail Insights。如需詳細資訊，請參閱*EventBridge 使用者指南*》中的[AWS 透過 傳遞的服務事件 AWS CloudTrail](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event-cloudtrail.html)。

如需傳送至 EventBridge AWS 支援 的事件清單，請參閱 [https://docs.aws.amazon.com/eventbridge/latest/ref/welcome.html](https://docs.aws.amazon.com/eventbridge/latest/ref/welcome.html) 中的 AWS 支援 主題。

## 建立符合事件 AWS 支援 的事件模式
<a name="eventbridge-event-delivery-filter"></a>

事件模式是篩選條件，其中指定您要選取之事件應有的資料。

每個事件模式都是 JSON 物件，它包含：
+ 識別傳送事件之服務的 `source` 屬性。對於 AWS 支援 事件，來源為 `aws.support`。
+ （選用）：包含要比對之事件名稱陣列的`detail-type`屬性。
+ (選擇性)：包含要比對的任何其他事件資料的 `detail` 屬性。

例如，下列事件模式會從 選取所有支援案例更新事件 AWS 支援：

```
{
  "source": ["aws.support"],
  "detail-type": ["Support Case Update"]
}
```

您可以透過在事件本身中包含值，在事件選擇中取得更具體的內容。例如，下列事件模式符合代表要重新開啟之案例的支援案例更新事件：

```
{
  "source": ["aws.support"],
  "detail-type": ["Support Case Update"],
  "detail": {
      "event-name": "ReopenCase"
    }
}
```

如需撰寫事件模式的詳細資訊，請參閱《*EventBridge 使用者指南*》中的事件[模式](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html)。

### 另請參閱
<a name="see-also-eventbridge-support"></a>

如需如何使用 EventBridge 搭配 的詳細資訊 AWS 支援，請參閱下列資源：
+ [如何使用 Amazon EventBridge 自動化 AWS 支援 API](https://aws.amazon.com/blogs/mt/how-to-automate-aws-support-api-with-amazon-eventbridge)
+ GitHub 上的[AWS 支援 案例活動通知程式](https://github.com/aws-samples/aws-support-case-activity-notifier) 

# 支援案例更新事件
<a name="event-detail-support-case-update"></a>

以下是`Support Case Update`事件的詳細資訊欄位。

以下包含 `source`和 `detail-type` 欄位，因為它們包含 AWS 支援 事件的特定值。如需所有事件中包含的其他中繼資料欄位的定義，請參閱《*Amazon EventBridge 事件參考*》中的[事件結構](https://docs.aws.amazon.com/eventbridge/latest/ref/overiew-event-structure.html)。

```
{
  . . .,
  "detail-type": "Support Case Update",
  "source": "aws.support",
  . . .,
  "detail": {
    "case-id" : "string",
    "display-id" : "string",
    "communication-id" : "string",
    "event-name" : "string",
    "origin" : "string"
  }
}
```

`detail-type`  <a name="support-case-update-detail-type"></a>
識別事件的類型。  
對於此事件，此值為 `Support Case Update`。

`source`  <a name="support-case-update-source"></a>
識別產生事件的服務。對於 AWS 支援 事件，此值為 `aws.support`。

`detail`  <a name="support-case-update-detail"></a>
包含事件相關資訊的 JSON 物件。產生事件的服務會決定此欄位的內容。  
對於此事件，此資料包含：    
`case-id`  <a name="support-case-update-case-id"></a>
支援案例 ID。案例 ID 是以下格式的英數字串：case-*12345678910-2013-c4c1d2bf33c5cf47*。  
`display-id`  <a name="support-case-update-display-id"></a>
 AWS 支援 中心頁面上案例的識別符。  
`communication-id`  <a name="support-case-update-communication-id"></a>
通訊 ID。  
`event-name`  <a name="support-case-update-event-name"></a>
*有效值*：`CreateCase` \$1 `AddCommunicationToCase` \$1 `ResolveCase` \$1 `ReopenCase`  
指定支援案例事件的類型。  
`origin`  <a name="support-case-update-origin"></a>
*有效值*：`AWS` \$1 `CUSTOMER`  
指定您或 AWS 支援 客服人員是否將案例通訊新增至支援案例。  
目前，只有具有 `event-name`的 事件`AddCommunicationToCase`才會包含此值。

**Example 支援案例更新事件範例：已建立支援案例**  <a name="event-detail-support-case-update.example-1"></a>

```
{
    "version": "0",
    "id": "3433df007-9285-55a3-f6d1-536944be45d7",
    "detail-type": "Support Case Update",
    "source": "aws.support",
    "account": "111122223333",
    "time": "2022-02-21T15:51:19Z",
    "region": "us-east-1",
    "resources": [],
    "detail": {
        "case-id": "case-111122223333-muen-2022-7118885805350839",
        "display-id": "1234563851",
        "communication-id": "",
        "event-name": "CreateCase",
        "origin": ""
    }
}
```

**Example 支援案例更新事件範例：支援案例的 AWS 支援 回應**  <a name="event-detail-support-case-update.example-2"></a>

```
{
    "version": "0",
    "id": "f90cb8cb-32be-1c91-c0ba-d50b4ca5e51b",
    "detail-type": "Support Case Update",
    "source": "aws.support",
    "account": "111122223333",
    "time": "2022-02-21T15:51:31Z",
    "region": "us-east-1",
    "resources": [],
    "detail": {
        "case-id": "case-111122223333-muen-2022-7118885805350839",
        "display-id": "1234563851",
        "communication-id": "ekko:us-east-1:12345678-268a-424b-be08-54613cab84d2",
        "event-name": "AddCommunicationToCase",
        "origin": "AWS"
    }
}
```

**Example 支援案例更新事件範例：支援案例已解決**  <a name="event-detail-support-case-update.example-3"></a>

```
{
    "version": "0",
    "id": "1aa4458d-556f-732e-ddc1-4a5b2fbd14a5",
    "detail-type": "Support Case Update",
    "source": "aws.support",
    "account": "111122223333",
    "time": "2022-02-21T15:51:31Z",
    "region": "us-east-1",
    "resources": [],
    "detail": {
        "case-id": "case-111122223333-muen-2022-7118885805350839",
        "display-id": "1234563851",
        "communication-id": "",
        "event-name": "ResolveCase",
        "origin": ""
    }
}
```

**Example 支援案例更新事件範例：已重新開啟支援案例**  <a name="event-detail-support-case-update.example-4"></a>

```
{
    "version": "0",
    "id": "3bb9d8fe-6089-ad27-9508-804209b233ad",
    "detail-type": "Support Case Update",
    "source": "aws.support",
    "account": "111122223333",
    "time": "2022-02-21T15:47:19Z",
    "region": "us-east-1",
    "resources": [],
    "detail": {
        "case-id": "case-111122223333-muen-2021-27f40618fe0303ea",
        "display-id": "1234563851",
        "communication-id": "",
        "event-name": "ReopenCase",
        "origin": ""
    }
}
```

# 使用 記錄 AWS 支援 API 呼叫 AWS CloudTrail
<a name="logging-using-cloudtrail"></a>

AWS 支援 已與 服務整合 AWS CloudTrail，此服務可提供使用者、角色或 AWS 服務在其中採取之動作的記錄 AWS 支援。CloudTrail 會將 的 API 呼叫擷取 AWS 支援 為事件。擷取的呼叫包括來自 AWS 支援 主控台的呼叫，以及對 AWS 支援 API 操作的程式碼呼叫。

如果您建立追蹤，您可以將 CloudTrail 事件持續交付至 Amazon Simple Storage Service (Amazon S3) 儲存貯體，包括 的事件 AWS 支援。即使您未設定追蹤，依然可以透過 CloudTrail 主控台中的 **Event history (事件歷史記錄)** 檢視最新事件。

您可以利用 CloudTrail 所收集的資訊來判斷向 AWS 支援發出的請求，以及發出請求的 IP 地址、人員、時間和其他詳細資訊。

若要進一步了解 CloudTrail，包括如何設定及啟用，請參閱《[AWS CloudTrail 使用者指南](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/)》。

## AWS 支援 CloudTrail 中的資訊
<a name="aws-support-info-in-cloudtrail-history"></a>

當您建立 AWS 帳戶時，會在您的帳戶上啟用 CloudTrail。在 中發生支援的事件活動時 AWS 支援，該活動會與**事件歷史記錄**中的其他服務 AWS 事件一起記錄在 CloudTrail 事件中。您可以在 AWS 帳戶中檢視、搜尋和下載最近的事件。如需詳細資訊，請參閱[使用 CloudTrail 事件歷史記錄檢視事件](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html)。

若要持續記錄您 AWS 帳戶中的事件，包括 的事件 AWS 支援，請建立*追蹤*。線索能讓 CloudTrail 將日誌檔案交付至 Amazon S3 儲存貯體。根據預設，當您在主控台建立線索時，線索會套用到所有 AWS 區域。線索會記錄 AWS 分割區中所有區域的事件，並將日誌檔案交付至您指定的 Amazon S3 儲存貯體。此外，您可以設定其他 AWS 服務，以進一步分析和處理 CloudTrail 日誌中所收集的事件資料。如需詳細資訊，請參閱下列內容：
+ [建立追蹤的概觀](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-create-and-update-a-trail.html)
+ [CloudTrail 支援的服務和整合](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-aws-service-specific-topics.html#cloudtrail-aws-service-specific-topics-integrations)
+ [設定 CloudTrail 的 Amazon SNS 通知](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/getting_notifications_top_level.html)
+ [接收多個區域的 CloudTrail 日誌檔案](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/receive-cloudtrail-log-files-from-multiple-regions.html)及[接收多個帳戶的 CloudTrail 日誌檔案](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-receive-logs-from-multiple-accounts.html)

CloudTrail 會記錄所有 AWS 支援 API 操作，並記錄在 [AWS 支援 API 參考](https://docs.aws.amazon.com/awssupport/latest/APIReference/)中。

例如，對 `CreateCase`、`DescribeCases` 和 `ResolveCase` 作業的呼叫都會在 CloudTrail 日誌檔案中產生項目。

每一筆事件或日誌專案都會包含產生請求者的資訊。身分資訊可協助您判斷下列事項：
+ 是否使用根或 AWS Identity and Access Management (IAM) 使用者登入資料提出請求。
+ 提出該請求時，是否使用了特定角色或聯合身分使用者的暫時安全憑證。
+ 請求是否由其他 AWS 服務提出。

如需詳細資訊，請參閱 [CloudTrail userIdentity 元素](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference-user-identity.html)。

您也可以將多個 AWS 區域和多個 AWS 帳戶的 AWS 支援 日誌檔案彙整至單一 Amazon S3 儲存貯體。

## AWS Trusted Advisor CloudTrail 日誌中的資訊
<a name="cloudtrail-logging-for-trusted-advisor"></a>

Trusted Advisor 是一項 AWS 支援 服務，可用來檢查 AWS 您的帳戶是否有節省成本、改善安全性和最佳化帳戶的方法。

CloudTrail 會記錄所有 Trusted Advisor API 操作，並記錄在 [AWS 支援 API 參考](https://docs.aws.amazon.com/awssupport/latest/APIReference/)中。

例如，對 `DescribeTrustedAdvisorCheckRefreshStatuses`、`DescribeTrustedAdvisorCheckResult` 和 `RefreshTrustedAdvisorCheck` 作業的呼叫都會在 CloudTrail 日誌檔案中產生項目。

**注意**  
CloudTrail 也會記錄 Trusted Advisor 主控台動作。請參閱 [使用 記錄 AWS Trusted Advisor 主控台動作 AWS CloudTrail](logging-using-cloudtrail-for-aws-trusted-advisor.md)。

## 了解 AWS 支援 日誌檔案項目
<a name="understanding-aws-support-entries"></a>

追蹤是一種組態，能讓事件以日誌檔案的形式交付到您指定的 Amazon S3 儲存貯體。CloudTrail 日誌檔案包含一個或多個日誌項目。事件代表來自任何來源的單一請求。其中包含請求的作業、作業日期和時間、請求參數等相關資訊。CloudTrail 日誌檔並非依公有 API 呼叫的堆疊追蹤排序，因此不會以任何特定順序出現。

**Example ：CreateCase 的日誌項目**  
以下範例顯示 [CreateCase](https://docs.aws.amazon.com/awssupport/latest/APIReference/API_CreateCase.html) 作業的 CloudTrail 日誌項目。  

```
{
   "Records": [
      {
         "eventVersion": "1.04",
         "userIdentity": {
            "type": "IAMUser",
            "principalId": "AIDACKCEVSQ6C2EXAMPLE",
            "arn": "arn:aws:iam::111122223333:user/janedoe",
            "accountId": "111122223333",
            "accessKeyId": "AKIAIOSFODNN7EXAMPLE",
            "userName": "janedoe",
            "sessionContext": {
               "attributes": {
                  "mfaAuthenticated": "false",
                  "creationDate": "2016-04-13T17:51:37Z"
               }
            },
            "invokedBy": "signin.amazonaws.com"
         },
         "eventTime": "2016-04-13T18:05:53Z",
         "eventSource": "support.amazonaws.com",
         "eventName": "CreateCase",
         "awsRegion": "us-east-1",
         "sourceIPAddress": "198.51.100.15",
         "userAgent": "signin.amazonaws.com",
         "requestParameters": {
            "severityCode": "low",
            "categoryCode": "other",
            "language": "en",
            "serviceCode": "support-api",
            "issueType": "technical"
         },
         "responseElements": {
            "caseId": "case-111122223333-muen-2016-c3f2077e504940f2"
         },
         "requestID": "58c257ef-01a2-11e6-be2a-01c031063738",
         "eventID": "5aa34bfc-ad5b-4fb1-8a55-2277c86e746a",
         "eventType": "AwsApiCall",
         "recipientAccountId": "111122223333"
      }
   ],
   ...
}
```

**Example ：RefreshTrustedAdvisorCheck 的日誌項目**  
以下範例顯示 [RefreshTrustedAdvisorCheck](https://docs.aws.amazon.com/awssupport/latest/APIReference/API_RefreshTrustedAdvisorCheck.html) 作業的 CloudTrail 日誌項目。  

```
{
    "eventVersion": "1.05",
    "userIdentity": {
        "type": "IAMUser",
        "principalId": "AIDACKCEVSQ6C2EXAMPLE",
        "arn": "arn:aws:iam::111122223333:user/Admin",
        "accountId": "111122223333",
        "accessKeyId": "AKIAIOSFODNN7EXAMPLE",
        "userName": "Admin"
    },
    "eventTime": "2020-10-21T16:34:13Z",
    "eventSource": "support.amazonaws.com",
    "eventName": "RefreshTrustedAdvisorCheck",
    "awsRegion": "us-east-1",
    "sourceIPAddress": "72.21.198.67",
    "userAgent": "signin.amazonaws.com",
    "requestParameters": {
        "checkId": "Pfx0RwqBli"
    },
    "responseElements": null,
    "requestID": "4c4d5fc8-c403-4f82-9544-41f820e0fa01",
    "eventID": "2f4630ac-5c27-4f0d-b93f-63742d6fc85e",
    "eventType": "AwsApiCall",
    "recipientAccountId": "111122223333"
}
```

# 使用 在 Slack API 呼叫中記錄 AWS 支援 應用程式 AWS CloudTrail
<a name="logging-using-cloudtrail-support-app"></a>

Slack 中的 AWS 支援 應用程式已與 整合 AWS CloudTrail。CloudTrail 會在 AWS 服務 AWS 支援 應用程式中提供使用者、角色或 所採取動作的記錄。為了建立此記錄，CloudTrail 會將 AWS 支援 應用程式的所有公有 API 呼叫擷取為事件。這些擷取的呼叫包括來自 AWS 支援 應用程式主控台的呼叫，以及對 AWS 支援 應用程式公有 API 操作的程式碼呼叫。若您建立追蹤，便可將 CloudTrail 事件持續交付至 Amazon S3 儲存貯體，包括 的事件。這些包括 AWS 支援 應用程式的事件。即使您未設定追蹤，依然可以透過 CloudTrail 主控台中的**事件歷史記錄**檢視最新事件。您可以使用 CloudTrail 收集的資訊來判斷對 AWS 支援 應用程式提出的請求。您還可以瞭解發起呼叫的 IP 地址、提出請求的人員和時間以及其他詳細資訊。

若要進一步了解 CloudTrail，請參閱[「AWS CloudTrail 使用者指南」](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-user-guide.html)。

## AWS 支援 CloudTrail 中的應用程式資訊
<a name="service-name-info-in-cloudtrail-support-app"></a>

當您建立 時 AWS 帳戶，這會在帳戶上啟用 CloudTrail。當 AWS 支援 應用程式發生公有 API 活動時，該活動會記錄在 CloudTrail 事件中，以及**事件歷史記錄**中的其他 AWS 服務事件。您可以在 中檢視、搜尋和下載最近的事件 AWS 帳戶。如需詳細資訊，請參閱[「使用 CloudTrail 事件歷史記錄檢視事件」](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html)。

若要持續記錄 中的事件 AWS 帳戶，包括 AWS 支援 應用程式的事件，請建立*追蹤*。依預設，當您在主控台中建立追蹤時，該追蹤會套用至所有的 AWS 區域。該追蹤會記錄來自 AWS 分割區中所有區域的事件，並將日誌檔案交付到您指定的 Amazon S3 儲存貯體。此外，您可以設定其他 AWS 服務 進一步分析 CloudTrail 日誌中收集的事件資料，並對資料採取行動。如需詳細資訊，請參閱下列內容：
+ [建立追蹤的概觀](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-create-and-update-a-trail.html)
+ [CloudTrail 支援的服務和整合](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-aws-service-specific-topics.html)
+ [設定 CloudTrail 的 Amazon SNS 通知](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/configure-sns-notifications-for-cloudtrail.html)
+ [接收多個區域的 CloudTrail 日誌檔案](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/receive-cloudtrail-log-files-from-multiple-regions.html)和[接收多個帳戶的 CloudTrail 日誌檔案](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-receive-logs-from-multiple-accounts.html)

CloudTrail 會記錄所有公有 AWS 支援 應用程式動作。這些動作也記錄在 [Slack API 參考的AWS 支援 應用程式](https://docs.aws.amazon.com/supportapp/latest/APIReference/Welcome.html)中。例如，對 `CreateSlackChannelConfiguration`、`GetAccountAlias` 和 `UpdateSlackChannelConfiguration` 動作發出的呼叫會在 CloudTrail 記錄檔案中產生專案。

每一筆事件或日誌專案都會包含產生請求者的資訊。身分資訊可協助您判斷下列事項：
+ 是否使用根或 AWS Identity and Access Management (IAM) 使用者登入資料提出請求。
+ 提出該請求時，是否使用了特定角色或聯合身分使用者的暫時安全憑證。
+ 該請求是否由另一項 AWS 服務服務提出。

如需詳細資訊，請參閱 [CloudTrail userIdentity 元素](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference-user-identity.html)。

## 了解 AWS 支援 應用程式日誌檔案項目
<a name="understanding-service-name-entries-support-app"></a>

追蹤是一種組態，能讓事件以日誌檔案的形式交付到您指定的 Amazon S3 儲存貯體。CloudTrail 日誌檔案包含一或多個日誌專案。一個事件為任何來源提出的單一請求，並包含請求動作、請求的日期和時間、請求參數等資訊。CloudTrail 日誌檔案並不是公有 API 呼叫的有序堆疊追蹤。這意味著日誌不會以任何特定順序顯示。

**Example ：`CreateSlackChannelConfiguration` 的日誌範例**  
以下範例顯示 [CreateSlackChannelConfiguration](https://docs.aws.amazon.com/supportapp/latest/APIReference/API_CreateSlackChannelConfiguration.html) 操作的 CloudTrail 日誌項目。  

```
{
    "eventVersion": "1.08",
    "userIdentity": {
        "type": "AssumedRole",
        "principalId": "AIDACKCEVSQ6C2EXAMPLE:JaneDoe",
        "arn": "arn:aws:sts::111122223333:assumed-role/Administrator/JaneDoe",
        "accountId": "111122223333",
        "accessKeyId": "AKIAI44QH8DHBEXAMPLE",
        "sessionContext": {
            "sessionIssuer": {
                "type": "Role",
                "principalId": "AIDACKCEVSQ6C2EXAMPLE",
                "arn": "arn:aws:iam::111122223333:role/Administrator",
                "accountId": "111122223333",
                "userName": "Administrator"
            },
            "webIdFederationData": {},
            "attributes": {
                "creationDate": "2022-02-26T01:37:57Z",
                "mfaAuthenticated": "false"
            }
        }
    },
    "eventTime": "2022-02-26T01:48:20Z",
    "eventSource": "supportapp.amazonaws.com",
    "eventName": "CreateSlackChannelConfiguration",
    "awsRegion": "us-east-1",
    "sourceIPAddress": "205.251.233.183",
    "userAgent": "aws-cli/1.3.23 Python/2.7.6 Linux/2.6.18-164.el5",
    "requestParameters": {
        "notifyOnCreateOrReopenCase": true,
        "teamId": "T012ABCDEFG",
        "notifyOnAddCorrespondenceToCase": true,
        "notifyOnCaseSeverity": "all",
        "channelName": "troubleshooting-channel",
        "notifyOnResolveCase": true,
        "channelId": "C01234A5BCD",
        "channelRoleArn": "arn:aws:iam::111122223333:role/AWSSupportAppRole"
    },
    "responseElements": null,
    "requestID": "d06df6ca-c233-4ffb-bbff-63470c5dc255",
    "eventID": "0898ce29-a396-444a-899d-b068f390c361",
    "readOnly": false,
    "eventType": "AwsApiCall",
    "managementEvent": true,
    "recipientAccountId": "111122223333",
    "eventCategory": "Management"
}
```

**Example ：`ListSlackChannelConfigurations` 的日誌範例**  
以下範例顯示 [ListSlackChannelConfigurations](https://docs.aws.amazon.com/supportapp/latest/APIReference/API_ListSlackChannelConfigurations.html) 操作的 CloudTrail 日誌項目。  

```
{
    "eventVersion": "1.08",
    "userIdentity": {
        "type": "AssumedRole",
        "principalId": "AIDACKCEVSQ6C2EXAMPLE:AWSSupportAppRole",
        "arn": "arn:aws:sts::111122223333:assumed-role/AWSSupportAppRole",
        "accountId": "111122223333",
        "accessKeyId": "AKIAI44QH8DHBEXAMPLE",
        "sessionContext": {
            "sessionIssuer": {
                "type": "Role",
                "principalId": "AIDACKCEVSQ6C2EXAMPLE",
                "arn": "arn:aws:iam::111122223333:role/AWSSupportAppRole",
                "accountId": "111122223333",
                "userName": "AWSSupportAppRole"
            },
            "webIdFederationData": {},
            "attributes": {
                "creationDate": "2022-03-01T20:06:32Z",
                "mfaAuthenticated": "false"
            }
        }
    },
    "eventTime": "2022-03-01T20:06:46Z",
    "eventSource": "supportapp.amazonaws.com",
    "eventName": "ListSlackChannelConfigurations",
    "awsRegion": "us-east-1",
    "sourceIPAddress": "72.21.217.131",
    "userAgent": "aws-cli/1.3.23 Python/2.7.6 Linux/2.6.18-164.el5",
    "requestParameters": null,
    "responseElements": null,
    "requestID": "20f81d63-31c5-4351-bd02-9eda7f76e7b8",
    "eventID": "70acb7fe-3f84-47cd-8c28-cc148ad06d21",
    "readOnly": true,
    "eventType": "AwsApiCall",
    "managementEvent": true,
    "recipientAccountId": "111122223333",
    "eventCategory": "Management"
}
```

**Example ：`GetAccountAlias` 的日誌範例**  
以下範例顯示 [GetAccountAlias](https://docs.aws.amazon.com/supportapp/latest/APIReference/API_GetAccountAlias.html) 操作的 CloudTrail 日誌項目。  

```
{
    "eventVersion": "1.08",
    "userIdentity": {
        "type": "AssumedRole",
        "principalId": "AIDACKCEVSQ6C2EXAMPLE:devdsk",
        "arn": "arn:aws:sts::111122223333:assumed-role/AWSSupportAppRole/devdsk",
        "accountId": "111122223333",
        "accessKeyId": "AKIAI44QH8DHBEXAMPLE",
        "sessionContext": {
            "sessionIssuer": {
                "type": "Role",
                "principalId": "AIDACKCEVSQ6C2EXAMPLE",
                "arn": "arn:aws:iam::111122223333:role/AWSSupportAppRole",
                "accountId": "111122223333",
                "userName": "AWSSupportAppRole"
            },
            "webIdFederationData": {},
            "attributes": {
                "creationDate": "2022-03-01T20:31:27Z",
                "mfaAuthenticated": "false"
            }
        }
    },
    "eventTime": "2022-03-01T20:31:47Z",
    "eventSource": "supportapp.amazonaws.com",
    "eventName": "GetAccountAlias",
    "awsRegion": "us-east-1",
    "sourceIPAddress": "72.21.217.142",
    "userAgent": "aws-cli/1.3.23 Python/2.7.6 Linux/2.6.18-164.el5",
    "requestParameters": null,
    "responseElements": null,
    "requestID": "a225966c-0906-408b-b8dd-f246665e6758",
    "eventID": "79ebba8d-3285-4023-831a-64af7de8d4ad",
    "readOnly": true,
    "eventType": "AwsApiCall",
    "managementEvent": true,
    "recipientAccountId": "111122223333",
    "eventCategory": "Management"
}
```