fix(parser/csv): resolve linter issues (#10093)

This commit is contained in:
Sebastian Spaink 2021-11-10 17:45:50 -06:00 committed by GitHub
parent 62a05b2372
commit 8f309dc34d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 4 deletions

View File

@ -3,7 +3,7 @@
The `csv` parser creates metrics from a document containing comma separated The `csv` parser creates metrics from a document containing comma separated
values. values.
### Configuration ## Configuration
```toml ```toml
[[inputs.file]] [[inputs.file]]
@ -78,7 +78,8 @@ values.
## The field will be skipped entirely where it matches any values inserted here. ## The field will be skipped entirely where it matches any values inserted here.
csv_skip_values = [] csv_skip_values = []
``` ```
#### csv_timestamp_column, csv_timestamp_format
### csv_timestamp_column, csv_timestamp_format
By default the current time will be used for all created metrics, to set the By default the current time will be used for all created metrics, to set the
time using the JSON document you can use the `csv_timestamp_column` and time using the JSON document you can use the `csv_timestamp_column` and
@ -104,6 +105,7 @@ columns and rows.
### Examples ### Examples
Config: Config:
```toml ```toml
[[inputs.file]] [[inputs.file]]
files = ["example"] files = ["example"]
@ -114,13 +116,15 @@ Config:
``` ```
Input: Input:
```
```shell
measurement,cpu,time_user,time_system,time_idle,time measurement,cpu,time_user,time_system,time_idle,time
cpu,cpu0,42,42,42,2018-09-13T13:03:28Z cpu,cpu0,42,42,42,2018-09-13T13:03:28Z
``` ```
Output: Output:
```
```shell
cpu cpu=cpu0,time_user=42,time_system=42,time_idle=42 1536869008000000000 cpu cpu=cpu0,time_user=42,time_system=42,time_idle=42 1536869008000000000
``` ```