data_format = "xml"
[[inputs.http.xpath]]
metric_name = "'RMF'"
metric_selection = "/perf-config/performance-data/metric/row"
# timestamp = "//perf-config//performance-data//metric//timestamp//@timestring"
[[inputs.http.xpath.tags]]
description = "@label"
[[inputs.http.xpath.fields]]
value = "@value"
is it because label and value are in one row ?
The Xpath parser plug-in documentation mentioned above shows single square bracket syntax for specifying tags and fields. See below . . . Note: the example uses file input so the only difference is inputs.http instead of inputs.file and proper indentation.
## Tag definitions using the given XPath queries.
[inputs.file.xpath.tags]
name = "substring-after(Sensor/@name, ' ')"
device = "string('the ultimate sensor')"
## Integer field definitions using XPath queries.
[inputs.file.xpath.fields_int]
consumers = "Variable/@consumers"
## Non-integer field definitions using XPath queries.
## The field type is defined using XPath expressions such as number(), boolean() or string(). If no conversion is performed the field will be of type string.
[inputs.file.xpath.fields]
temperature = "number(Variable/@temperature)"
power = "number(Variable/@power)"
frequency = "number(Variable/@frequency)"
ok = "Mode != 'ok'"