influxdb-bridge-examples
An example bridge configuration
{
"version": "1",
"connections": [
{
"name": "InfluxDB v1 Connection",
"connection": {
"driver": "influxdbv1",
"hostname": "influxdb-v1.example.com",
"port": 8086,
"database": "mqtt_data",
"credentials": {
"username": "admin",
"password": "password123"
}
},
"options": {
"bufferSize": 5000,
"timeoutMs": 3000,
"queueMaxSize": 10000,
"maxRetries": 15,
"retryDelayMs": 1000
},
"topicMappings": [
{
"name": "topic-mapping-to-weather-measurement",
"schemaMapping": "weather-schema-mapping",
"target": "weather_data",
"mqttTopics": [
"sensors/weather/#"
]
}
]
},
{
"name": "InfluxDB v2 Connection",
"connection": {
"driver": "influxdbv2",
"hostname": "influxdb-v2.example.com",
"port": 8086,
"database": "mqtt_metrics",
"organization": "my-org",
"credentials": {
"token": "your-influxdb-v2-token"
},
"compression": {
"enable": true
}
},
"options": {
"bufferSize": 1000,
"timeoutMs": 4000,
"queueMaxSize": 5000,
"maxRetries": 10,
"retryDelayMs": 2000
},
"topicMappings": [
{
"name": "topic-mapping-to-system-measurement",
"schemaMapping": "system-schema-mapping",
"target": "system_metrics",
"mqttTopics": [
"system/metrics/#"
]
}
]
}
],
"schemaMappings": [
{
"name": "weather-schema-mapping",
"mapping": [
{
"source": "[client_id]",
"target": "device_id",
"targetType": "tag"
},
{
"source": "[payload][temperature]",
"target": "temperature",
"targetType": "field"
},
{
"source": "[payload][humidity]",
"target": "humidity",
"targetType": "field"
},
{
"source": "[payload][location]",
"target": "location",
"targetType": "tag"
},
{
"source": "[timestamp]",
"target": "recorded_at",
"targetType": "field"
}
]
},
{
"name": "system-schema-mapping",
"mapping": [
{
"source": "[client_id]",
"target": "host",
"targetType": "tag"
},
{
"source": "[payload][cpu]",
"target": "cpu_usage",
"targetType": "field"
},
{
"source": "[payload][memory]",
"target": "memory_usage",
"targetType": "field"
},
{
"source": "[payload][disk]",
"target": "disk_usage",
"targetType": "field"
},
{
"source": "system",
"target": "data_type",
"targetType": "tag",
"options": {
"isConst": true
}
}
]
}
]
}
An example bridge configuration connecting to both both Influxdb v1 and Invluxdb v2/v3