title: Testing HLS using JMeter
body: <p>I am using JMeter to test HLS playback from a Streaming Server. So, the first HTTP request is for a master manifest file(m3u8). Say,</p>
  
  <pre><code>http://myserver/application1/subpath1/file1.m3u8</code></pre>
  
  <p>The reply to this will result in a playlist something like,</p>
  
  <pre><code>subsubFolder/360p/file1.m3u8
  subsubFolder/480p/file1.m3u8
  subsubFolder/720p/file1.m3u8
  </code></pre>
  
  <p>So, next set of URLs become </p>
  
  <pre><code>http://myserver/application1/subpath1/subsubFolder/360p/file1.m3u8
  http://myserver/application1/subpath1/subsubFolder/480p/file1.m3u8
  http://myserver/application1/subpath1/subsubFolder/720p/file1.m3u8
  </code></pre>
  
  <p>Now, individual reply to these further will be an index of chunks, like</p>
  
  <pre><code>0/file1.ts
  1/file1.ts
  2/file2.ts
  3/file3.ts</code></pre>
  
  <p>Again, we have next set of URLs as</p>
  
  <pre><code>http://myserver/application1/subpath1/subsubFolder/360p/0/file1.ts
  http://myserver/application1/subpath1/subsubFolder/360p/1/file1.ts
  http://myserver/application1/subpath1/subsubFolder/360p/2/file1.ts
  http://myserver/application1/subpath1/subsubFolder/360p/3/file1.ts
  </code></pre>
  
  <p>This is just the case of one set(360p). There will be 2 more sets like these(for 480p, 720p).</p>
  
  <p>I hope the requirement statement is clear uptill this.<br/>
  <strong>Now, the problem statement.</strong></p>
  
  <p>Using <code><a href="http://myserver/application1" rel="nofollow">http://myserver/application1</a></code> as static part, regex(.+?).m3u8 is applied at 1st reply which gives <code>subpath1/subsubFolder/360p/file1</code>. This, is then added to the static part again, to get <code><a href="http://myserver/application1/subpath1/subsubFolder/360p/file1" rel="nofollow">http://myserver/application1/subpath1/subsubFolder/360p/file1</a> + .m3u8</code>
  The problem comes at the next stage. As, you can see, with parts extracted previously, all I'm getting is</p>
  
  <pre><code>http://myserver/application1/subpath1/subsubFolder/360p/file1/0/file1.ts</code></pre>
  
  <p>The problem is obvious, an extra file1, <strong>360p/file1</strong> in place of <strong>360p/0</strong>. </p>
  
  <p>Any suggestions, inputs or alternate approaches appreciated.</p>