Remove the time_key from the field values in JSON parser (#4951)

This commit is contained in:
Daniel Nelson
2018-11-02 17:53:45 -07:00
committed by GitHub
parent 02ad1f46be
commit ad320ac1e0
2 changed files with 29 additions and 0 deletions

View File

@@ -143,6 +143,8 @@ func (p *JSONParser) parseObject(metrics []telegraf.Metric, jsonOut map[string]i
}
}
delete(f.Fields, p.JSONTimeKey)
//if the year is 0, set to current year
if nTime.Year() == 0 {
nTime = nTime.AddDate(time.Now().Year(), 0, 0)