This topic describes the parameters that you can set when you ship logs from Log Service
to OSS and store the log data in the CSV format.
On the consumption preview page or index query page of Log Service, you can view multiple
key-value pairs of a log. You can also enter the field names (keys) that you want
to ship to OSS.
Note The keys that you add in the CSV Keys section must be unique.
The following table describes the parameters for the CSV storage format.
||A single-character string that is used to separate keys.
||A single-character string. If a key contains a delimiter or a line break, use double
quotation marks ("") to enclose the key. This ensures key separation and prevents
data reading errors.
||If the specified key value does not exist, this string is entered in the key to indicate
that the key is null.
||Indicates whether to add the key name to the first line of the CSV file.
For more information, visit CSV standard
and PostgreSQL documentation
During log shipping from Log Service to OSS, you can use the reserved keys that are
listed in the following table.
|The Unix timestamp of a log. The value represents the number of seconds that have
elapsed since the epoch time January 1, 1970, 00:00:00 UTC. This value is calculated
based on the time key of the log.
|The topic of a log.
|The client IP address of the log source.
Note You can select these reserved keys as required when you ship data to OSS and store
the data in the CSV format. For example, if you require the log topic, you can set
the key name to
OSS storage addresses
- CSV is a readable format. A CSV file can be downloaded from OSS and viewed as a TXT
- For more information about SNAPPY compression, see Snappy compression.
If you use HybridDB for MySQL to consume CSV file data shipped to OSS, we recommend
that you use the following configurations:
- Delimiter: comma (,).
- Escape Character: double quotation marks (").
- Invalid Fields: null.
- Display Key: turned off. By default, no key name is added in the first line of the
CSV file in HybridDB for MySQL.