

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

# 使用 Contributor Insights 識別最佳位置和 ISP
<a name="CloudWatch-IM-view-cw-tools-contributor-insights"></a>

CloudWatch Contributor Insights 可協助您識別 AWS 應用程式的熱門用戶端位置和 ASNs （通常是網際網路服務供應商或 ISPs)。使用下列 Contributor Insights 規則範例，開始建立對 Internet Monitor 有用的規則。如需詳細資訊，請參閱[在 CloudWatch 中建立 Contributor Insights 規則](ContributorInsights-CreateRule.md)。

若要進一步了解網路監視器中的用戶端位置準確度，請參閱[網路監視器中的地理位置資訊和準確度](CloudWatch-IM-inside-internet-monitor.md#IMGeolocationSourceAccuracy)。

**注意**  
Internet Monitor 每五分鐘儲存網際網路度量資料一次，因此在您設定 Contributor Insights 規則之後，必須將期間調整為五分鐘才能看到圖表。

**依可用性影響檢視最受影響的位置和 ASN**

若要依可用性下降程度檢視最受影響的用戶端位置和 ASN，可以在語法編輯器中使用下列 Contributor Insights 規則。以您自有的監視器名稱取代 *monitor-name*。

```
{
    "Schema": {
        "Name": "CloudWatchLogRule",
        "Version": 1
    },
    "AggregateOn": "Sum",
    "Contribution": {
        "Filters": [
            {
                "Match": "$.clientLocation.city",
                "IsPresent": true
            }
        ],
        "Keys": [
            "$.clientLocation.city",
            "$.clientLocation.networkName"
        ],
        "ValueOf": "$.awsInternetHealth.availability.percentageOfTotalTrafficImpacted"
    },
    "LogFormat": "JSON",
    "LogGroupNames": [
        "/aws/internet-monitor/monitor-name/byCity"
    ]
}
```

**依延遲影響檢視最受影響的用戶端位置和 ASN**

若要依往返時間增加程度檢視最受影響的用戶端位置和 ASN，可以在語法編輯器中使用下列 Contributor Insights 規則。以您自有的監視器名稱取代 *monitor-name*。

```
{
    "Schema": {
        "Name": "CloudWatchLogRule",
        "Version": 1
    },
    "AggregateOn": "Sum",
    "Contribution": {
        "Filters": [            {
                "Match": "$.clientLocation.city",
                "IsPresent": true
            }
        ],
        "Keys": [
            "$.clientLocation.city",
            "$.clientLocation.networkName"
        ],
        "ValueOf": "$.awsInternetHealth.performance.percentageOfTotalTrafficImpacted"
    },
    "LogFormat": "JSON",
    "LogGroupNames": [
        "/aws/internet-monitor/monitor-name/byCity"
    ]
}
```

**依總流量百分比檢視最受影響的用戶端位置和 ASN**

若要依總流量百分比檢視最受影響的用戶端位置和 ASN，可以在語法編輯器中使用下列 Contributor Insights 規則。以您自有的監視器名稱取代 *monitor-name*。

```
{
    "Schema": {
        "Name": "CloudWatchLogRule",
        "Version": 1
    },
    "AggregateOn": "Sum",
    "Contribution": {
        "Filters": [
            {
                "Match": "$.clientLocation.city",
                "IsPresent": true
            }
        ],
        "Keys": [
            "$.clientLocation.city",
            "$.clientLocation.networkName"
        ],
        "ValueOf": "$.percentageOfTotalTraffic"
    },
    "LogFormat": "JSON",
    "LogGroupNames": [
        "/aws/internet-monitor/monitor-name/byCity"
    ]
}
```