I have been using a simple macro for years that formats firewall logs for import into a database as delimited text. I recently upgraded the firewall (same company... new model) and they have made one annoying change to the log files. The added commas to separate port numbers in the comment field. I've been trying to reuse some of Mofi's great answers & samples but can' seem the get this part right.
I need to find and replace (with nothing) any commas that follow the phrase "TCP scanned port list". Example line:
06/06/2007 15:39:52.144 - Possible port scan dropped - 64.46.110.250, 80, WAN - 209.20.251.204, 5167, WAN - TCP scanned port list, 5085, 5143, 5143, 5143, 5143
would end up like this:
06/06/2007 15:39:52.144 - Possible port scan dropped - 64.46.110.250, 80, WAN - 209.20.251.204, 5167, WAN - TCP scanned port list 5085 5143 5143 5143 5143
So I need to lose the commas between the ports at the end but NOT after each IP number. From there I can reuse my existing macro code to format it the rest of the way.
I need to find and replace (with nothing) any commas that follow the phrase "TCP scanned port list". Example line:
06/06/2007 15:39:52.144 - Possible port scan dropped - 64.46.110.250, 80, WAN - 209.20.251.204, 5167, WAN - TCP scanned port list, 5085, 5143, 5143, 5143, 5143
would end up like this:
06/06/2007 15:39:52.144 - Possible port scan dropped - 64.46.110.250, 80, WAN - 209.20.251.204, 5167, WAN - TCP scanned port list 5085 5143 5143 5143 5143
So I need to lose the commas between the ports at the end but NOT after each IP number. From there I can reuse my existing macro code to format it the rest of the way.