I want to extract the exact string from the JSON response in Jmeter JSON extractor so below is the sample JSON payload-
{
"resource":[
{
"id":"de04c6b1-a5a3-11ec-a02b-765e38f104a5-19",
"name":"Tokyo-1-1-13",
"service_name":"Tokyo-1-1-13_service",
"oper_state":"UP",
"type":"admin"
},
{
"id":"me05c6b1-a903-11ec-a02b-764313f104a5-19",
"name":"Tokyo-1-1-1",
"service_name":"Tokyo-1-1-1_service",
"oper_state":"UP",
"type":"admin"
},
{
"id":"5e04c691-a5a3-11ec-a02b-765e38f3q4a5-19",
"name":"Tokyo-1-1-14_service",
"service_name":"Tokyo-1-1-14_service",
"oper_state":"DOWN",
"type":"admin"
}
]}
So from the above JSON payload, I want to extract "oper_state" of a resource where "name":"Tokyo-1-1-1" and I'm using "$.resource[?(@.name=="Tokyo-1-1-1")].oper_state", but it is matching with the "Tokyo-1-1-13" and giving me the oper_state of this particular name, because "Tokyo-1-1-13" has "Tokyo-1-1-1" in it. Please help me to extract the exact data.