gatling, clean jsonpath with regex

Hello,

I am working on a gatling loadtest and I’m very new to scala, in my scenario I have a post call returning some json, in the form:

{status: ‘ok’, redirect_to: “/properties/id” }

I need to retrieve and save the id for later reuse, and I’m not sure how to clean out the /properties/ part, I guess I should use a regex, but don’t know how to apply that,

here’s my check so far.

.check(jsonPath("$.redirect_to").saveAs(“property-slug”))

Hello,

You can use transform for this: https://gatling.io/docs/gatling/reference/current/http/check/#transforming

thanks, that made it.