title: Jmeter: Parsing JSON responses in BeanShell Prepocessor and store it in a variable
body: <p>Jmeter: How to extract &amp; store the accountID in a variable from response using BeanShell preprocessor ? Can we use JSON or regular expression for this.</p>
  
  <p><strong>My Response some what look like:</strong></p>
  
  <pre><code>    {
     "address":{
        "street1":"6550 Vallejo Street",
        "street2":"",
        "city":"Emeryville",
        "state":"CA",
        "zipcode":"98456",
        "country":"Uk"
     },
     "timezone":"US/Pacific-New",
     "reference":"fe_qa001",
     "token":"ns7h4rqVZegSZG6yZls6",
     "login":"fe_qa001@qa.com",
     "accountId":-9223372036762408565,
     "firstName":"qa029",
     "lastName":"svcqa",
     "email":"fe_qa001@qa.com",
     "component":[
        {
           "type":1,
           "reference":"12-1",
           "version":"1",
           "base":"Plastic",
           "zipcode":"94556",
           "bedsize":"high",
           "bed":false,
           "componentId":0,
           "code":"P5",
           "sku":"abcd",
           "serial":"1234",
           "purchaseDate":1372723200000,
           "chamber":2
        }
     ]
  }
  </code></pre>
  
  <p>I am a newbie to Jmeter. So can anyone help me here. The requirement is like exacting the account ID from the response given below and store it in a variable using BeanShell Preprocessor.</p>