After logs are shipped from Log Service to Object Storage Service (OSS), the logs can be stored in different formats. This topic describes the CSV format.
The following figure shows the parameters that you must configure if you specify csv for Storage Format in a shipping rule. For more information, see Configure a data shipping rule.
|CSV Fields||The log field that you want to ship to OSS. You can view log fields on the Raw Logs tab of a Logstore. We recommend that you add log fields one by one. The log fields
that you can ship to OSS include the fields in the log content and the reserved fields
such as __time__, __topic__, and __source__. For more information about reserved fields, see Reserved fields.
|Delimiter||The delimiter that is used for log fields. You can use commas (,), vertical bars (|), spaces, or tab characters as delimiters of log fields.|
|Escape Character||If a log field contains a delimiter, you must use an escape character to enclose the field. This way, the delimiter does not take effect on the field when the field is read.|
|Invalid Fields||If a log field that you specify in CSV Fields does not exist in logs, the value that you specify in the Invalid Fields field is shipped.|
|Shipped Fields||Specifies whether to write the names of log fields to the CSV file. If you turn on Shipped Fields, the names of log fields are written to the CSV file.|
URLs of files in OSS
After logs are shipped to OSS, the logs are stored in OSS buckets. The following table provides examples of the URLs of the files that store the logs.
|Compression type||File extension||URL example||Description|
|Not compressed||.csv||oss://oss-shipper-shenzhen/ecs_test/2016/01/26/20/54_1453812893059571256_937.csv||You can download the CSV file to your computer and open the file as a text file.|
|Snappy||.snappy.csv||oss://oss-shipper-shenzhen/ecs_test/2016/01/26/20/54_1453812893059571256_937.snappy.csv||For more information about how to open Snappy-compressed files, see Decompression tools for Snappy-compressed files.|