I have been looking around and getting stuck. I have a smile batch file to track how many open connections are on a webserver.
echo %time% >>connections.log
netstat -an | find "80" | find /C "ESTABLISHED" >>connections.log
timeout /t 15
The connections.log file comes out like this: (on my personal PC)
I also have another batch that starts at 23:59 each day that renames the connections.log to the date.
What I would like to do is have the output file with no CR/LF so I could format it to be a CSV.
The problem I have is trying to get the netstat output into the form of a variable if I could then all I need to do is change the echo line after the netstat and set it to:
echo %time%,%concvar% >>connections.log
If anyone knows if this can be done please let me know.