Im trying to get a value (IP address) from a W3C logfile (kinda like a text file). This is what I have so far but with no luck:
Set filename=ex%date:~-2,4%%date:~-10,2%%date:~-7,2%.log
For /F "tokens=2 delims=: . " %%A in ('E:\WINDOWS\system32\LogFiles\MSFTPSVC6141885\%filename%') do (Set ip=%%A)
and the log file looks like:
# Software: Microsoft Internet Information Services 6.0 # Version: 1.0 #Date: 2009-01-10 20:58:16 #Fields: time c-ip cs-method cs-uri-stem sc-status sc-win32-status #20:58:16 10.10.1.111 [25]USER anonymous 331 0
so the IP adress is on the 5th line second column (10.10.1.111)
any feedback would be appreciated!