All Products
Search
Document Center

Simple Log Service:JSON format

Last Updated:Aug 29, 2023

After logs are shipped from Simple Log Service to Object Storage Service (OSS), the logs can be saved as a file in different formats. This topic describes the JSON format.

Parameters

If you set Storage Format to json when you create a data shipping job of the new version, you must configure the parameters, as shown in the following figure. For more information, see Create an OSS data shipping job (new version).

json

Parameter

Description

Ship Tags

Specifies whether to ship the tag field of logs, for example, __tag__:abc.

Sample URLs of OSS files

After logs are shipped to OSS, the logs are stored in OSS buckets. The following table provides the sample URLs of the OSS files that store the logs.

Note
  • If you specify a file extension when you create a shipping job, the files that are shipped to OSS use the extension.

  • If you do not specify a file extension when you create a shipping job, the extension is determined by the compression type of the file.

Compression type

File extension

Sample URL

Description

Not compressed

If you specify a file extension when you create a shipping job, the files that are shipped to OSS use the extension, for example, .json.

oss://oss-shipper-chengdu/ecs_test/2022/01/26/20/54_1453812893059571256_937.json

You can download the OSS file to your computer and open the file as a text file. Sample file:

{"__time__":"1453809242","__topic__":"","__source__":"10.170.***.***","ip":"10.200.**.***","time":"26/Jan/2016:19:54:02 +0800","url":"POST
              /PutData?Category=YunOsAccountOpLog&AccessKeyId=<yourAccessKeyId>&Date=Fri%2C%2028%20Jun%202013%2006%3A53%3A30%20GMT&Topic=raw&Signature=<yourSignature>
              HTTP/1.1","status":"200","user-agent":"aliyun-sdk-java"}

If you do not specify a file extension when you create a shipping job, the files that are shipped to OSS do not have an extension.

oss://oss-shipper-chengdu/ecs_test/2022/01/26/20/54_1453812893059571256_937

Snappy

If you specify a file extension when you create a shipping job, the files that are shipped to OSS use the extension, for example, .json.

oss://oss-shipper-chengdu/ecs_test/2022/01/26/20/54_1453812893059571256_937.json

For information about how to decompress a file that is compressed by using Snappy, see Decompression tools for Snappy-compressed files.

If you do not specify a file extension when you create a shipping job, the files that are shipped to OSS use the .snappy extension.

oss://oss-shipper-chengdu/ecs_test/2022/01/26/20/54_1453812893059571256_937.snappy

GZIP

If you specify a file extension when you create a shipping job, the files that are shipped to OSS use the extension, for example, .json.

oss://oss-shipper-chengdu/ecs_test/2022/01/26/20/54_1453812893059571256_937.json

To decompress a file that is compressed by using GZIP, run the gzip command.

If you do not specify a file extension when you create a shipping job, the files that are shipped to OSS use the .gz extension.

oss://oss-shipper-chengdu/ecs_test/2022/01/26/20/54_1453812893059571256_937.gz

ZSTD

If you specify a file extension when you create a shipping job, the files that are shipped to OSS use the extension, for example, .json.

oss://oss-shipper-chengdu/ecs_test/2022/01/26/20/54_1453812893059571256_937.json

To decompress a file that is compressed by using ZSTD, run the zstd command.

If you do not specify a file extension when you create a shipping job, the files that are shipped to OSS use the .zst extension.

oss://oss-shipper-chengdu/ecs_test/2022/01/26/20/54_1453812893059571256_937.zst