Can transactions be intermingled in the log file, or will all details of a transaction be on adjacent lines, and all adjacent lines belong to the same transaction, or mark the boundary to the next transaction?
Does a transaction always start with the "give" and "take" stuff? Does a transaction always end with the "Waiting for new txns" line?
Code:
vnix$ perl -ne 'if (/give ([^,]*), take ([^,]*), transaction submitted/) { $give = $1; $take = $2; }
if (/Waiting for new txns/) { $give = $take = undef; }
if (/, ([^,]*), [^,]*, This is not a valid/) { print "UPPERCASE: $1 ($give, $take)\n"}' /tmp/txn
UPPERCASE: USERNAME (ABC, XYZ)
UPPERCASE: SOMEONE (STE, GVO)