You need to enable JavaScript to run this app.
导航

数据编码方式

最近更新时间2023.11.13 16:31:29

首次发布时间2022.05.11 16:49:43

日志服务在日志上传 API 中(PutLogs)使用 Protocol Buffer 格式作为标准的日志写入格式。
Protocol Buffer 格式用于结构化交换格式。通过 API 接口写入日志到服务端之前,需要先把原始日志数据序列化成以下格式的 Protocol Buffer 数据流。

说明

调用 PutLogs 接口时,日志通过 LogGroupList 进行上传写入。

syntax = "proto3";
package pb;
option go_package = "./;pb";
message LogContent
{
  string Key = 1;
  string Value = 2;
}

message Log
{
  int64 Time = 1;// UNIX Time Format
  repeated LogContent Contents = 2;
}

message LogTag
{
  string Key = 1;
  string Value = 2;
}

message LogGroup
{    
  repeated Log Logs = 1;
  string Source = 2;
  repeated LogTag LogTags = 3;
  string FileName = 4;
  string ContextFlow = 5; //该字段暂无效用
}

message LogGroupList
{
  repeated LogGroup LogGroups = 1;
}