TICK script parsing a JSON value string to separate fields

kapacitor
#1

The json string value {“humidity”: 70.721, “temperature”: 19.699}
I would like to extract the two key values, in a tick script in a way like this

var view1 = batch

|query(’’‘SELECT “key”, “value” FROM “influxdb1”.“autogen”.“sensors” ‘’’)
.period(1m)
.every(10s)
|httpOut(‘views1’)
|last(‘key’)
|eval(lambda: ‘{{ index .Fields “humidty”}}’ , lambda: '{{ index .Fields “temperature”}}
.as (“humidity”, “temperature”)
|httpOut(‘views2’)

Kapacitor is V1.4.

I’m sure there is aneasy way to parse json, but after 2 days of searching I am unable to find the a solution. Thank you if anyone can please point me in the right direction.

My influxdb stream is the following format, a JSON string representing two measurements

{“series”:[{“name”:“sensors”,“columns”:[“time”,“last”,“value”],“values”:[[“2018-09-11T01:51:30.176842405Z”,“htu21d”,"{“humidity”: 70.721, “temperature”: 19.699}"]]}]}