Configure CSV storage fields
You can view multiple key-value pairs of one log on the Log Service data preview page or index query page. Enter the field names (keys) you want to ship to OSS in sequence.
|Delimiter||character||A one-character string used to separate different fields.|
|Quote||character||A one-character string. If a field contains a delimiter or a line break, use quote to enclose this field to avoid incorrect field separation in data reading.|
|Escape||character||A one-character string. The default settings are the same as those of quote. Modification is not supported currently. If a field contains a quote (used as a regular character instead of an escape character), an escape character must be added before this quote.|
|Invalid Key Value||string||If the specified key value does not exist, this string is entered in the field to indicate the field is null.|
|Display Key header||boolean||Indicates whether or not to add the field name to the first line of the CSV file.|
Configurable reserved fields
||The UNIX timestamp of a log (the number of seconds since 1970-01-01), which is calculated according to the time field of your log.|
||The log topic.|
||The IP address of the client from which a log comes.|
The preceding fields are included by default in JSON storage.
You can select which fields you want to include in the CSV storage as per your needs. For example, you can enter the field name
__topic__ if you need the log topic.
OSS storage address
|Compression type||File suffix||Example of OSS file address|
|Do Not Compress||.csv||oss://oss-shipper-shenzhen/ecs_test/2016/01/26/20/54_1453812893059571256_937.csv|
We recommend that you configure as follows:
- Delimiter: comma (,)
- Quote: double quotation marks (“)
- Invalid Key Value: empty
- Display Key: not selected (no field name in the first line of the CSV file for HybridDB by default)
For more information, see HybridDB document.
CSV is a readable format, which means that a file in CSV format can be directly downloaded from OSS and viewed in text form.
If Compress (snappy) is used as the compression type, see the decompression descriptions of snappy in JSON storage.