#166823 - 2006-09-06 09:03 PM
Re: Deleting Events from the .EVT file
|
Witto
MM club member
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
Is the file comma delilited or tab delimited? I thought you were looking for event 560? I think the EventID is on the sixth position. I think splitting the lines would give a more certain result. Code:
If Not Split($x,",")[5] = "560" ;If Not Split($x,Chr(9))[5] = "560" ;if TAB delimited ;Write stuff $x to file2.txt EndIf
|
Top
|
|
|
|
#166824 - 2006-09-06 09:08 PM
Re: Deleting Events from the .EVT file
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
Code:
$Handle1 = FreeFileHandle() $Handle2 = FreeFileHandle()
you can't do this! both handles are the same as you don't open the first file before querying the second handle.
|
Top
|
|
|
|
#166825 - 2006-09-06 11:13 PM
Re: Deleting Events from the .EVT file
|
Witto
MM club member
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
What about: Code:
If NOT @LOGONMODE Break ON EndIf Dim $SO $SO = SetOption("Explicit","On") $SO = SetOption("NoMacrosInStrings","On") $SO = SetOption("NoVarsInStrings","On") $SO = SetOption("WrapAtEOL","On")
Dim $InputFile, $OutputFile, $Handle1, $Handle2, $Line $InputFile = "file1.txt" $OutputFile = "file2.txt"
;Open first file for read, if fails, end code $Handle1 = FreeFileHandle() If Open($Handle1,$InputFile,2) = 0 ;Open second file for write, if fails, close first file, end code $Handle2 = FreeFileHandle() If Open($Handle2,$OutputFile,5) = 0 ;Read line after line until error code indicates there are no lines anymore $Line = ReadLine($Handle1) While @ERROR = 0 ;If NOT event 560 occurred, write line to second file If NOT Split($Line,",")[5] = "560" $SO = WriteLine($Handle2,$Line + Chr(13) + Chr(10)) EndIf $Line = ReadLine($Handle1) Loop ;Close files $SO = Close($Handle1) $SO = Close($Handle2) Else $SO = Close($Handle1) EndIf EndIf
Edited by Witto (2006-09-07 10:30 PM)
|
Top
|
|
|
|
#166826 - 2006-09-07 07:40 PM
Re: Deleting Events from the .EVT file
|
AstaaLavista
Starting to like KiXtart
Registered: 2005-08-11
Posts: 111
Loc: Gujarat, India.
|
Quote:
Is the file comma delilited or tab delimited? I thought you were looking for event 560? I think the EventID is on the sixth position. I think splitting the lines would give a more certain result.
The file is tab delimited I m actually looking for each ID individually. When the file size is reduced, it becomes easier to log. Splitting the lines also didnt help. actually the script is not able to read the input file; may be it because of UNICODE issue. (I used event viewer to generate a sample text file)
|
Top
|
|
|
|
#166830 - 2006-09-07 09:20 PM
Re: Deleting Events from the .EVT file
|
AstaaLavista
Starting to like KiXtart
Registered: 2005-08-11
Posts: 111
Loc: Gujarat, India.
|
Dear NTDOC, Microsoft tools read the event viewer & NOT the .evt file.I have been provided ONLY the .EVT file. Currently, my job is to check for specific EVENT IDs; for that i need to scan the ENTIRE .evt file. The .evt file contains around 10 million rows (around 700 MB) making my job really difficult. I tried to extract the event info to a text file, but it was of no help; i didnt get any correct results. It's already around 1 AM in India, need to go home....
|
Top
|
|
|
|
#166832 - 2006-09-07 10:27 PM
Re: Deleting Events from the .EVT file
|
Witto
MM club member
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
Well, I am sorry to hear my code did not work for you. I tried it on a very small comma delimited file (csv) that I extracted from my Event Viewer @home. I used KiX 4.53 RC-1. [Edit] I see I forgot to paste my declarations in my code, so I changed it. So check the code I posted earlier. Code:
Dim $InputFile, $OutputFile, $Handle1, $Handle2, $Line $InputFile = "file1.txt" $OutputFile = "file2.txt"
Edited by Witto (2006-09-07 10:32 PM)
|
Top
|
|
|
|
#166835 - 2006-09-08 11:32 AM
Re: Deleting Events from the .EVT file
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11624
Loc: CA
|
Maybe so... but we all know that as much as we love KiX there are still a couple things that other beast is better at until Ruud updates KiX to handle it.
|
Top
|
|
|
|
#166840 - 2006-09-08 06:49 PM
Re: Deleting Events from the .EVT file
|
AstaaLavista
Starting to like KiXtart
Registered: 2005-08-11
Posts: 111
Loc: Gujarat, India.
|
hmmm, sorry guys for the that mistake. Actually it is around 1-3 million rows. i was really sleepy & so added the EXTRA zero... yeah Witto , i tried with the formats - txt format (tab delimited) but of no help...
Les: Actually huge logs are being generated due to some nonsense things done by some folks. the net guys are not ready to make any corresponding changes to their policy, they have simply ask me to bear with it... currently, i m doing the process manually... once our audit is complete (5 days), i will definitely write an application that will help me & others to read an .EVT file.
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 761 anonymous users online.
|
|
|