1

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

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

2
  • 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! 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
    Oct 25, 2018 at 8:41

Your Answer

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

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