Can I use logparser extract_token with a separator that is ignoring that separator when in quoted strings

256 Views Asked by At

I'm trying to use logparser to quickly get numbers on JMeter test results. When I run logparser on this I see a warning "WARNING: Input format not specified - using TEXTLINE input format."

This is the beginning of that file (do note that the first responseMessage result is in quoted strings : "WEB TEST health-check, security, profile", also label has this a lot of times) :

timeStamp,elapsed,label,responseCode,responseMessage,threadName,dataType,success,failureMessage,bytes,sentBytes,grpThreads,allThreads,URL,Latency,IdleTime,Connect
1602685052336,190,Authenticatie,200,OK,"WEB TEST health-check, security, profile",text,true,,10477,2486,2,4,https://test.tst.com/wui/test?637382890526559730,147,0,42

I order to group these by "responseCode" and get a cound by responseCode I think I need to use the extract_token function: EXTRACT_TOKEN( argument <STRING>, index <INTEGER> [ , separator <STRING> ] )

Currently I try something like this :

logparser -o:csv "SELECT extract_token(text, 3, ',') as responseCode, count(*) INTO counts.TXT FROM JMeter_test3.txt GROUP BY responseCode"

I'm using the comma-separator in extract_token but this also breaks on the comma's in for instance "WEB TEST health-check, security, profile" Is there any way I can get Logparser to ignore comma's in quoted strings ?

1

There are 1 best solutions below

0
On

oooo --- never mind... Turns out I shouldn't use textline format with JMeter. Should have known this with the "warning Input format not specified"

Just save the file as *.csv file, (or specify -i:csv) and then

logparser -o:csv "SELECT responseCode, count(*) INTO counts.TXT FROM JMeter_test3.txt GROUP BY responseCode"