Hi i have a test Json file with timestamp field as below
2019-03-06T11:19:48.0000855Z
I keep on getting below error when starting telegraf to read the json test file
2019-03-06T13:07:10Z E! [inputs.file]: Error in plugin: parsing time “2019-03-06T11:19:48.0000855Z”: month out of range
Any ideas how i can parse the dateformat as causing me a headache at the moment
My config is as below
[[inputs.file]]
files = [“D:/Logs/Apps/TeleGrafWindowsPerfMonAgent/TestJson.log”]
Data format to consume.
Each data format has its own unique set of configuration options, read
more about them here:
telegraf/DATA_FORMATS_INPUT.md at master · influxdata/telegraf · GitHub
data_format = “json”
Query is a GJSON path that specifies a specific chunk of JSON to be
parsed, if not specified the whole document will be parsed.
GJSON query paths are described here:
GitHub - tidwall/gjson: Get JSON values quickly - JSON parser for Go
json_query = “”
Tag keys is an array of keys that should be added as tags.
tag_keys = [
“hostname”
]
String fields is an array of keys that should be added as string fields.
json_string_fields = [“CurrentItemSubscriptions”,“MaxItemSubscriptions”,“TotalSubscribedItems”,“Usernames”]
Name key is the key to use as the measurement name.
json_name_key = “LightStreamerJmxResource”
Time key is the key containing the time that should be used to create the
metric.
json_time_key = “timestamp”
Time format is the time layout that should be used to interprete the json_time_key.
The time must be unix
, unix_ms
, unix_us
, unix_ns
, or a time in the
“reference time”. To define a different format, arrange the values from
the “reference time” in the example to match the format you will be
using. For more information on the “reference time”, visit
time package - time - Go Packages
ex: json_time_format = “Mon Jan 2 15:04:05 -0700 MST 2006”
json_time_format = “2006-01-02T15:04:05Z07:00”
json_time_format = “01/02/2006 15:04:05”
json_time_format = “unix”
json_time_format = “unix_ms”
json_time_format = “2019-03-06T11:19:48.0000855Z”
Timezone allows you to provide an override for timestamps that
don’t already include an offset
e.g. 04/06/2016 12:41:45
Default: “” which renders UTC
Options are as follows:
1. Local – interpret based on machine localtime
2. “America/New_York” – Unix TZ values like those found in List of tz database time zones - Wikipedia
3. UTC – or blank/unspecified, will return timestamp in UTC
##json_timezone = “”