Is there a way to only parse the first sub sample of a HTTP Request?

I have request that gives two sub samples. The first sub sample is 302 that redirects to the second sub sample. In the first sub sample there is a header named X-Log-Session-Id that I try to extract but the header does not exists in the second sub sample. My Regular Expression Extractor overwrites the value from the first sub sample with the default value when the second sample is parsed.

I have extractor set to apply to Sub-samples only and Match No. to 1. The default value is set to Use empty default value.

enter image description here

1 Answer 1


The problem was that I was using a an empty default and that my regex was wrong.

The regex was supposed to be X-Log-Session-Id: (.+?)\n

  • I'm glad you posted the answer yourself post self realisation. Would appreciate if you begin with looking for questions on this platform for problems like these, there are already enough questions here on this very subject. Thanks! Commented Oct 24, 2018 at 8:21
  • O really? The 8 results on site on the query "jmeter extract headers" Gives nothing on extract headers. Found some on Stack overflow but wrote there expression like this header=(.+?); Hence it did not work for me.
    – Olof
    Commented Oct 25, 2018 at 8:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.