Something like this (untested):
[{"id":"8dfd24a16e6c5681","type":"mqtt in","z":"bdd7be38.d3b55","name":"","topic":"topic/#","qos":"0","datatype":"auto","broker":"adf2dac3.b20fe8","nl":false,"rap":true,"rh":0,"inputs":0,"x":140,"y":1100,"wires":[["3404edf6b96a9e86"]]},{"id":"3404edf6b96a9e86","type":"function","z":"bdd7be38.d3b55","name":"Prepare for influx","func":"// topic is in the form sometopic/ID/tag\n// value in payload\n// split topic into parts\nconst parts = msg.topic.split(\"/\")\n// tag is in last element, ID in one before\nconst tag = parts[parts.length-1]\nconst ID = parts[parts.length-2]\n// build data for influx\nmsg.payload = [{value: msg.payload}, {ID: ID, tag: tag} ]\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":310,"y":1100,"wires":[["b2e1354b1b926362"]]},{"id":"b2e1354b1b926362","type":"influxdb out","z":"bdd7be38.d3b55","influxdb":"b0493664.35a528","name":"","measurement":"the_measurement","precision":"","retentionPolicy":"","database":"the_database","precisionV18FluxV20":"ms","retentionPolicyV18Flux":"","org":"organisation","bucket":"bucket","x":620,"y":1100,"wires":[]},{"id":"adf2dac3.b20fe8","type":"mqtt-broker","name":"","broker":"localhost","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""},{"id":"b0493664.35a528","type":"influxdb","hostname":"localhost","port":"8086","protocol":"http","database":"Testing","name":"","usetls":false,"tls":"ced18875.cf10b8","influxdbVersion":"1.x","url":"http://localhost:8086","rejectUnauthorized":true},{"id":"ced18875.cf10b8","type":"tls-config","name":"","cert":"","key":"","ca":"","certname":"","keyname":"","caname":"","servername":"","verifyservercert":true}]