Page 1 of 1

Need help trying to create an updated and filtered log

Posted: 07 Nov 2009 19:26
by sxekjb
I'm trying to schedule a batch that executes and logs netstat -abn, but also filters the results while keeping the same contents of the original log, basically updating the log.

For example: right now it logs all of the results, including items I don't care for, such as connections established with AV software and my web browser; and everytime it's done, of course it replaces the old log with the new results.

It's a little more complex than I've gotten with DOS, and so far I've gone through trying to include the FOR command to filter through the log/command output, but I haven't figured out (if even possible) how to remove the lines that show the connections I don't need. I've also gone through using SET to put in some variables, but like I said it's a little more complex than I've don't with dos.

I apologize I don't have any command strings I've tried so far, but if someone could point me in the right direction that would be great. Thanks

*Edit: Answered my own q, messed around some more with piping and FIND /v /i to filter it to exactly what I need.

Posted: 07 Nov 2009 23:41
by ghostmachine4
use a good string/text/ manipulation tool to filter your log. Show a sample of your log, and what you don't need, and show your final log output.