Importing Tasmota Sensor data to Influxdb

Hi, I’m running an ESP32 with tasmota to bridge BLE based measurements to an MQTT broker.

The MQTT message format is like

{"Time":"2023-07-25T10:08:37",
"Flora6204f8":{"mac":"c47c8d6204f8","Temperature":18.0,"Illuminance":851,"Moisture":18,"Fertility":98,"RSSI":-86},
"Flora60ebed":{"mac":"c47c8d60ebed","Temperature":19.6,"Illuminance":1220,"Moisture":15,"Fertility":90,"RSSI":-82},"TempUnit":"C"}

Basically I’d like to have two measurement series in Influxdb, one for Flora6204f8, one for Flora60ebed.
How can I use the JSON key as measurement name? I try to extract the key in the the JSON_V2 parser with ‘@this’ but I can’t get it to work. Here is the template so far:

[[inputs.mqtt_consumer]]
    servers = ["tcp://mosquitto:1883"]
    
    topics = [
       "tele/+/SENSOR",
    ]
   data_format = "json_v2"
      
  [[inputs.mqtt_consumer.json_v2]]
  	 # measurement_name_path="@this"
     [[inputs.mqtt_consumer.json_v2.object]]
        optional=true
        path = "Flora*"
        disable_prepend_keys = true 
        included_keys = ["Temperature","Illuminance","Moisture","Fertility","RSSI"] 

        [[inputs.mqtt_consumer.json_v2.object.field]] 
# Causes error loading config file /etc/telegraf/telegraf.conf: plugin inputs.mqtt_consumer: line 153: configuration specified the fields ["name"], but they weren't used
            path="@this"
            name="sensor"
        [inputs.mqtt_consumer.json_v2.object.fields]
            Temperature = "float"
            Illuminance = "float"
            Moisture = "float"
            Fertility="int"
            RSSI="int"
     [[inputs.mqtt_consumer.json_v2.object]]
        optional=true
        path = "LYWSD03*"
        disable_prepend_keys = true 
        included_keys = ["Temperature","Humidity","DewPoint","Battery","RSSI"]
         
        [inputs.mqtt_consumer.json_v2.object.fields] 
            Temperature = "float"
            Humidity = "float"
            DewPoint = "float"
            Battery="int"
            RSSI="int"

Maybe @srebhan has a better idea, but i would use the xpath parser for something like this:

[[inputs.file]]
  files = ["data"]
  data_format = "xpath_json"
  xpath_native_types = true

  [[inputs.file.xpath]]
    metric_selection = "child::*"
    field_selection = "*"

produces:

file Temperature=19.6,mac="c47c8d60ebed",Fertility=90,Illuminance=1220,Moisture=15,RSSI=-82 1690290527000000000
file Fertility=98,Illuminance=851,Moisture=18,RSSI=-86,Temperature=18,mac="c47c8d6204f8" 1690290527000000000

You can continue to refine this