After logs are shipped from Simple Log Service to Object Storage Service (OSS), the logs can be stored in different formats. This topic describes the JSON format.
Parameters
The following figure shows the parameters that you must configure if you set the Storage Format parameter to json in the Data Shipping to OSS panel. For more information, see Create an OSS data shipping job (new version).
Parameter | Description |
Ship Tag | Specifies whether to ship the tag field of logs. Example: __tag__:abc. |
URLs of OSS objects
After logs are shipped to OSS, the logs are stored in OSS objects. The following table provides sample URLs of OSS objects.
If you specify an object suffix when you create a data shipping job, the OSS objects use the suffix.
If you do not specify an object suffix when you create a data shipping job, the OSS objects use the suffix that is generated based on the compression type.
Compression type | Object suffix | Sample URL | Description |
Not compressed | If you specify an object suffix, the specified suffix is used. Example: .json. | oss://oss-shipper-chengdu/ecs_test/2022/01/26/20/54_1453812893059571256_937.json | You can download the JSON file to your computer and open the file as a text file. Sample file:
|
If you do not specify an object suffix, the object does not have a suffix. | oss://oss-shipper-chengdu/ecs_test/2022/01/26/20/54_1453812893059571256_937 | ||
Snappy | If you specify an object suffix, the specified suffix is used. Example: .json. | oss://oss-shipper-chengdu/ecs_test/2022/01/26/20/54_1453812893059571256_937.json | For more information about how to use Snappy to compress and decompress data, see Decompression tools for Snappy-compressed files. Problem: If you used Snappy to compress objects and use Hive deployed in an E-MapReduce (EMR) cluster to read the objects, the following error may occur. Solution: Execute the |
If you do not specify an object suffix, the .snappy suffix is used. | oss://oss-shipper-chengdu/ecs_test/2022/01/26/20/54_1453812893059571256_937.snappy | ||
gzip | If you specify an object suffix, the specified suffix is used. Example: .json. | oss://oss-shipper-chengdu/ecs_test/2022/01/26/20/54_1453812893059571256_937.json | If objects are compressed by using gzip, you can install gzip and decompress the objects by using gzip commands. |
If you do not specify an object suffix, the .gz suffix is used. | oss://oss-shipper-chengdu/ecs_test/2022/01/26/20/54_1453812893059571256_937.gz | ||
Zstandard | If you specify an object suffix, the specified suffix is used. Example: .json. | oss://oss-shipper-chengdu/ecs_test/2022/01/26/20/54_1453812893059571256_937.json | If objects are compressed by using Zstandard, you can install Zstandard and decompress the objects by using Zstandard commands. |
If you do not specify an object suffix, the .zst suffix is used. | oss://oss-shipper-chengdu/ecs_test/2022/01/26/20/54_1453812893059571256_937.zst |