Refactor telegraf.conf by cleaning up commented sections and updating xpath configuration

This commit is contained in:
2025-01-25 14:41:24 +01:00
parent c2f9206624
commit 95babcde15

View File

@@ -13,58 +13,13 @@
[inputs.socket_listener.xpath.tags]
url = "url"
#id = "''"
#state = "'connected'"
#id = ??
#state = ??
[inputs.socket_listener.xpath.fields]
player = "player"
#peerValues = "concat('[', string-join(peers/*, ','), ']')"
peers = "peers"
#[[inputs.http_listener_v2]]
# service_address = ":9091"
# paths = ["/webrtc-internals-exporter"]
# data_format = "json_v2"
# methods = ["POST"]
# http_success_code = 204
#
# [[inputs.http_listener_v2.json_v2]]
# measurement_name = "stats"
# timestamp_path = "@this.0.values.0.timestamp"
# timestamp_format = "unix_ms"
#
# [[inputs.http_listener_v2.json_v2.object]]
# path = "@this"
# tags = ["id", "url", "state"]
[[inputs.http_listener_v2]]
service_address = ":9091"
paths = ["/webrtc-internals-exporter"]
methods = ["POST"]
http_success_code = 204
data_format = "xpath_json"
[[inputs.http_listener_v2.xpath]]
metric_name = "'statistics'"
metric_selection = "/*"
field_selection = "values/*"
field_name = "type"
field_value = "."
timestamp = "/*/values[last()]/*/timestamp"
timestamp_format = "unix_ms"
[inputs.http_listener_v2.xpath.tags]
url = "url"
state = "state"
id = "''"
[inputs.http_listener_v2.xpath.fields]
#values = "values/*"
peerConnectionId = "id"
peerValues = "concat('[', string-join(values/*, ','), ']')"
[[outputs.file]]
files = ["stdout"]
data_format = "json"