使用拆分日志处理较长的日志条目
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Cloud Logging 将传入日志的大小限制为 256 KB,并会丢弃任何更大的日志。为确保 Cloud Logging 保留大型日志,Fleet Engine 可以将其拆分为一系列较小的日志。
Cloud Logging 可能会将 Fleet Engine 中的以下日志拆分:
每个分屏日志条目都包含以下字段:
split.uid
:从一个常见的原始日志条目分离出来的一组日志条目的唯一标识符。从原始日志条目拆分出的所有条目的此字段值相同。
split.index
:此条目在一系列分屏条目中的索引位置。拆分中的第一个条目的索引为 0.split.index
。此索引也会附加到 LogEntry.insertId
字段。
split.totalSplits
:原始日志条目拆分成的日志条目数。从原始日志条目拆分出的所有条目的此字段值相同。
split log 1:
insertId: "XXXX-01"
split {index: 0, uuid: "XXXX"}
splitLog 2:
insertId: "XXX-02"
split {index: 1, uuid: "XXXX"}
如需查找从一个特定日志分离出来的所有日志,请使用如下查询:
split.uid="789+2022-02-22T12:22:22.22+05:00"
sortby split.index OR sortby insertID
这些分屏日志的结构与 Cloud Audit Logs 指南中显示的结构几乎相同。主要区别在于,对于车队引擎日志,拆分发生在 jsonPayload
字段中。如需了解详情和示例,请参阅拆分审核日志条目。
后续步骤
如需根据您的条件统计和过滤日志,请创建基于日志的指标。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-02-25。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-02-25。"],[[["Cloud Logging limits log size to 256KB, and Fleet Engine can split larger logs into smaller segments for retention."],["Split logs contain unique identifiers (`split.uid`), index (`split.index`), and total split count (`split.totalSplits`) for reassembly."],["You can search for related split logs using the `split.uid` and sort by `split.index` or `insertId`."],["Fleet Engine's split log structure is similar to Cloud Audit Logs, with splitting occurring in the `jsonPayload` field."]]],[]]