Json_v2 parse string

Hi, this parser is really useful. I wonder if there’s a way to parse a string from a json object. For example, I would like to get only the waterflow_program variable from this json, but the objectJSON variable is a string and there’s no way I can edit it from the source:

“dr”:1
“fCnt”:97
“fPort”:11
“data”:”CgJoid/T/x4YCg7/AAAABQ==”
“objectJSON”:
“{\”activity_report_enabled\”:1
\”auto_test_enabled\”:1
\”system_params\”:\”ff1e180a0eff\”
\”valve_assert_program\”:10
\”waterflow_program\”:30}”
“tags”:{}
“confirmedUplink”:true
“devAddr”:”AYbnZg==”}

I didn’t find how to do it with gjson. Is there a way ?
thanks for your help

Hi @Tmorissette,
What you could try to do is use a Starlark processor plugin to take the string and convert to a JSON object: telegraf/json.star at master · influxdata/telegraf · GitHub

From there you could take the Waterflow variable and convert it into a new field.