Skip to main content
edited tags
Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 265
Source Link

How to Grep search a JTL Jmeter file for any 400 request in JTL file

At present we run scripts via JMETER on a Linux VM which runs in non GUI mode. When the JMETER test runs it send the results to an output file (JTL File). We then copy this file to our local Windows machine and convert the JTL to CSV to check easier for failures.

What I am trying to do is to search the JTL file that gets generated and look for any errors (these are identified by a (400, Bad Request) A snippet below is an example line of a failure in the JTL file.

1613036683919,43,Document has failed,400,Bad Request,Thread Group 1-1,text,false,,3844,1159,1,1

What I would like is for grep as an example to search the file for any Bad Request errors and only add the chunk of the line not the full line see below:

,Document has failed,400,Bad Request

Note: The Document has failed will change for different test but the text will always be enclosed in commas.

I would like this to be added to a Error.txt file which I can append to for different test and once all are complete send the whole result in an email.

I have a basic grep script which can look into the main part of a JTL to look for errors:

grep ,400, Test.jtl > Error.txt

I have got a script which can email the file out.

Any help is much apprecaited.