This is an old question but I was struggling with this problem and this is my solution. In the case asked here
{"id":"blah id", "name":"blah name"}
you can solve it with JSON Extractor Post-processor. In my experience, I wasn't able to use two Post-processors.
This is the post-processor that works to obtain id and name:
In JSON Path expressions you write:
$.["id", "name"]
Then testVar2 will have the value (from debug sampler):
testVar2_1={"name":"blah name","id":"blah id"}
testVar2_matchNr=1
However I wasn't able to use a JSON Extractor post-processor for a json response like:
{"id":"blah id", "other" : {"name":"blah name"}}
In this case I had to use a BeanShell PostProcessor with a script like this:
import net.minidev.json.parser.JSONParser;
import net.minidev.json.JSONObject;
import net.minidev.json.JSONArray;
JSONParser p = new JSONParser(JSONParser.MODE_PERMISSIVE);
String jsonString = prev.getResponseDataAsString();
JSONObject jsonObj = (JSONObject) p.parse(jsonString);
String idString = (String) jsonObj.get("id");
JSONObject otherJSONObject = jsonObj.get("other");
String nameString = (String) otherJSONObject.get("name");
log.info("ID:" + idString);
log.info("NAME:" + nameString);
vars.put("IDVAR", idString);
vars.put("NAMEVAR", nameString);