# 创建订阅 [创建数据流](https://docs.equinix.com/zh-Hans/observability/streaming-data/api-managing-streams.md)后,创建订阅,将指标和事件数据发送给数据收集器。 支持的数据收集器: | 数据收集器 | 事件 | 指标 | | ----------------------------------- | ---- | ------ | | [数据记录](#datadog) | 支持 | 支持 | | [Dynatrace](#dynatrace) | 支持 | 支持 | | [Google Pub/Sub](#google-pubsub) | 支持 | 支持 | | [Grafana Webhook](#grafana-webhook) | 支持 | 支持 | | [Microsoft Teams](#microsoft-teams) | 支持 | 支持 | | [PagerDuty](#pagerduty) | 支持 | 不支持 | | [上线](#servicenow) | 支持 | 不支持 | | [Slack Webhook](#slack) | 支持 | 支持 | | [Splunk HEC](#splunk) | 支持 | 支持 | | [通用网络钩](#generic-webhook) | 支持 | 支持 | ## 数据格式[​](#数据格式 "直接链接至数据格式") Equinix事件和指标对所有数据使用CloudEvents规范格式或OpenTelemetry规范格式。我们所有的事件数据架构,指标数据架构和数据类型都发布在GitHub存储库中[`/equinix/equinix-cloudevents`](https://github.com/equinix/equinix-cloudevents)。 例如: * CloudEvent * CloudEvents Metric * OpenTelemetry Log * OpenTelemetry Metric ``` --- specversion: '1.0' source: https://api.equinix.com/fabric/v4/cloudevents id: 6c573287-9914-4202-8b6d-2d15e7da04b8 type: equinix.fabric.metric subject: /fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7688 time: '2024-07-01T20:12:21.306Z' severitynumber: 9 severitytext: INFO equinixproject: 123 dataschema: https://github.com/Fabric/.../ApiConfigEventData.json datacontenttype: application/json data: message: New metrics collected resource: href: https://api.equinix.com/fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7688 uuid: 956a86fb-d03d-436c-8d5d-30d1f51f7688 name: my-test-port description: port description metrics: - type: GAUGE name: equinix.fabric.port.bandwidth_rx.usage description: Port inbound bandwidth utilization unit: bit/s datapoints: - endDateTime: '2024-07-01T20:12:21.000Z' value: 440023 - type: SUM name: equinix.fabric.port.packets_erred_tx.count description: Port error packets interval: PT5M unit: packet datapoints: - endDateTime: '2024-07-01T20:12:21.000Z' value: 10 ``` ``` { "specversion": "1.0", "source": "https://api.equinix.com/fabric/v4/cloudevents", "id": "16c7e20a-d147-40c4-81ad-f60d25548aad", "time": "2026-06-24T20:20:59.000Z", "type": "equinix.fabric.metric", "subject": "/fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7688", "dataschema": "https://equinix.github.io/equinix-cloudevents/jsonschema/equinix/fabric/v1/MetricEvent.json", "datacontenttype": "application/json", "severitynumber": "9", "severitytext": "INFO", "equinixproject": "123", "data": { "message": "Metrics collected", "resource": { "href": "https://api.equinix.com/fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7688", "uuid": "956a86fb-d03d-436c-8d5d-30d1f51f7688", "type": "XF_PORT", "state": "PROVISIONED" }, "metrics": [ { "type": "GAUGE", "name": "equinix.fabric.port.bandwidth_rx.usage", "unit": "bit/s", "datapoints": [ { "endDateTime": "2026-06-24T20:20:59.000Z", "value": 179 } ] }, { "type": "GAUGE", "name": "equinix.fabric.port.bandwidth_tx.usage", "unit": "bit/s", "datapoints": [ { "endDateTime": "2026-06-24T20:20:59.000Z", "value": 1711 } ] } ] } } ``` ``` --- resourceLogs: - resource: attributes: - key: service.name value: stringValue: Equinix - key: equinix.event.specversion value: stringValue: '1.0' - key: equinix.event.source value: stringValue: https://api.equinix.com/fabric/v4/cloudevents - key: equinix.event.subject value: stringValue: /fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7688 - key: equinix.event.equinixproject value: stringValue: 123 scopeLogs: - scope: logRecords: - timeUnixNano: '1719889941306000000' severityNumber: 9 severityText: Information body: stringValue: '{"message":"Virtual port status changed to Up","resource":{"href":"https://api.equinix.com/fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7688","uuid":"956a86fb-d03d-436c-8d5d-30d1f51f7688","name":"my-test-port","description":"port description"}}' attributes: - key: equinix.event.id value: stringValue: 6c573287-9914-4202-8b6d-2d15e7da04b8 - key: equinix.event.type value: stringValue: equinix.fabric.port.status.up ``` ``` --- resourceMetrics: - resource: attributes: - key: service.name value: stringValue: Equinix - key: equinix.event.specversion value: stringValue: '1.0' - key: equinix.event.source value: stringValue: https://api.equinix.com/fabric/v4/cloudevents - key: equinix.event.subject value: stringValue: /fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7688 - key: equinix.event.equinixproject value: stringValue: 123 scopeMetrics: - scope: metrics: - name: equinix.fabric.port.bandwidth_rx.usage description: Port inbound bandwidth utilization unit: 'bit/s' gauge: dataPoints: - attributes: - key: service.name value: stringValue: Equinix - key: equinix.event.source value: stringValue: https://api.equinix.com/fabric/v4/cloudevents - key: equinix.event.subject value: stringValue: /fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7688 - key: equinix.event.equinixproject value: stringValue: 123 - key: equinix.event.resource.name value: stringValue: 'my-port-name' timeUnixNano: '1719889941306000000' asInt: 566 - name: equinix.fabric.port.packets_erred_tx.count description: Port error packets unit: packet sum: aggregationTemporality: 2 # required for sum https://github.com/open-telemetry/opentelemetry-proto/blob/v0.9.0/opentelemetry/proto/metrics/v1/metrics.proto#L230 dataPoints: - attributes: - key: service.name value: stringValue: Equinix - key: equinix.event.source value: stringValue: https://api.equinix.com/fabric/v4/cloudevents - key: equinix.event.subject value: stringValue: /fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7688 - key: equinix.event.equinixproject value: stringValue: 123 - key: equinix.event.resource.name value: stringValue: 'my-port-name' startTimeUnixNano: '1719889641306000000' # optional timeUnixNano: '1719889941306000000' asInt: 10 ``` 特定数据收集器的这些格式的任何变体如下所示。 ## 先决条件[​](#先决条件 "直接链接至先决条件") * 要创建订阅,您必须具有`Fabric Stream Subscription Manager`(STREAM\_SUBSCRIPTION)权限。请联系贵公司管理员或IAM管理员以[管理访问权限和角色](https://docs.equinix.com/zh-Hans/iam/user-management/iam-users-access-roles.md)。 - Portal - API 该门户网站支持创建和管理 Splunk、Datadog、Microsoft Teams 和 PagerDuty 的订阅。 1. 登录[客户门户网站](https://portal.equinix.com/fabric)> *Fabric控制面板*。 2. 从“*可观测性*”菜单中,选择**数据流**。 ![观察性下拉菜单屏幕截图](https://docs.equinix.com/zh-Hans/assets/images/observability-drop-down-7b9fce28b7a44d07b365263f69b94cc2.png) 3. 从\_操作\_下拉菜单中,选择**添加订阅**。 ![操作下拉菜单屏幕截图](https://docs.equinix.com/zh-Hans/assets/images/add-subscriptions-drop-down-7922ca43aedec1062f921dbc68f600c1.png) * 验证。提交您的用户凭据,客户端ID和客户端机密以进行OAuth2验证。有关如何向Equinix API验证请求的更多信息,请参阅[API验证](https://docs.equinix.com/zh-Hans/equinix-api/api-authentication.md)。 > **注意** > > 订阅 API URI/主机值仅支持 HTTPS,不支持自签名证书。 ## 数据记录[​](#数据记录 "直接链接至数据记录") 在[创建订阅](https://docs.datadoghq.com/account_management/api-app-keys/)时,数据记录订阅需要您的数据记录[API和应用密钥](#datadog)。 有关与数据文件集成的设置指南,请参阅[如何](https://community.equinix.com/kb/guides/how-to-set-up-datadog/3105)在Equinix社区中[设置数据](https://community.equinix.com/kb/guides/how-to-set-up-datadog/3105)文件。 * Portal * API 在\_添加订阅\_页面上,输入您的数据记录信息,包括: * 订阅名称 * 您的 Datadog 主机 URL * 您的 Datadog API 密钥 * 您的 Datadog 应用程序密钥 * 并提供描述(可选) ![添加数据订阅对话框屏幕截图](https://docs.equinix.com/zh-Hans/assets/images/add-subscription-datadog-6e6a53bf2fc5bbaf907256eac19dada7.png) 要创建订阅,请向端点发送`POST`请求[`/fabric/v4/streams//subscriptions`](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4/stream-subscriptions/createstreamsubscriptions.md)。在请求路径中指定流ID`stream`。 在`sink`请求主体的对象中: * 指定`type`为`DATADOG`。 * 使用[Datadog站点参考表](https://docs.datadoghq.com/getting_started/site/#access-the-datadog-site)查找参数的站点参数`sink.host`。 * 提供您的数据记录API密钥和应用程序密钥 cURL 请求示例: ``` curl -X 'POST' 'https://api.equinix.com/fabric/v4/streams//subscriptions' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ' \ -d '{ "type": "STREAM_SUBSCRIPTION", "name": "", "description": "", "sink": { "host": "https://", "type": "DATADOG", "credential": { "type": "API_KEY", "apiKey": "" }, "settings": { "applicationKey": "" } } }' ``` ### 数据数据示例[​](#数据数据示例 "直接链接至数据数据示例") * Event * Metric ``` --- date_happened: 1719864741 # in seconds source_type_name: Equinix aggregation_key: title: 'Virtual port status changed to Up' status: info # INFO->info, WARN -> warn, ERROR->error, CRITICAL->warn, FATAL->error, default: info text: "{\"cloudevent\":{\"specversion\":\"1.0\",\"source\":\"https://api.equinix.com/fabric/v4/cloudevents\",\"id\":\"6c573287-9914-4202-8b6d-2d15e7da04b8\",\"type\":\"equinix.fabric.port.status.up\",\"subject\":\"/fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7688\",\"time\":\"2024-07-01T20:12:21.306Z\",\"severitynumber\":9,\"severitytext\":\"INFO\",\"equinixalert\":\"clear/\",\"equinixproject\":\"123\",\"data\":{\"message\":\"Virtual port status changed to Up\",\"resource\":{}}}}" ``` ``` --- series: - type: 3 # 0(unspecified), 1(count), 2(rate), 3(gauge) metric: equinix.fabric.port.bandwidth_rx.usage resources: - type: subject name: /fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7688 - type: equinixproject name: 123 unit: bit/s points: - timestamp: 1719889941 value: 440023 - type: 1 metric: equinix.fabric.port.packets_erred_tx.count resources: - type: subject name: /fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7688 - type: equinixproject name: 123 unit: packet interval: 300 # in seconds points: - timestamp: 1719889941 value: 10 ``` ## Dynatrace[​](#dynatrace "直接链接至Dynatrace") 创建Dynatrace订阅,请创建接收事件的事件索引,接收指标的指标索引或两者,然后创建HTTP事件收集器。 * Portal * API 在\_添加订阅\_页面中,输入您的Dynatrace信息,包括: * 订阅名称 * 您的Dynatrace HTTP事件收集器URI * 您的Dynatrace访问令牌 * 您的Dynatrace事件索引(必填) * 您的Dynatrace指标索引(如果您计划将指标导入到Splunk中) * 并提供描述(可选) 要创建订阅,请向端点发送`POST`请求[`/fabric/v4/streams//subscriptions`](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4/stream-subscriptions/createstreamsubscriptions.md)。在请求路径中指定流ID`stream`。 在`sink`请求主体的对象中: * 指定`type`为`DYNATRACE`。 * 提供您的Dynatrace HTTP事件收集器URI。 * 提供您的Dynatrace事件索引(必填)和Dynatrace指标索引(可选)。 * 提供您的Dynatrace访问令牌。 cURL 请求示例: ``` curl -X 'POST' 'https://api.equinix.com/fabric/v4/streams//subscriptions' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ' \ -d '{ "type": "STREAM_SUBSCRIPTION", "name": "dynatrace-subscription", "description": "subscription-1", "enabled": true, "metricSelector": { "include": [ "equinix.fabric.connection.*" ] }, "sink": { "type": "DYNATRACE", "credential": { "type": "API_TOKEN", "apiToken": "" }, "settings": { "eventUri": "https://.live.dynatrace.com/platform/ingest/v1/events", "metricUri": "https://.live.dynatrace.com/api/v2/metrics/ingest" } } }' ``` ![添加Dynatrace订阅对话框屏幕截图](https://docs.equinix.com/zh-Hans/assets/images/add-subscription-dynatrace-47f64acda243906d095eb1254986f50a.png) ## Google PubSub[​](#google-pubsub "直接链接至Google PubSub") Google Pub/Sub订阅要求满足以下条件: * [创建主题](https://cloud.google.com/pubsub/docs/create-topic)。 * 授予IAM对Pub/Sub.服务账户的权限。 * [创建订阅](#google-pubsub)时,请提供您的主题URI和服务账户凭据。 Google Pub/Sub的设置指南,请参阅[如何](https://community.equinix.com/observability-58/how-to-deploy-a-google-cloud-dataflow-980)在Equinix社区中[设置Google Pub/Sub](https://community.equinix.com/observability-58/how-to-deploy-a-google-cloud-dataflow-980)。 * Portal * API 在\_添加订阅\_页面中,输入您的Google Cloud PubSub信息,包括: * 订阅名称 * Google Cloud PubSub 访问令牌 * Google Cloud PubSub 订阅 URI * 并提供描述(可选) ![](https://docs.equinix.com/zh-Hans/assets/images/add-subscription-google-pubsub-be26fe60533e6b8f468ecc00df4dd22b.png) 要创建订阅,请向端点发送`POST`请求[`/fabric/v4/streams//subscriptions`](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4/stream-subscriptions/createstreamsubscriptions.md)。在请求路径中指定流ID`stream`。 在`sink`请求主体的对象中: * 指定`type`为`GOOGLE_PUBSUB`。 * 提供您的Google Cloud PubSub访问令牌和PubSub订阅URI。 cURL 请求示例: ``` curl -X POST 'https://api.equinix.com/fabric/v4/streams//subscriptions' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ' \ -d '{ "type": "STREAM_SUBSCRIPTION", "name": "", "description": "", "sink": { "uri": "https://pubsub.googleapis.com/v1/projects//topics/:publish", "type": "GOOGLE_PUBSUB", "credential": { "type": "ACCESS_TOKEN", "accessToken": "" } } }' ``` ## Grafana Webhook[​](#grafana-webhook "直接链接至Grafana Webhook") 创建Grafana订阅, 请[为传入的webhooks创建并配置Grafana](https://grafana.com/docs/grafana-cloud/send-data/otlp/send-data-otlp/#recommended-opentelemetry-setup-via-grafana-cloud-integrations)。在创建订阅时,请提供您的Grafana Webhook的URL和API密钥。 有关Grafana的设置指南, 请参阅[如何](https://community.equinix.com/kb/guides/how-to-set-up-a-webhook-in-grafana/3219)在Equinix社区中[设置Grafana Webhook](https://community.equinix.com/kb/guides/how-to-set-up-a-webhook-in-grafana/3219)。 * Portal * API 在\_添加订阅\_页面中,输入您的Grafana信息,包括: * 订阅名称。 * Grafana 指标 URI。 * Grafana 事件 URI。 * 您的 Grafana API 密钥。 * (可选)描述。 ![](https://docs.equinix.com/zh-Hans/assets/images/add-subscription-grafana-5bec5b974efeaee81abc603c351944b4.png) 要创建订阅,请向端点发送`POST`请求[`/fabric/v4/streams//subscriptions`](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4/stream-subscriptions/createstreamsubscriptions.md)。在请求路径中指定流ID`stream`。 在`sink`请求主体的对象中: * 指定`type`为`WEBHOOK`。 * 提供您的Grafana Metrics URI和/或事件URI。 * 提供您的Grafana API密钥。 cURL 请求示例: ``` curl -X POST 'https://api.equinix.com/fabric/v4/streams//subscriptions' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ' \ -d '{ "type": "STREAM_SUBSCRIPTION", "name": "", "description": "", "enabled": true, "sink": { "type": "WEBHOOK", "settings": { "metricUri": "https:///otlp/v1/metrics", "format": "OPENTELEMETRY" }, "credential": { "type": "API_KEY", "apiKey": ":" } } }' ``` ## 微软团队[​](#微软团队 "直接链接至微软团队") 创建Microsoft Teams订阅,请[创建并配置webhook](https://support.microsoft.com/en-us/office/create-incoming-webhooks-with-workflows-for-microsoft-teams-8ae491c7-0394-4861-ba59-055e33f75498),以便在收到webhook请求时发布消息。webhook配置完毕后,请在创建订阅时提供HTTP帖子URL。 有关Microsoft Teams的设置指南,请参阅[如何](https://community.equinix.com/observability-58/how-to-set-up-microsoft-teams-982?tid=982\&fid=58)在Equinix社区中[设置Microsoft Teams](https://community.equinix.com/observability-58/how-to-set-up-microsoft-teams-982?tid=982\&fid=58)。 * Portal * API 在\_添加订阅\_页面中,输入您的Microsoft Teams信息,包括: * 订阅名称 * 您的 Microsoft Workflow Webhook URI * 并提供描述(可选) ![添加Microsoft Teams订阅对话框屏幕截图](https://docs.equinix.com/zh-Hans/assets/images/add-subscription-microsoft-teams-13d3f86bb4033faaf6bc1764bec888aa.png) 要创建订阅,请向端点发送`POST`请求[`/fabric/v4/streams//subscriptions`](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4/stream-subscriptions/createstreamsubscriptions.md)。在请求路径中指定流ID`stream`。 在`sink`请求主体的对象中: * 指定`type`为`TEAMS`。 * 提供您的Microsoft工作流Webhook URI。 cURL 请求示例: ``` curl -X 'POST' 'https://api.equinix.com/fabric/v4/streams//subscriptions' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ' \ -d '{ "type": "STREAM_SUBSCRIPTION", "name": "", "description": "", "sink": { "uri": "", "type": "TEAMS" } }' ``` ## PagerDuty[​](#pagerduty "直接链接至PagerDuty") 对于PagerDuty订阅,请[创建服务](https://support.pagerduty.com/main/docs/services-and-integrations#create-a-service)和[事件APIv2](https://support.pagerduty.com/main/docs/services-and-integrations#create-a-generic-events-api-integration)集成来处理您的事件。在[创建订阅](#pagerduty)时,提供您的PagerDuty URI和集成密钥。 有关PagerDuty的设置指南,请参阅[如何](https://community.equinix.com/observability-58/how-to-set-up-pagerduty-983)在Equinix社区中[设置PagerDuty](https://community.equinix.com/observability-58/how-to-set-up-pagerduty-983)。 * Portal * API 在\_添加订阅\_页面中,输入您的PagerDuty信息,包括: * 订阅名称 * 您的 PagerDuty 主机 URL * 您的 PagerDuty 集成密钥 * 并提供描述(可选) ![添加分页器订阅对话框屏幕截图](https://docs.equinix.com/zh-Hans/assets/images/add-subscription-pagerduty-2a32a11bebfc3bffe8f2e803577af8a9.png) 要创建订阅,请向端点发送`POST`请求[`/fabric/v4/streams//subscriptions`](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4/stream-subscriptions/createstreamsubscriptions.md)。在请求路径中指定流ID`stream`。 在`sink`请求主体的对象中: * 指定`type`为`PAGERDUTY`。 * 提供您的PagerDuty主机URL和集成密钥。 cURL 请求示例: ``` curl -X 'POST' 'https://api.equinix.com/fabric/v4/streams//subscriptions' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ' \ -d '{ "type": "STREAM_SUBSCRIPTION", "name": "", "description": "", "sink": { "host": "https://events.pagerduty.com", "type": "PAGERDUTY", "credential": { "type": "INTEGRATION_KEY", "integrationKey": "" } } }' ``` ### PagerDuty数据示例[​](#pagerduty数据示例 "直接链接至PagerDuty数据示例") * Event ``` --- routing_key: dedup_key: event_action: trigger # or resolve payload: source: Equinix timestamp: '2024-07-01T20:12:21.306Z' severity: critical summary: Virtual port status changed to Down custom_details: equinixsource: https://api.equinix.com/fabric/v4/cloudevents specversion: '1.0' id: type: equinix.fabric.port.status.down subject: /fabric/v4/ports/ time: '2024-07-01T20:12:21.306Z' severitynumber: 21 severitytext: FATAL # or INFO equinixalert: raise/ equinixproject: 123 ``` ## ServiceNow[​](#servicenow "直接链接至ServiceNow") ServiceNow订阅需要您的[ServiceNow用户名和密码](https://www.servicenow.com/docs/bundle/zurich-platform-security/page/integrate/authentication/concept/local-authentication.html)。 * Portal * API 在“*添加订阅*”页面上,输入您的ServiceNow信息,包括: * 订阅名称。 * ServiceNow 主机 URL。 * 您的 ServiceNow 用户名。 * 您的 ServiceNow 密码。 * (可选)描述。 ![](https://docs.equinix.com/zh-Hans/assets/images/add-subscription-servicenow-b90cbf326fcdc53c841762ef0b06efec.png) 要创建ServiceNow订阅,请向端点发送`POST`请求[`/fabric/v4/streams//subscriptions`](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4/stream-subscriptions/createstreamsubscriptions.md)。在请求路径中指定流ID`stream`。 在`sink`请求主体的对象中: * 指定`type`为`SERVICENOW`。 * 提供您的ServiceNow主机URL,用户名和密码。 cURL 请求示例: ``` curl -X 'POST' 'https://api.equinix.com/fabric/v4/streams//subscriptions' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ' \ -d '{ "type": "STREAM_SUBSCRIPTION", "name": "", "description": "", "sink": { "host": "https://.service-now.com", "type": "SERVICENOW", "settings": { "source": "" }, "credential": { "type": "USERNAME_PASSWORD", "username": "", "password": "" } } }' ``` ### ServiceNow数据示例[​](#servicenow数据示例 "直接链接至ServiceNow数据示例") * Event * Metric ``` --- source: Equinix time_of_event: '2024-07-01T20:12:21.306Z' description: Virtual port status changed to Down severity: 1 # 1 for clear and 0 for clear resolution_state: New # or Closing message_key: NCAB543WC4lrLpET8nLX4Vd8 resource: fabric.port node: /fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7688 type: equinix.fabric.port.status.down additional_info: '{"cloudevent":{"specversion":"1.0","source":"https://api.equinix.com/fabric/v4/cloudevents","id":"6c573287-9914-4202-8b6d-2d15e7da04b8","type":"equinix.fabric.port.status.down","subject":"/fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7681","time":"2024-07-01T20:12:21.306Z","severitynumber":13,"severitytext":"CRITICAL","equinixalert":"raise/NCAB543WC4lrLpET8nLX4Vd8","equinixproject":"123","data":{"message":"Virtual port named \'Test-port\' status changed to Down","resource":{}}}}' ``` ``` --- - timestamp: 1719889941306000. #mili sec source: Equinix resource_path: "/fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7681" metric_type: equinix.fabric.port.bandwidth_rx.utilization value: 70.5 ci2metric_id: type: GAUGE subject: "/fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7681" equinixproject: 123 unit: "%" - timestamp: 1719889941306000 #mili sec source: Equinix resource_path: "/fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7681" metric_type: equinix.fabric.port.packets_erred_tx.count value: 70.5 ci2metric_id: type: GAUGE interval: PT5M subject: "/fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7681" equinixproject: 123 unit: "%" ``` ## 松懈[​](#松懈 "直接链接至松懈") Slack订阅需要webhook的唯一URL。请参阅[为传入webhooks创建和配置Slack应用程序](https://api.slack.com/messaging/webhooks)。 有关与Slack集成的设置指南,请参阅[如何](https://community.equinix.com/observability-58/how-to-set-up-slack-981?tid=981\&fid=58)在Equinix社区中[设置Slack](https://community.equinix.com/observability-58/how-to-set-up-slack-981?tid=981\&fid=58)。 * Portal * API 在\_添加订阅\_页面上,输入您的可宽延信息,包括: * 订阅名称 * 订阅URI * 描述(可选) ![](https://docs.equinix.com/zh-Hans/assets/images/add-subscription-slack-6dad51c6da1bc924ff6a54578ab88c14.png) 要创建订阅,请向端点发送`POST`请求[`/fabric/v4/streams//subscriptions`](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4/stream-subscriptions/createstreamsubscriptions.md)。在请求路径中指定流ID`stream`。 在`sink`请求主体的对象中: * 指定`type`为`SLACK`。 * 提供Slack订阅URI。 cURL 请求示例: ``` curl -X 'POST' 'https://api.equinix.com/fabric/v4/streams//subscriptions' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ' \ -d '{ "type": "STREAM_SUBSCRIPTION", "name": "", "description": "", "sink": { "uri": "", "type": "SLACK" } }' ``` ## Splunk[​](#splunk "直接链接至Splunk") 要创建Splunk订阅,请创建接收事件的[事件索引](https://docs.splunk.com/Documentation/Splunk/latest/Indexer/Setupmultipleindexes#Create_events_indexes),接收[指标](https://docs.splunk.com/Documentation/Splunk/latest/Indexer/Setupmultipleindexes#Create_metrics_indexes)的[指标索引](https://docs.splunk.com/Documentation/Splunk/latest/Indexer/Setupmultipleindexes#Create_metrics_indexes)或两者,然后创建HTTP事件收集器。在创建订阅时,提供您的HTTP事件收集器URI,HTTP事件收集器令牌和索引名称。 有关与Splunk集成的设置指南,请参阅[如何](https://community.equinix.com/observability-58/how-to-set-up-splunk-979?tid=979\&fid=58)在Equinix社区中[设置Splunk](https://community.equinix.com/observability-58/how-to-set-up-splunk-979?tid=979\&fid=58)。 * Portal * API 在\_添加订阅\_页面上,输入您的Splunk信息,包括: * 订阅名称 * 您的 Splunk HTTP 事件收集器 URI * 您的 Splunk 访问令牌 * 您的 Splunk 事件索引(必填) * 如果您计划将指标导入 Splunk,则需要配置您的 Splunk 指标索引。 * 并提供描述(可选) ![添加Splunk订阅对话框屏幕截图](https://docs.equinix.com/zh-Hans/assets/images/add-subscription-splunk-01ba475d1a4a6e0ce93aa5b2dd6aa78e.png) 要创建订阅,请向端点发送`POST`请求[`/fabric/v4/streams//subscriptions`](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4/stream-subscriptions/createstreamsubscriptions.md)。在请求路径中指定流ID`stream`。 在`sink`请求主体的对象中: * 指定`type`为`SPLUNK_HEC`。 * 提供您的Splunk HTTP事件收集器URI。 * 提供您的Splunk事件索引(必填)和Splunk指标索引(可选)。 * 提供您的Splunk访问令牌。 cURL 请求示例: ``` curl -X 'POST' 'https://api.equinix.com/fabric/v4/streams//subscriptions' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ' \ -d '{ "type": "STREAM_SUBSCRIPTION", "name": "", "description": "", "sink": { "uri": "https://http-inputs-.splunkcloud.com:/services/collector/event", "type": "SPLUNK_HEC", "settings": { "eventIndex": "", "metricIndex": "", "source": "" }, "credential": { "type": "ACCESS_TOKEN", "accessToken": "Splunk " } } }' ``` ### Splunk数据示例[​](#splunk数据示例 "直接链接至Splunk数据示例") * Event * Metric ``` --- sourcetype: _json index: test-event-index source: equinix # optional event: equinixsource: https://api.equinix.com/fabric/v4/cloudevents specversion: '1.0' id: 6c573287-9914-4202-8b6d-2d15e7da04b8 type: equinix.fabric.port.status.up subject: /fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7688 time: '2024-07-01T20:12:21.306Z' severitynumber: 9 severitytext: INFO equinixalert: clear/NCAB543WC4lrLpET8nLX4Vd8 equinixproject: 123 data: message: Virtual port status changed to Up resource: href: https://api.equinix.com/fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7688 uuid: 956a86fb-d03d-436c-8d5d-30d1f51f7688 name: my-test-port description: port description ``` ``` --- time: 1719889941.306 event: metric index: test-index-metric source: Equinix # Optional fields: subject: /fabric/v4/ports/956a86fb-d03d-436c-8d5d-30d1f51f7688 equinixproject: 123 "metric_name:equinix.fabric.port.bandwidth_rx.usage": 440023 "metric_name:equinix.fabric.port.packets_erred_tx.count": 10 ``` ## 通用 Webhook[​](#通用-webhook "直接链接至通用 Webhook") Equinix支持为[CloudEvent规范格式或OpenTelemetry规范格式的](#data-formats)事件和指标创建任何通用webhook服务订阅。 您必须包含事件URI或Metric URI。同时提供事件URI和指标,您必须同时提供事件URI和指标URI。如果您仅提供这些字段中的一个字段,则仅会将相应的数据类型(事件或指标)发送至目标平台。 * Portal * API 在\_添加订阅\_页面中,输入您的Webhook信息,包括: * 订阅名称 * 选择 CloudEvent 格式或 Open Telemetry 格式作为您的流数据格式。 * 事件 URI * 指标 URI * 从“无授权”,“用户名/密码”,“访问令牌”或“API密钥”选项中选择身份验证类型。在提供的字段中输入相关信息。 * 并提供描述(可选)。 ![](https://docs.equinix.com/zh-Hans/assets/images/add-subscription-webhook-0ee372e097b1ac2978ab1825f86affd6.png) 要创建webhook订阅,请向端点发送`POST`请求[`/fabric/v4/streams//subscriptions`](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4/stream-subscriptions/createstreamsubscriptions.md)。在请求路径中指定流ID`stream`。 在请求主体的对象中`sink`,为接收器类型提供任何必要的字段。包括: * 指定`type`为`WEBHOOK`。 * 提供事件URI和/或Metric URI。指定格式。 * 提供相关的验证信息,包括用户名/密码,访问令牌或API密钥选项。如果不需要验证,可以省略该`credentials`对象。 cURL 请求示例: ``` curl -X POST 'https://api.equinix.com/fabric/v4/streams//subscriptions' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ' \ -d '{ "type": "STREAM_SUBSCRIPTION", "name": "", "description": "", "enabled": true, "sink": { "type": "WEBHOOK", "settings": { "eventUri": "", "metricUri": "", "format": "" } } }' ```