I'm trying to create a script to get all the Apache response after specific word "statusDescription", but I have a problem that I got the output duplicated for some rows as matched word or response maybe written 2 times @ the same line
Sample of log "1 line":
GET/en?status=1&newMainBalance=5486&serviceAmount=700&ExternalTrxId=asdf&PgTrxId=tfpsadf&amount=0&statusDescription=Failed&customerCode=1.1&newDedicatedBalance=0&secureHash=56a7sdyf&paidAmount=1000&responseMsg=%a1%a1%A1(PG_ID)&language=enHTTP/1.1"200186243**1/1210669**1"-""-""-""https://example.com.eg?statusDescription=Failed&externalTrxId=123&status=203&secureHash=asdf&pgTrxId=asdf
i tried the below command to get any match between "statusDescription" and "&"
cat test.txt | perl -nle'print $1 while /statusDescription(.*?)\&/g'
cat test.txt | perl -nle'print $1 while /statusDescription(.*?)\&/g'
output:
=Failed
=Failed
i except the result to be 1 line only like
=Failed
or
=Failed=Failed