Hi Scripting Guru's
Please can anyone help me. I am using this VBscript to count the number of entries for "default.aspx" within my IIS log files.
Dim oFso, oReg, sData, lCount
Const ForReading = 1, sPath = "C:\ex130725.log"
Set oReg = New RegExp
Set oFso = CreateObject("Scripting.FileSystemObject")
sData = oFso.OpenTextFile(sPath, ForReading).ReadAll
With oReg
.Global = True
.Pattern = "default.aspx" 'vbCrLf
'.Pattern = "\n" ' vbLf, UTF-8 encoded text file?
lCount = .Execute(sData).Count + 1
End With
WScript.Echo lCount
Set oFso = Nothing
Set oReg = NothingEach line in the log starts with the date/time entry "2013-07-25 00:23:25". I only wish to count and return the .Pattern search string that are found within a given date and time period. IE: 2013-07-25 14:23:25 to 2013-07-25 15:10:25.
Does anyone know of a way to do this - Thanks