gatling build in jsonPath can't parse json. Online tester succeeded

Hi gatling experts.
I try to parse JSON (attached below) with code

.check(jsonPath("$.[0].unit").is(“flow.flow-server.sandbox.${username}project.${username}.service”).saveAs(“unit”)) .check(jsonPath("$.[0].active").is(“active”).saveAs(“active”)) .check(jsonPath("$.[0].sub").is(“running”).saveAs(“sub”))

but it doesn’t work.
Online tester succeeded to parse this JSON with same matcher as mine. ( )
I saw that gatling uses jsonPath 0.6.1 ,and online one is 0.8.X (by Stephan Goessner).

May somebody please help me to parse this JSON.

[ { “unit”:“”, “machine”: “f374e9a176b341d4a8ee8db3cdfb2958/”, “active”: “active”, “sub”: “running”, “space”: “aaa.gatlinguser202project.gatlinguser202”, “@timestamp”: 1418285656070 }, { “unit”: “”, “machine”: “f374e9a176b341d4a8ee8db3cdfb2958/”, “active”: “active”, “sub”: “running”, “space”: “aaa.gatlinguser202project.gatlinguser202”, “@timestamp”: 1418285656070 } ]

Online tester succeeded to parse this JSON with same matcher as mine. ( )

Really? Because this online tester complains that your expressions are not
And indeed, the proper syntax is $[0].unit not $.[0].unit

Thank you Stephane. It Works fine.

Online jsonPath works also with ($.[0].unit) …just checked.

Ah, OK, it works with Stefan Goessner’s implementation, but not with the one from Flow Communication (default).
If even the spec’s original author is not capable of respecting his own spec… Javascript is such a crap…

Stephane Is exists any way to locate highlighted object in the JSON without running over JSONArray ? I can’t be sure that desired object always located in place [0] of array ?
Thanks for Advance.


Maybe something else? it doesn’t works.
I need to parse values of “active” and “sub” where unit =flow.flow-server.sandbox.gatlinguser202project.gatlinguser202.service.
JSONArray can contains 10 objects with different “unit” .

Thanks for advance.

This is log…
13:39:50.074 [WARN ] i.g.h.a.AsyncHandlerActor - Request ‘Check Connecting Mode is ready’ failed: jsonPath(…unit).find(0).is(flow.flow-server.sandbox.gatlinguser202project.gatlinguser202.service) failed, could not extract: could not extract : $' expected but .’ found