Reputation: 407
I need to find all id
values where available":true
:
Formated for better readability:
{
"KEN":[
{
"name":"Mombasa",
"id":"MBA",
"available":false,
"group":[
],
"children":[
],
"countryName":"Kenya",
"countryCode":"KEN",
"synonym":""
}
],
...
}
Actual JSON string
{"KEN":[{"name":"Mombasa","id":"MBA","available":false,"group":[],"children":[],"countryName":"Kenya","countryCode":"KEN","synonym":""}],...
I have tried to parse it with the following regular expression
\{"name":".+?","id":"(.+?)","available":true,.+?,"synonym":""\}
but its not working.
I am using Regular Jmeter.
Upvotes: 1
Views: 121
Reputation: 168092
Use JSONPath Extractor available via JMeter Plugins
Relevant JSONPath query will look somehow like
.KEN.[?(@.available=='false')].id
See Using the XPath Extractor in JMeter guide (scroll down to "Parsing JSON") for instructions on plugin setup and some form of JSONPath language reference.
Upvotes: 1