I’m facing an issue while using InfluxDB to store data from IoT devices (Eclipse Ditto) through Kafka using Telegraf. The data I’m receiving is in JSON format, containing information about various attributes and features of the devices. However, I’m only able to see the “features” data in InfluxDB, and information like the “thingId” and other attributes are missing.
Here’s an example of the JSON data I’m working with:
{
"thingId": "org.acme:thing001",
"attributes": {
"location": "Device created for the demo"
},
"features": {
"temperature": {
"properties": {
"value": 30
}
},
"humidity": {
"properties": {
"value": 40
}
},
"pressure": {
"properties": {
"value": 26
}
}
}
}
My Telegraf configuration for consuming this data from Kafka and writing it to InfluxDB is as follows:
[[outputs.influxdb_v2]]
urls = ["EC2 IP & Port"]
token = "Token"
organization = "Org"
bucket = "Ditto"
[[inputs.kafka_consumer]]
brokers = ["EC2 IP & Port"]
topics = ["Kafka Target"]
max_message_len = 1000000
data_format = "json"
I suspect that there might be an issue in my Telegraf configuration or possibly with the InfluxDB write process that’s causing the “thingId” and attributes to not be properly stored or displayed in InfluxDB.
Has anyone encountered a similar issue? How can I ensure that the entire JSON data, including the “thingId” and attributes, is visible and queryable in InfluxDB? Any guidance or suggestions would be greatly appreciated. Thank you!