'********************************************************************** ' Visual Basic ActiveX Script '************************************************************************ Function Main() Dim objFileSys : Set objFileSys = CreateObject("Scripting.FileSystemObject") Dim vPath : vPath = DTSGlobalVariables("gRootLogPath").Value Dim objInStream Dim objOutStream Dim vWrite, vLine
Set objInStream = objFileSys.OpenTextFile(vPath & "raw.txt")
Set objOutStream = objFileSys.CreateTextFile(vPath & "log.txt")
'
'Apache "common" log file: host ident authuser date request status bytes
'
Do Until objInStream.AtEndOfStream
vWrite = false
vLine = objInStream.ReadLine
If Instr(1,vLine,"/ HTTP") > 0 _
Or Instr(1,vLine,".css HTTP") > 0 _
Or Instr(1,vLine,".exe HTTP") > 0 _
Or Instr(1,vLine,".html HTTP") > 0 _
Or Instr(1,vLine,".js HTTP") > 0 _
Or Instr(1,vLine,".mov HTTP") > 0 _
Or Instr(1,vLine,".mp3 HTTP") > 0 _
Or Instr(1,vLine,".pdf HTTP") > 0 _
Or Instr(1,vLine,".swf HTTP") > 0 _
Then
If Instr(1,vLine,"not_found.html HTTP") = 0 _
And Instr(1,vLine, """GET" & Space(1)) > 0 _
Then vWrite = true
End If
If CBool(vWrite) Then objOutStream.WriteLine(vLine)
Loop
objInStream.Close
objOutStream.Close
Set objInStream = Nothing
Set objOutStream = Nothing
Set objFileSys = Nothing
Main = DTSTaskExecResult_Success
End Function