I’m trying to parse a JSON file received by a MQTT Broker (Mosquitto) connection to feed an already create database. I’m using telegraf and influxDB on a VM(Ubuntu 18.04). Both services work well, however, influxdb doesn’t receive the tags from the JSON.
This is the JSON file:
{ "message":{ "basic_container":{ "confidence":{ "altitude":15, "semi_major_confidence":0, "semi_major_orientation":0, "semi_minor_confidence":0 }, "reference_position":{ "altitude":0, "latitude":414066546, "longitude":21750345 }, "station_type":5 }, "generation_delta_time":45315, "high_frequency_container":{ "confidence":{ "curvature":7, "heading":127, "longitudinal_acceleration":102, "speed":127, "vehicle_length":4, "yaw_rate":8 }, "curvature":1023, "curvature_calculation_mode":2, "drive_direction":2, "heading":3601, "longitudinal_acceleration":161, "speed":500, "vehicle_length":1023, "vehicle_width":62, "yaw_rate":32767 }, "protocol_version":2, "station_id":224 }, "origin":"on_board_application", "source_uuid":"cttc_car_224", "type":"cam", "version":"1.0.0", "timestamp":1605886891388 }
The part of telegraf.conf is this:
` [[inputs.mqtt_consumer]]
servers = [“tcp://127.0.0.1:1883”]
topics = [
“5GCroCo/inQueue/v2x/cam/#”,
“5GCroCo/inQueue/v2x/denm/#”,
]
data_format = “json”
tag_keys = [
“station_type”,
]`
I’ve tried to get just a simple tag “station_type” but it is not shown at the influx measurements.
This is the influxdb part:
[[outputs.influxdb]] urls = ["http://127.0.0.1:8086"] database = "v2x_manager"
This is the influx output
`rparada@rparada-VirtualBox:~$ influx
Connected to http://localhost:8086 version 1.8.3
InfluxDB shell version: 1.8.3
use v2x_manager
Using database v2x_manager
show measurements
name: measurements
name
cpu
disk
diskio
kernel
mem
processes
swap
system
What I’m missing?