Need help trying to create an updated and filtered log

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
sxekjb
Posts: 16
Joined: 07 Nov 2009 19:13

Need help trying to create an updated and filtered log

#1 Post by sxekjb » 07 Nov 2009 19:26

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.

ghostmachine4
Posts: 319
Joined: 12 May 2006 01:13

#2 Post by ghostmachine4 » 07 Nov 2009 23:41

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.

Post Reply