コンテンツにスキップ

InfluxDBコネクタ

InfluxDB v2コネクタは、InfluxDBデータベースに時系列データを書き込みます。

コネクタタイプ: InfluxDb2Writer

{
"type": "InfluxDb2Writer",
"config": {
"endpoint": "http://localhost:8086",
"authToken": "YOUR_INFLUXDB_TOKEN",
"org": "my-organization",
"bucket": "sensor-data",
"measurement": "temperature",
"tags": {
"location": "factory-floor",
"sensor_type": "thermocouple",
"unit": "celsius"
}
}
}
  • endpoint: InfluxDBサーバーURL
  • authToken: InfluxDB認証トークン
  • org: 組織名
  • bucket: ターゲットバケット名
  • measurement: 測定名
  • tags: すべてのデータポイントに追加する静的タグ(オプション)

入力ペイロード:

{
"temperature": 25.5,
"humidity": 60.2,
"pressure": 101.3
}

InfluxDBに保存される形式:

measurement: temperature
tags: location=factory-floor, sensor_type=thermocouple
fields: temperature=25.5, humidity=60.2, pressure=101.3
timestamp: <現在時刻>

ユースケース:センサーデータストレージ

Section titled “ユースケース:センサーデータストレージ”
{
"type": "InfluxDb2Writer",
"config": {
"endpoint": "http://influxdb.local:8086",
"authToken": "my-token==",
"org": "manufacturing",
"bucket": "production-metrics",
"measurement": "machine_data",
"tags": {
"machine_id": "CNC-001",
"location": "Building-A",
"department": "machining"
}
}
}
  1. 意味のある測定名を使用
  2. フィルタリングとグループ化のために静的タグを追加
  3. フィールド名を一貫して保つ
  4. 適切なバケット保持ポリシーを使用
  • MongoDB - ドキュメントデータベース代替
  • SQL - リレーショナルデータベース代替