-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(parsers.avro): Handle timestamp format checking correctly (#13855)
- Loading branch information
Showing
9 changed files
with
41 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
plugins/parsers/avro/testdata/bad-timestamp-format/expected.err
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
could not instantiate parser: invalid timestamp format 'unix_ps' |
Empty file.
Empty file.
29 changes: 29 additions & 0 deletions
29
plugins/parsers/avro/testdata/bad-timestamp-format/telegraf.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[[ inputs.file ]] | ||
files = ["./testdata/bad-timestamp-format/message.avro"] | ||
data_format = "avro" | ||
|
||
avro_measurement = "measurement" | ||
avro_tags = [ "tag" ] | ||
avro_timestamp = "timestamp" | ||
avro_timestamp_format = "unix_ps" | ||
avro_schema = ''' | ||
{ | ||
"type":"record", | ||
"name":"Value", | ||
"namespace":"com.example", | ||
"fields":[ | ||
{ | ||
"name":"tag", | ||
"type":"string" | ||
}, | ||
{ | ||
"name":"field", | ||
"type":"long" | ||
}, | ||
{ | ||
"name":"timestamp", | ||
"type":"long" | ||
} | ||
] | ||
} | ||
''' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
measurement,tag=test_tag field=19i,timestamp=1664296121000000i 1664296121000000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
test_tag&������� |