

# 使用 Contributor Insights 确定主要位置和 ISP
<a name="CloudWatch-IM-view-cw-tools-contributor-insights"></a>

CloudWatch Contributor Insights 可以帮助您确定 AWS 应用程序的主要客户端位置和 ASN [通常是互联网服务提供商（ISP）]。通过以下 Contributor Insights 示例规则，开始使用对网络监测仪有用的规则。有关更多信息，请参阅 [在 CloudWatch 中创建 Contributor Insights 规则](ContributorInsights-CreateRule.md)。

要详细了解网络监测仪中的客户端位置准确性，请参阅 [网络监测仪中的地理位置信息和准确性](CloudWatch-IM-inside-internet-monitor.md#IMGeolocationSourceAccuracy)。

**注意**  
网络监测仪每五分钟存储一次互联网监测数据，因此在设置 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"
    ]
}
```