Plugins parsers csv unix timestamp #5047
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Required for all PRs:
Description.
For now the csv parser does not handle unix timestamp like
1257894000
as csv_timestamp_format in the csv as timestamp.So to fix that if csv_timestamp_format = Unix, we assume that the timestamp is an epoch ms format.
I have also added unit tests, and no others unit test were broken.
=== RUN TestBasicCSV
--- PASS: TestBasicCSV (0.00s)
=== RUN TestHeaderConcatenationCSV
--- PASS: TestHeaderConcatenationCSV (0.00s)
=== RUN TestHeaderOverride
--- PASS: TestHeaderOverride (0.00s)
=== RUN TestTimestamp
--- PASS: TestTimestamp (0.00s)
=== RUN TestTimestampError
--- PASS: TestTimestampError (0.00s)
=== RUN TestTimestampUnixFormat
--- PASS: TestTimestampUnixFormat (0.00s)
=== RUN TestQuotedCharacter
--- PASS: TestQuotedCharacter (0.00s)
=== RUN TestDelimiter
--- PASS: TestDelimiter (0.00s)
=== RUN TestValueConversion
--- PASS: TestValueConversion (0.00s)
=== RUN TestSkipComment
--- PASS: TestSkipComment (0.00s)
=== RUN TestTrimSpace
--- PASS: TestTrimSpace (0.00s)
=== RUN TestSkipRows
--- PASS: TestSkipRows (0.00s)
=== RUN TestSkipColumns
--- PASS: TestSkipColumns (0.00s)
=== RUN TestSkipColumnsWithHeader
--- PASS: TestSkipColumnsWithHeader (0.00s)
=== RUN TestParseStream
--- PASS: TestParseStream (0.00s)
PASS
ok github.com/influxdata/telegraf/plugins/parsers/csv