-1

I am trying to extract X-Atmosphere-tracking-id from the response body. I got the response in the following way:

40|41be6f15-2e19-4e1d-aaff-d4b92ae47e48|0||

Now I want to extract only:

41be6f15-2e19-4e1d-aaff-d4b92ae47e48

which is dynamically generated on every execution.

Also, It would be great if someone shares tips and tricks as well as reference videos/sites of load testing using JMeter for Vaading application.

Emma
  • 27,428
  • 11
  • 44
  • 69
  • If you need assistance with JMeter ask about JMeter specific. If you need assistance with Vaading ask about Vaading specific. I suggesting taking online courses for both products. – Dudi Boy May 27 '19 at 14:54
  • DudiBoy, thanks for your guidance. I am currently working on a project having Vaadin and Apache JMeter both. That is the reason I have added both tags. Please let me know in case, some modification is required. – anilransing May 28 '19 at 04:27

2 Answers2

1

Here, we might just want to simply use a list of chars:

(?:\|)([a-z0-9-]+)(?:\|)

The string that we wish to extract is in this capturing group:

([a-z0-9-]+)

with two boundaries in its left and right side:

(?:\|)

Based on The fourth bird's advice, we can also simplify our expression and remove the non-capturing groups:

\|([a-z0-9-]+)\|

RegEx Circuit

jex.im visualizes regular expressions:

enter image description here

DEMO

Emma
  • 27,428
  • 11
  • 44
  • 69
0

I suggest using simple awk script, parsing fields by | and extracting the 2nd field.

echo "40|41be6f15-2e19-4e1d-aaff-d4b92ae47e48|0||" | awk -F "|" '{print $2}'

Output

41be6f15-2e19-4e1d-aaff-d4b92ae47e48
Dudi Boy
  • 4,551
  • 1
  • 15
  • 30