Renaming parenthesis in DNS log file to a .

June 22, 2011 at 08:35:39
Specs: Windows 7
I am attempting to change characters within a DNS log file from (4)tick(7)usnogps(4)navy(3)mil(0) to tick.usnogps.navy.mil yet running into problems in that both characters are considered special characters within DOS scripts.

My file is basic DNS.log file with various strings with DNS entries. I need to be able to parse this log file out to a simple DNS entry that appears clean. This is merely one of the few steps I must go through in parsing this to a SIEM product.

Thank you
Ben


See More: Renaming parenthesis in DNS log file to a .

Report •


#1
June 24, 2011 at 07:56:32
Appears to be a lot missing in this request, (my appologies).
I would like ot create a DOS batch script with commands available in typical Windows 2003.
Here was an attempt:
@echo off > newfile & setLocal enableDELAYedexpansion

set old=(*)
set new=.

for /f "tookens=* delims= " %%a in dns.log do (


Report •

#2
June 24, 2011 at 07:58:42
@echo off > newfile & setLocal enableDELAYedexpansion

set old=(*)
set new=.

for /f "tookens=* delims= " %%a in dns.log do (
set str=%%a
echo %%str
set str=!str:%old%=%new%!
>> dns1.log echo !str!
)


Report •

Related Solutions


Ask Question