Hi,
I am trying to read iot data from azure IoT-Hub built-in endpont consumer group - created input plugin, and output plugin to write data on json file. When I run telegraf, it’s creating empty json file
Does anybody can help me here. Using telegraf version 1.37.1
telegraf.conf
[[inputs.eventhub_consumer]]
data_format = “json_v2”
[[input.eventhub_consumer.json_v2]]
timestamp_path = “Payload.timeseriesData.#.timestamp”
timestamp_format = “2006-01-02T15:04:05.0000000Z”
[[input.eventhub_consumer.json_v2.tag]]
path = “Payload.iothub-connection-device-id”
rename = “device_id”
[[input.eventhub_consumer.json_v2.tag]]
path = “plantCode”
rename = “plant_code”
[[input.eventhub_consumer.json_v2.field]]
path = “timeSeriesData.#.value”
type = “float”
[[outputs.file]]
files = “C:\telegraf\iot_data.json”
data_format = “json”
Sample data at iot built-in endpoint:
”Paylod”: {
”iothub-connection-device-id”: “BE01-01-edge-dev”,
”iothub-enqueuedtime”: “2026-02-23:T12:20:00.5000000Z”,
”plantCode”: “BE01”
”timeSeriesData”: [
{
”value”: 200.5,
”tagCode”: “11aa22bb-a1b1-11aa-aa11bb22”
},
{
”value”: 100.5.
”tagCode”: “11cc22dd-c1d1-11cc-cc11dd22”
}
]
}
When run in - - test mode: Got an error
E! [agent] Starting input inputs.eventhub_consumer: creating receiver for partition ‘0’: *Error{Condition: amqp:link:stolen, Description : At least one reciever for the endpoint is created with epoch ‘0’, and so non-epoch receiver not allowed”
I tried with changing epoch = 10 and epoch = 1, still telegraf is not creating data in output json file
