processors.template doesn't work
[[inputs.http]]
interval = "5m"
urls = ["http://xx.xx.xx.xx:9090/api/v1/query?query=rate(ifHCOutOctets[9m])/ignoring(job)(ifHighSpeed)*8/1000000"]
timeout = "30s"
data_format = "json"
json_query = "data.result"
tag_keys=["metric_regionCode","metric_sn","metric_logicalName","metric_ifName","metric_ifOperStatus","metric_brand","metric_instance","metric_model","metric_monitorIP","metric_regionName","metric_stacking","metric_type"]
json_string_fields = ["value_1"]
name_override = "switch_port"
[inputs.http.tags]
metric___name__ = "out_bandwidth_usage_rate"
[[processors.template]]
tag = "test"
template = '{{ .Tag "metric_regionCode" }}.{{ .Tag "metric_ifName" }}'
Hi, there The configuration is shown above. The issue is that the output remain the same as the processors plugin doesn't exist . There is no tag "test",which is defined in processors.template.
I am wondering if the problem is related to json format, since I can successfully use processors plugin in other input plugin(chrony,cpu and so on) in influx data format.
Anyone can give some advice would be really appreciated, thanks inadvance.
Hello! I recommend posting this question in our Community Slack or Community Page, we have a lot of talented community members there who could help answer your question more quickly. You can also learn more about Telegraf by enrolling at InfluxDB University for free!
Heads up, this issue will be automatically closed after 7 days of inactivity. Thank you!
Can you please show the metric before it enters the template processor? You can do so by simply adding a printer processor like
[[inputs.http]]
interval = "5m"
urls = ["http://xx.xx.xx.xx:9090/api/v1/query?query=rate(ifHCOutOctets[9m])/ignoring(job)(ifHighSpeed)*8/1000000"]
timeout = "30s"
data_format = "json"
json_query = "data.result"
tag_keys=["metric_regionCode","metric_sn","metric_logicalName","metric_ifName","metric_ifOperStatus","metric_brand","metric_instance","metric_model","metric_monitorIP","metric_regionName","metric_stacking","metric_type"]
json_string_fields = ["value_1"]
name_override = "switch_port"
[inputs.http.tags]
metric___name__ = "out_bandwidth_usage_rate"
[[processors.printer]]
order = 1
[[processors.template]]
order = 2
tag = "test"
template = '{{ .Tag "metric_regionCode" }}.{{ .Tag "metric_ifName" }}'
Hello! I am closing this issue due to inactivity. I hope you were able to resolve your problem, if not please try posting this question in our Community Slack or Community Page. Thank you!