I have some log outputs that looks like this:
<DEBUG> 01-Jan-1970::01:01:01.012 JavaClassName Lala-Worker-Thread-0: - This line contains information
<DEBUG> 01-Jan-1970::01:01:01.012 JavaClassName Lala-Worker-Thread-0: - Result received: 'com.lala.lulu.SomeClass@13579ace'
I'd like to prune this output to
<DEBUG> - This line contains information
<DEBUG> - Result received: 'com.lala.lulu.SomeClass@13579ace'
I've found something that sort of works but sometimes does stuff that I don't want, so I want to "quality proof" it a bit:
$ sed -r 's/(<[A-Z]+>)(.*:)/\1/g' theLogFile
<DEBUG> - This line contains information
<DEBUG> 'com.lala.lulu.SomeClass@13579ace'
Who knows what else my regex is capable of (in a bad way), so what's a better solution? This works better but seems kind of dumb, specifying the dash in a group in a way that "removes it", and then add it back manually:
sed -r 's/(<[A-Z]+>)(.*: - )(.*)/\1 - \3/g'
Anyway, advice, anyone? Thank you.