Windows Server 2019
InfluxDB 2.0.8
Telegraf 1.20.0-rc0
telegraf.conf:
[[inputs.file]]
files = ["C:/example.xml"]
data_format = "xml"
[[inputs.file.xpath]]
metric_name = "string('Example')"
timestamp = "concat(substring(/Report/StartTime, 7, 4), '-', substring(/Report/StartTime, 1, 2), '-', substring(/Report/StartTime, 4, 2), 'T', substring(/Report/StartTime, 12, 2), ':', substring(/Report/StartTime, 15, 2), ':', substring(/Report/StartTime, 18, 2))"
timestamp_format = "2006-01-02T15:04:05"
[inputs.file.xpath.tags]
[inputs.file.xpath.fields_int]
[inputs.file.xpath.fields]
example = "number(/Report/Values/valueA)"
example.xml:
<?xml?>
<Report>
<StartTime>09/15/2021 07:00:00</StartTime>
<Values>
<valueA>410.66</valueA>
</Values>
</Report>
Result in Data Explorer:
,0,2021-09-15T05:28:58.7649082Z,2021-09-15T11:28:58.7649082Z,2021-09-15T07:01:00Z,410.66,example,Example
How on earth do I end up with 7:01:00 as a result having 7:00:00 in xml file?