# Json\_v2 parse string

**URL:** <https://community.influxdata.com/t/json-v2-parse-string/22780>\
**Category:** Telegraf\
**Tags:** json\
**Created:** [December 1, 2021, 5:04pm UTC](https://community.influxdata.com/t/json-v2-parse-string/22780 "2021-12-01T17:04:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tmorissette](https://avatars.discourse-cdn.com/v4/letter/t/7ea924/32.png) [@Tmorissette](https://community.influxdata.com/u/Tmorissette)\
**Post date:** [December 1, 2021, 5:04pm UTC](https://community.influxdata.com/t/json-v2-parse-string/22780/1 "2021-12-01T17:04:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jay\_Clifford](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jay_clifford/32/8287_2.png) [@Jay\_Clifford](https://community.influxdata.com/u/Jay_Clifford)\
**Post date:** [December 2, 2021, 11:10am UTC](https://community.influxdata.com/t/json-v2-parse-string/22780/2 "2021-12-02T11:10:13Z")

</div>

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](https://github.com/influxdata/telegraf/blob/master/plugins/processors/starlark/testdata/json.star)

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