Relevant telegraf.conf
data_format = "json_v2"
[[inputs.http.json_v2]]
measurement_name = "energy"
[[inputs.http.json_v2.object]]
path = "production.eim"
disable_prepend_keys = true
[[inputs.http.json_v2.object.field]]
path = "wattHoursLifetime"
rename = "production"
[[inputs.http.json_v2.object]]
path = "consumption.eim"
disable_prepend_keys = true
[[inputs.http.json_v2.object.field]]
path = "wattHoursLifetime"
rename = "consumption"
Logs from Telegraf
telegraf-telegraf-energy-1 | 2025-01-02T02:31:19Z I! Starting Telegraf 1.33.0 brought to you by InfluxData the makers of InfluxDB
telegraf-telegraf-energy-1 | 2025-01-02T02:31:19Z I! Available plugins: 236 inputs, 9 aggregators, 33 processors, 26 parsers, 63 outputs, 6 secret-stores
telegraf-telegraf-energy-1 | 2025-01-02T02:31:19Z I! Loaded inputs: http
telegraf-telegraf-energy-1 | 2025-01-02T02:31:19Z I! Loaded aggregators:
telegraf-telegraf-energy-1 | 2025-01-02T02:31:19Z I! Loaded processors:
telegraf-telegraf-energy-1 | 2025-01-02T02:31:19Z I! Loaded secretstores:
telegraf-telegraf-energy-1 | 2025-01-02T02:31:19Z W! Outputs are not used in testing mode!
telegraf-telegraf-energy-1 | 2025-01-02T02:31:19Z I! Tags enabled:
telegraf-telegraf-energy-1 | 2025-01-02T02:31:19Z D! [agent] Initializing plugins
telegraf-telegraf-energy-1 | 2025-01-02T02:31:19Z D! [agent] Starting service inputs
telegraf-telegraf-energy-1 | 2025-01-02T02:31:19Z D! [agent] Stopping service inputs
telegraf-telegraf-energy-1 | > energy production=529980 1735785080000000000
telegraf-telegraf-energy-1 | > energy production=326544 1735785080000000000
telegraf-telegraf-energy-1 | 2025-01-02T02:31:19Z D! [agent] Input channel closed
telegraf-telegraf-energy-1 | 2025-01-02T02:31:19Z D! [agent] Stopped Successfully
System info
1.33.0
Docker
No response
Steps to reproduce
- Parse the included input with the include telegraf config
...
Expected behavior
Second telegraf output above is "consumption" rather than "production"
Actual behavior
Both are "production"
Additional info
Input:
{
"production": {
"pcu": {
"wattHoursToday": 34068,
"wattHoursSevenDays": 215538,
"wattHoursLifetime": 530426,
"wattsNow": 0
},
"rgm": {
"wattHoursToday": 0,
"wattHoursSevenDays": 0,
"wattHoursLifetime": 0,
"wattsNow": 0
},
"eim": {
"wattHoursToday": 33846,
"wattHoursSevenDays": 214168,
"wattHoursLifetime": 529980,
"wattsNow": 0
}
},
"consumption": {
"eim": {
"wattHoursToday": 21802,
"wattHoursSevenDays": 128554,
"wattHoursLifetime": 326193,
"wattsNow": 627
}
}
}
Relevant telegraf.conf
Logs from Telegraf
System info
1.33.0
Docker
No response
Steps to reproduce
...
Expected behavior
Second telegraf output above is "consumption" rather than "production"
Actual behavior
Both are "production"
Additional info
Input:
{ "production": { "pcu": { "wattHoursToday": 34068, "wattHoursSevenDays": 215538, "wattHoursLifetime": 530426, "wattsNow": 0 }, "rgm": { "wattHoursToday": 0, "wattHoursSevenDays": 0, "wattHoursLifetime": 0, "wattsNow": 0 }, "eim": { "wattHoursToday": 33846, "wattHoursSevenDays": 214168, "wattHoursLifetime": 529980, "wattsNow": 0 } }, "consumption": { "eim": { "wattHoursToday": 21802, "wattHoursSevenDays": 128554, "wattHoursLifetime": 326193, "wattsNow": 627 } } }