I understand Response headers will be:
Response headers:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-Wf-1-1-1-31: 610|[{"Type":"LOG","File":"somescript.php","Line":7},{"duration":"1.7108917236328 ms","notes":{"invokation":["Solr_Connector::exec","somescript2.php line : 42"],"size_download":"2167 bytes","query":"...url data ..."},"name":"[tag1][tag2]SOLR REQUEST 1382626844.906"}]|
X-Wf-1-1-1-32: 611|[{"Type":"LOG","File":"somescript.php","Line":7},{"duration":"1.7011165618896 ms","notes":{"invokation":["Solr_Connector::exec","somescript2.php line : 42"],"size_download":"2590 bytes","query":"...url data ..."},"name":"[tag1][tag3]SOLR REQUEST 1382626844.9079"}]
...
Organize the Test Plan this way:
- Regextractor will extract headers to variables called headers_1, headers_2...
- For Each Controller will iterator over headers_i and expose header variable
- JSR223 Sampler using Groovy will write header (exposed by For EachController) to file
Code:
import org.apache.commons.io.FileUtils;
FileUtils.write(new File("/results.csv"), vars["header"]+"\r\n","UTF-8", true);
PS : Not sure it's a good idea to modify response to put this kind of info as it will disturb performances of initial application .