Search code examples
jmeterpost-processingjson-path-expression

Can I use the JMeter result of Json Path Expression in Json Regex Extractor to extract only a part of the result?


The Json Path Expression returns something like: "folder/subfolder/123456".

I only need the "123456", is it possible to extraxt that with the regular Expression extractor based on the result of the Json Path Extractor?

Or another way would be awesome too!


Solution

  • If you have this folder/subfolder/123456 stored in a JMeter Variable called i.e. someVariable

    enter image description here

    you can extract the numeric part as follows:

    enter image description here

    Demo:

    enter image description here

    Just make sure to put the Regular Expression Extractor below the JSON Extractor as the Post-Processors are being executed upside down and the JSON Extractor needs to be first

    More information: