Correlation using JAVA DSL


The above code is throwing an error stating

jmesPath($.data.trackCode).find.transform.exists extraction crashed: i.b.j.p.ParseException: Unable to compile expression "$.data.trackCode": syntax error token recognition error at: '$' at position 0, syntax error extraneous input '.' expecting {'!', '(', '*', '[', '{', '[?', '@', '', RAW_STRING, JSON_CONSTANT, NAME, STRING} at position 1`

I like to extract the trackCode from below response and save it to variable say “trackCode”:
Response Body

Expected Result: trackCode=XYZ

Also, could someone please share the Gatling cheat sheet URL or user guide with a few correlation examples?


jmesPath is not jsonPath

Try with jmesPath("data.trackCode") instead.


1 Like

Also, here’s the reference website for JMESPath where you can learn the proper syntax:

1 Like

Thanks @sbrevet and @slandelle . I will explore other ways for extracting like regex, json etc