跳转到内容
本站为社区维护的非官方中文翻译,与 Cloudflare, Inc. 无关联。本站不提供账户登录,请勿在任何非官方站点输入您的 Cloudflare 账户信息。官方文档:developers.cloudflare.com

更新日志

Cloudflare 的最新更新与改进。

返回所有文章

SQL API 自省:`include_attributes` 参数

SQL API 自省端点新增了 include_attributes 查询参数。将其设置为 true 后,系统会根据您账户前七天的数据,发现数据集 attributes JSON 列中的键及其类型。发现的键将在数据集的 attributes 响应字段中返回。

部分数据集会将额外的键值数据存储在 attributes JSON 列中,您可以使用精确键查找(例如 attributes['http.method'])进行查询。此前用于发现这些键的方式 include_custom_attributes 会在 custom_attributes 字段中返回名称。新的命名更清楚地表明,返回的每个名称都是您通过 attributes 列访问的键。

include_custom_attributes 和 custom_attributes 已弃用,但仍可使用。请更新集成以改用 include_attributes 和 attributes。

curl --get "https://api.cloudflare.com/client/v4/analytics/sql/introspection" \
  --header "Authorization: Bearer <API_TOKEN>" \
  --data-urlencode "account_tag=<ACCOUNT_TAG>" \
  --data-urlencode "dataset_name=events.httpRequests" \
  --data-urlencode "include_attributes=true"

有关详细信息,请参阅 Attributes。