Xử lý các mục nhập nhật ký dài bằng nhật ký phân tách
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Cloud Logging giới hạn kích thước của nhật ký đến ở mức 256 KB và loại bỏ mọi nhật ký có kích thước lớn hơn. Để đảm bảo Cloud Logging giữ lại các nhật ký lớn của bạn, Fleet Engine có thể chia các nhật ký đó thành một loạt nhật ký nhỏ hơn.
Tính năng ghi nhật ký trên đám mây có thể tách các nhật ký sau đây khỏi Fleet Engine:
Mỗi mục nhập nhật ký được chia nhỏ chứa các trường sau:
split.uid
: Giá trị nhận dạng duy nhất cho nhóm mục nhập nhật ký được tách từ một mục nhập nhật ký gốc chung. Giá trị của trường này giống nhau đối với tất cả các mục được tách từ mục nhật ký ban đầu.
split.index
: Vị trí của mục này trong chuỗi các mục phân tách.
Mục đầu tiên trong phần được chia có chỉ mục 0.split.index
. Chỉ mục này cũng được thêm vào trường LogEntry.insertId
.
split.totalSplits
: Số lượng mục nhập nhật ký mà mục nhập nhật ký ban đầu được chia thành. Giá trị của trường này là như nhau đối với tất cả các mục được tách từ mục nhật ký ban đầu.
split log 1:
insertId: "XXXX-01"
split {index: 0, uuid: "XXXX"}
splitLog 2:
insertId: "XXX-02"
split {index: 1, uuid: "XXXX"}
Để tìm tất cả nhật ký được tách từ một nhật ký cụ thể, hãy sử dụng một truy vấn như:
split.uid="789+2022-02-22T12:22:22.22+05:00"
sortby split.index OR sortby insertID
Cấu trúc của các nhật ký tách biệt này gần giống với cấu trúc được trình bày trong hướng dẫn về Nhật ký kiểm tra Cloud. Điểm khác biệt chính là đối với nhật ký Fleet Engine, quá trình phân tách diễn ra trong trường jsonPayload
. Để biết thông tin chi tiết và ví dụ, hãy xem phần Chia các mục trong nhật ký kiểm tra.
Bước tiếp theo
Để đếm và lọc nhật ký theo tiêu chí của bạn, hãy tạo chỉ số dựa trên nhật ký.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-09-05 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-09-05 UTC."],[[["\u003cp\u003eCloud Logging limits log size to 256KB, and Fleet Engine can split larger logs into smaller segments for retention.\u003c/p\u003e\n"],["\u003cp\u003eSplit logs contain unique identifiers (\u003ccode\u003esplit.uid\u003c/code\u003e), index (\u003ccode\u003esplit.index\u003c/code\u003e), and total split count (\u003ccode\u003esplit.totalSplits\u003c/code\u003e) for reassembly.\u003c/p\u003e\n"],["\u003cp\u003eYou can search for related split logs using the \u003ccode\u003esplit.uid\u003c/code\u003e and sort by \u003ccode\u003esplit.index\u003c/code\u003e or \u003ccode\u003einsertId\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eFleet Engine's split log structure is similar to Cloud Audit Logs, with splitting occurring in the \u003ccode\u003ejsonPayload\u003c/code\u003e field.\u003c/p\u003e\n"]]],[],null,["Cloud Logging limits the size on incoming logs to 256KB and drops\nanything bigger. To ensure that Cloud Logging retains your large\nlogs, Fleet Engine can split them into a series of smaller logs.\n\nCloud logging may split the following logs from Fleet Engine:\n\n- [SearchVehiclesLog](/maps/documentation/mobility/operations/cloud-logging/reference/trips/rest/Shared.Types/SearchVehiclesLog)\n- [ListDeliveryVehicle](/maps/documentation/mobility/operations/cloud-logging/reference/tasks/rest/Shared.Types/ListDeliveryVehiclesLog)\n- [ListTasksLog](/maps/documentation/mobility/operations/cloud-logging/reference/tasks/rest/Shared.Types/ListTasksLog)\n- [BatchCreateTasksLog](/maps/documentation/mobility/operations/cloud-logging/reference/tasks/rest/Shared.Types/BatchCreateTasksLog)\n\nEach split log entry contains the following fields:\n\n- `split.uid`: A unique identifier for the group of log entries that were split from a common original log entry. The value of this field is the same for all entries split from the original log entry.\n- `split.index`: The position of this entry in the series of split entries. The first entry from the split has index `0.split.index`. This index is also appended to the `LogEntry.insertId` field.\n- `split.totalSplits`: The number of log entries that the original log entry was split into. The value of this field is the same for all entries split from the original log entry.\n\n split log 1:\n insertId: \"XXXX-01\"\n split {index: 0, uuid: \"XXXX\"}\n\n splitLog 2:\n insertId: \"XXX-02\"\n split {index: 1, uuid: \"XXXX\"}\n\nTo find all the logs that were split from one specific log, use a query like: \n\n split.uid=\"789+2022-02-22T12:22:22.22+05:00\"\n sortby split.index OR sortby insertID\n\nThe structure of these split logs is almost the same as the structure shown in\nthe guide for Cloud Audit Logs. The major difference is that for Fleet Engine\nlogs, the split occurs in the `jsonPayload` field. For details and examples, see\n[Split audit log entries](https://cloud.google.com/logging/docs/audit/split-logs).\n\nWhat's next\n\nTo count and filter logs according to you criteria, [create log-based\nmetrics](/maps/documentation/mobility/operations/cloud-logging/metrics)."]]