Simple Log Service uses Protocol Buffer (Protobuf) as the standard log format. You can write logs to Simple Log Service in the Protobuf format.
Protobuf is used as a format to interchange structured data. Before you write logs to Simple Log Service by calling the related API operations, you must serialize raw log data to Protobuf data streams. The following example shows sample Protobuf-formatted data:
message Log
{
required uint32 Time = 1;// UNIX Time Format
message Content
{
required string Key = 1;
required string Value = 2;
}
repeated Content Contents = 2;
optional fixed32 Time_ns = 4; // for time nano part
}
message LogTag
{
required string Key = 1;
required string Value = 2;
}
message LogGroup
{
repeated Log Logs= 1;
optional string Topic = 3;
optional string Source = 4;
repeated LogTag LogTags = 6;
}
message LogGroupList
{
repeated LogGroup logGroupList = 1;
}