MQTT witg strings -> Influx

Hi from Austria, I’m struggled since 2 days with a little problem (possible sitting before the screen :wink: )
I have a MQTT topic, the values are formatted as strings:
MQTT: Topic: SHRDZM/807D3A37863A/807D3A37863A/sensor

Blockquote
{
“timestamp”:“2025-10-31T10:39:50”,
“32.7.0”:“236.10”,
“52.7.0”:“234.70”,
“72.7.0”:“235.30”,
“31.7.0”:“2.50”,
“51.7.0”:“2.00”,
“71.7.0”:“1.12”,
“1.7.0”:“0”,
“2.7.0”:“17”,
“1.8.0”:“9929432”,
“2.8.0”:“19417831”,
“3.8.0”:“692170”,
“4.8.0”:“7045923”,
“16.7.0”:“-17”,
“uptime”:“0003:09:38:02”,
“UTC”:“2025-10-31T09:39:53”
}​

so I set up the config:
[agent]

interval = “10s”
round_interval = true
metric_batch_size = 1000
metric_buffer_limit = 10000
collection_jitter = “0s”
flush_interval = “10s”
flush_jitter = “0s”
precision = “”
hostname = “”
omit_hostname = false
debug = true
[[outputs.influxdb_v2]]
urls = [“h t t p://localhost:8086”]
token = “xxxxxxxxxxxxxxxxxxxx2elN6JJ_c7_W-ujvTYDvHMDfUquDUg==”
organization = “Hoe”
bucket = “Smartmeter”

[[inputs.mqtt_consumer]]
servers = [“tcp://192.168.10.214:1883”]
topics = [
“SHRDZM/807D3A37863A/807D3A37863A”,
]
username = “X”
password = “K”
data_format = “json_v2”
[[inputs.mqtt_consumer.json_v2]]
timestamp_path = “timestamp”
timestamp_format = “2006-01-02T15:04:05”
timestamp_timezone= “CET”
[[inputs.mqtt_consumer.json_v2.field]]
path = “71.7.0”
type = “float”
optional = true
[[inputs.mqtt_consumer.json_v2.field]]
path = “51.7.0”
type = “float”
optional = true
[[inputs.mqtt_consumer.json_v2.field]]
path = “1.7.0”
type = “int”>
optional = true


the debug output is:

Blockquote
root@influxdb:~# telegraf --debug --config h t t p://192.168.50.133:8086/api/v2/telegrafs/0fba69b7b5211000
2025-10-31T17:04:06Z I! Loading config: h t t p://192.168.50.133:8086/api/v2/telegrafs/0fba69b7b5211000
2025-10-31T17:04:06Z I! Starting Telegraf 1.36.3 brought to you by InfluxData the makers of InfluxDB
2025-10-31T17:04:06Z I! Available plugins: 239 inputs, 9 aggregators, 35 processors, 26 parsers, 65 outputs, 6 secret-stores
2025-10-31T17:04:06Z I! Loaded inputs: mqtt_consumer
2025-10-31T17:04:06Z I! Loaded aggregators:
2025-10-31T17:04:06Z I! Loaded processors:
2025-10-31T17:04:06Z I! Loaded secretstores:
2025-10-31T17:04:06Z I! Loaded outputs: influxdb_v2
2025-10-31T17:04:06Z I! Tags enabled: host=influxdb
2025-10-31T17:04:06Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:“influxdb”, Flush Interval:10s
2025-10-31T17:04:06Z W! [agent] The default value of ‘skip_processors_after_aggregators’ will change to ‘true’ with Telegraf v1.40.0! If you need the current default behavior, please explicitly set the option to ‘false’!
2025-10-31T17:04:06Z D! [agent] Initializing plugins
2025-10-31T17:04:06Z D! [agent] Connecting outputs
2025-10-31T17:04:06Z D! [agent] Attempting connection to [outputs.influxdb_v2]
2025-10-31T17:04:06Z D! [agent] Successfully connected to outputs.influxdb_v2
2025-10-31T17:04:06Z D! [agent] Starting service inputs
2025-10-31T17:04:06Z I! [inputs.mqtt_consumer] Connected [tcp://192.168.10.214:1883]
2025-10-31T17:04:16Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics

Are there any hints to find my mistake?
I’m very new with influx so please be lenient :wink:

Greetings
Eric

Er, what mistake?

You haven’t actually said what your problem is.

Antony.

the influx database has no records…
2025-10-31T17:04:16Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics

seems the problem is the point (.) in the tag…
(according to https://jsonlint.com/ the tags are valid)
To proof just use this input.json

{
“convertinttostring”: 1,
“explicitinttype”: 1,
“defaultinttype”: 2,
“convertstringtoint”: “4”,
“1_1”: “5”,
“1.1”: “6”
}

and this config:

# Example taken from: https://github.com/influxdata/telegraf/issues/7097
 [[inputs.file]]
    files = ["/root/.testdata/input.json"]
    data_format = "json_v2"
    [[inputs.file.json_v2]]
# Parse int types from JSON
[[inputs.file]]
    files = ["/root/.testdata/input.json"]
    data_format = "json_v2"
    [[inputs.file.json_v2]]
        [[inputs.file.json_v2.field]]
        rename = "explicitinttypeName"
        path = "explicitinttype"
        type = "int"
        [[inputs.file.json_v2.field]]
        rename = "convertstringtointName"
        path = "convertstringtoint"
        type = "int"
        [[inputs.file.json_v2.field]]
        rename = "converttesttointName"
        path = "1_1"
        type = "int"

there is the correct output:
file,host=influxdb explicitinttypeName=1i,convertstringtointName=4i,converttesttointName=5i 1762165918000000000​

now change in the config path = “1_1” to path = “1.1”

and you get an error: could not parse “/root/.testdata/input.json”: the path “1.1” doesn’t exist

could you confirm this bug and maybee offer a hint or workaraound. The MQTT output can’t be changed, unfortunatly"…

Greetings from Autria

Eric

could you confirm this bug and maybee offer a hint or workaraound. The MQTT output can’t be changed, unfortunatly"…