Hello Scripting Experts,
I have an application which will write below log file automatically with the name of “CoreAPP.txt“
my Sample of “CoreAPP.txt“:
I am looking to place a logic with in my script to catch the below text from the log file and output to a file with the computer Name and error message. Below are key errors in the “CoreAPP.txt“ file; if any found in current date there is something wrong and I need to fix Manually.
The aim of the script is to report the below errors if found on current date in the “CoreAPP.txt“ file.
1. The Application Virtualization Client could not connect to stream
2. XML parsing failure (rc 00000A25-00000002)
3. corrupt cp file detected
4. The client was unable to connect
5. Virtualization Client cannot open Application Integration
6. Could not load OSD file
Below is my VBscript:
The script reads the computers information from list.txt file.
Sample of list.txt
CoreAPP.txt file will be there on above (list.txt) server. And the Path is D:\ LOGFILES \CoreAPP.txt
The problem with the current script is script looking for entire file, instead of current date (today is 11/2/2012 but my script showing the output of 11/1/2012 & 10/31/2012 also) information. I mean the script writing output with regardless of Date check this resulting output with past date and current date text in the error.log.
Looking for help!!!!!!!!!!
I have an application which will write below log file automatically with the name of “CoreAPP.txt“
my Sample of “CoreAPP.txt“:
Code:
[10/31/2012 19:53:41:889 SWAP INF] {hap=CB2:app=Internet Explorer_b1 6.0.3790.3959:tid=22C0:usr=B9D327}
Elapsed time for upload: 0.718 seconds
[10/31/2012 19:53:42:639 SWAP INF] {hap=CB2:app=Internet Explorer_b1 6.0.3790.3959:tid=22C0:usr=V9V327}
Elapsed time for launch: 3.250 seconds
[10/31/2012 19:56:37:815 ???? INF] {tid=4004:usr=V47235}
An error occurred while opening the virtual registry (section: 9), rc: 07B01F0C-0000004A
[10/31/2012 19:56:37:846 ???? INF] {tid=4004}
An error occurred while opening the virtual registry (section: 9), rc: 07B01F0C-0000004A
[10/31/2012 10:45:00:576 ???? INF] {tid=1650}
An error occurred while opening the virtual registry (section: 9), rc: 07B01F0C-0000004A
ElapR
The Application Virtualization Client could not connect to stream URL 'RTSP://SRVW23E:554/V1321_BDP_V1_R1_SB/V1321_BDP_C1_P2PM_SS.sft' (rc 1690900A-00002002, original rc 1690900A-00002002).
[10/31/2012 00:29:59:843 OSDF ERR] {tid=1464}
The Application Virtualization Client could not parse the OSD file 'C:\SoftCache\SoftGrid Client\OSD Cache\edCc4305-3f6C-4dcc-3d70-404eb8bd97d8.osd'. Reason: XML parsing failure (rc 00000A25-00000002)
[10/31/2012 08:24:35:869 ???? ERR] {tid=336C:usr=t405230}
corrupt cp file detected ('V:\V1321_BDP\osguard.cp'). osguard cp file, NO CORRECTIVE ACTION TAKEN
[10/31/2012 22:16:39:240 JGSW ERR] {hap=1C82:app=bDP c15 E2AM SS 1.0:tid=3D58}
The Application Virtualization Client could not connect to stream URL 'RTSP://PSWQAPP1:554/V14678993_BDP_C15_E2AM_SS/V14678993_BDP_C15_E2AM_SS.sft' (rc 1690900A-00002002, original rc 1690900A-00002002).
[10/31/2012 22:16:39:240 SWAP ERR] {hap=1C82:app=bDP c15 E2AM SS 1.0:tid=3D58}
The client was unable to connect to an Application Virtualization Server (rc 1690900A-00002002)
[10/31/2012 22:17:09:163 AMGR ERR] {tid=4F54}
The specified application name (Application Integration) is ambiguous. Some potential matches:
Application Integration 7.0.1756.1756
Application Integration 9.2.2373.2373
[10/31/2012 22:17:09:163 AMGR ERR] {tid=4F54}
The Application Virtualization Client cannot open Application Integration
[10/31/2012 00:03:14:313 SWAP WRN] {tid=507C:usr=N28712}
Could not load OSD file \\PSWQAPP1\Content\D1311_bDP_Adobe_Reader_9.3.3\D1311_bDP_Adobe_Reader 9.3.3.osd
[10/31/2012 00:03:14:313 AMGR INF] {tid=507C:usr=i435145}
The app manager could not create an application from '\\PSWQAPP1\Content\D1311_bDP_Adob_dobe_Reader_9.3.3\D1311_bDP_Adob_b_Adobe Reader 9.3.3.osd' (rc 0C405664-00000002).
====
[10/31/2012 13:35:16:987 JGSW ERR] {hap=1:app=Abaculus 1.0.0.1:tid=14C8:usr=R3R7DF42}
The Application Virtualization Client could not connect to stream URL 'RTSP:%SFT_SRV%:554/D1311_bDP_Adob_b_Adobe_Abaculus_15_01/D1311_bDP_Adob_b_Adobe_Abaculus_15_01.sft' (rc 19D02E0A-10000002, original rc 19D02E0A-10000002).
[10/31/2012 13:35:47:998 SWAP ERR] {hap=2:app=AboutPI-SDK 1.3.0.26:tid=1568:usr=I337721}
Could not load app
[10/31/2012 19:56:37:862 SWAP INF] {hap=CB3:app=Adobe Reader X 10.0.1.434:tid=4004:usr=V47235}
Elapsed time for upload: 0.609 seconds
[10/31/2012 19:56:38:393 SWAP INF] {hap=CB3:app=Adobe Reader X 10.0.1.434:tid=4004:usr=V47236}
Elapsed time for launch: 1.187 seconds
[10/31/2012 19:56:57:487 SWAP INF] {hap=CB3:app=Adobe Reader X 10.0.1.434:tid=4004:usr=V47234}
App shut down
[10/31/2012 20:01:40:745 ???? INF] {tid=327C:usr=V42235}
An error occurred while opening the virtual registry (section: 9), rc: 07B01F0C-0000004A
[10/31/2012 20:01:40:776 ???? INF] {tid=327C}
An error occurred while opening the virtual registry (section: 9), rc: 07B01F0C-0000004A
[10/31/2012 20:01:40:776 SWAP INF] {hap=CB4:app=Adobe Reader X 10.0.1.434:tid=327C:usr=V422357235}
Elapsed time for upload: 0.609 seconds
[11/01/2012 16:48:44:157 SWAP INF] {hap=11A4:app=Lotus Notes_b1 6.5.40.5086:tid=361C:usr=A422353001}
Elapsed time for launch: 5.219 seconds
[11/01/2012 16:50:21:003 ???? INF] {tid=32D8:usr=W8WS83}
An error occurred while opening the virtual registry (section: 9), rc: 07B01F0C-0000004A
[11/01/2012 16:50:21:066 ???? INF] {tid=32D8}
An error occurred while opening the virtual registry (section: 9), rc: 07B01F0C-0000004A
[11/01/2012 16:50:21:082 SWAP INF] {hap=11A5:app=Adobe Reader X 10.0.1.434:tid=32D8:usr=W8WS83}
Elapsed time for upload: 0.703 seconds
[11/01/2012 16:50:22:503 SWAP INF] {hap=11A5:app=Adobe Reader X 10.0.1.434:tid=32D8:usr=W8WS83}
Elapsed time for launch: 2.218 seconds
[11/01/2012 16:50:50:395 SWAP INF] {hap=11A5:app=Adobe Reader X 10.0.1.434:tid=32D8:usr=A422353001}
App shut down
[11/01/2012 16:53:24:367 ???? INF] {tid=1F80:usr=t405230}
An error occurred while opening the virtual registry (section: 9), rc: 07B01F0C-0000004A
[11/01/2012 16:53:24:383 ???? INF] {tid=1F80}
An error occurred while opening the virtual registry (section: 9), rc: 07B01F0C-0000004A
[11/01/2012 16:53:24:383 SWAP INF] {hap=11A6:app=Show Desktop 1.0:tid=1F80:usr=A422353001}
Elapsed time for upload: 0.531 seconds
[11/01/2012 16:53:24:727 SWAP INF] {hap=11A7:app=Microsoft Office Excel 2003_b1 11.0.8324.1:tid=251C:usr=V422357235}
Elapsed time for upload: 0.0 seconds
[11/01/2012 16:53:24:758 SWAP INF] {hap=11A6:app=Show Desktop 1.0:tid=1F80:usr=V47234}
Elapsed time for launch: 1.78 seconds
[11/01/2012 16:53:25:117 SWAP INF] {hap=11A6:app=Show Desktop 1.0:tid=1F80:usr=V422357235}
App shut down
[11/01/2012 10:45:00:576 ???? INF] {tid=1650}
An error occurred while opening the virtual registry (section: 9), rc: 07B01F0C-0000004A
ElapR
The Application Virtualization Client could not connect to stream URL 'RTSP://SRVW23E:554/V1321_BDP_V1_R1_SB/V1321_BDP_C1_P2PM_SS.sft' (rc 1690900A-00002002, original rc 1690900A-00002002).
[11/01/2012 00:29:59:843 OSDF ERR] {tid=1464}
The Application Virtualization Client could not parse the OSD file 'C:\SoftCache\SoftGrid Client\OSD Cache\edCc4305-3f6C-4dcc-3d70-404eb8bd97d8.osd'. Reason: XML parsing failure (rc 00000A25-00000002)
[11/01/2012 08:24:35:869 ???? ERR] {tid=336C:usr=t405230}
corrupt cp file detected ('V:\V1321_BDP\osguard.cp'). osguard cp file, NO CORRECTIVE ACTION TAKEN
[11/01/2012 22:16:39:240 JGSW ERR] {hap=1C82:app=bDP c15 E2AM SS 1.0:tid=3D58}
The Application Virtualization Client could not connect to stream URL 'RTSP://PSWQAPP1:554/V14678993_BDP_C15_E2AM_SS/V14678993_BDP_C15_E2AM_SS.sft' (rc 1690900A-00002002, original rc 1690900A-00002002).
[11/01/2012 22:16:39:240 SWAP ERR] {hap=1C82:app=bDP c15 E2AM SS 1.0:tid=3D58}
The client was unable to connect to an Application Virtualization Server (rc 1690900A-00002002)
[11/01/2012 22:17:09:163 AMGR ERR] {tid=4F54}
The specified application name (Application Integration) is ambiguous. Some potential matches:
Application Integration 7.0.1756.1756
Application Integration 9.2.2373.2373
[11/01/2012 22:17:09:163 AMGR ERR] {tid=4F54}
The Application Virtualization Client cannot open Application Integration
[11/01/2012 00:03:14:313 SWAP WRN] {tid=507C:usr=N28712}
Could not load OSD file \\PSWQAPP1\Content\D1311_bDP_Adobe_Reader_9.3.3\D1311_bDP_Adobe_Reader 9.3.3.osd
[11/01/2012 00:03:14:313 AMGR INF] {tid=507C:usr=i435145}
The app manager could not create an application from '\\PSWQAPP1\Content\D1311_bDP_Adob_dobe_Reader_9.3.3\D1311_bDP_Adob_b_Adobe Reader 9.3.3.osd' (rc 0C405664-00000002).
====
[11/01/2012 13:35:16:987 JGSW ERR] {hap=1:app=Abaculus 1.0.0.1:tid=14C8:usr=R3R7DF42}
The Application Virtualization Client could not connect to stream URL 'RTSP:%SFT_SRV%:554/D1311_bDP_Adob_b_Adobe_Abaculus_15_01/D1311_bDP_Adob_b_Adobe_Abaculus_15_01.sft' (rc 19D02E0A-10000002, original rc 19D02E0A-10000002).
[11/01/2012 13:35:47:998 SWAP ERR] {hap=2:app=AboutPI-SDK 1.3.0.26:tid=1568:usr=I337721}
Could not load app
[11/01/2012 16:53:25:399 SWAP INF] {hap=11A7:app=Microsoft Office Excel 2003_b1 11.0.8324.1:tid=251C:usr=V47234}
Elapsed time for launch: 0.891 seconds
[11/02/2012 10:43:37:527 SWAP INF] {hap=1510:app=Adobe Reader X 10.0.1.434:tid=2AE8:usr=V47234}
App shut down
[11/02/2012 10:44:00:793 SWAP INF] {hap=1511:app=Microsoft Office Word 2003_b1 11.0.8324.1:tid=1D80:usr=V422357235}
Elapsed time for upload: 0.0 seconds
[11/02/2012 10:44:03:809 SWAP INF] {hap=1511:app=Microsoft Office Word 2003_b1 11.0.8324.1:tid=1D80:usr=V422357235}
Elapsed time for launch: 3.172 seconds
[11/02/2012 10:44:15:965 SWAP INF] {hap=1511:app=Microsoft Office Word 2003_b1 11.0.8324.1:tid=1D80:usr=V422357235}
App shut down
[11/02/2012 10:44:20:637 SWAP INF] {hap=1512:app=Microsoft Office Word 2003_b1 11.0.8324.1:tid=3B9C:usr=V47234}
Elapsed time for upload: 0.0 seconds
[11/02/2012 10:44:23:606 SWAP INF] {hap=1512:app=Microsoft Office Word 2003_b1 11.0.8324.1:tid=3B9C:usr=V47234}
Elapsed time for launch: 3.125 seconds
[11/02/2012 10:44:32:481 SWAP INF] {hap=150B:app=Microsoft Office Excel 2003_b1 11.0.8324.1:tid=19C:usr=V47234}
App shut down
[11/02/2012 10:44:38:575 SWAP INF] {hap=1512:app=Microsoft Office Word 2003_b1 11.0.8324.1:tid=3B9C:usr=E831415}
App shut down
[11/02/2012 10:45:00:560 ???? INF] {tid=1650:usr=V47234}
An error occurred while opening the virtual registry (section: 9), rc: 07B01F0C-0000004A
[11/02/2012 10:45:00:576 ???? INF] {tid=1650}
An error occurred while opening the virtual registry (section: 9), rc: 07B01F0C-0000004A
ElapR
The Application Virtualization Client could not connect to stream URL 'RTSP://SRVW23E:554/V1321_BDP_V1_R1_SB/V1321_BDP_C1_P2PM_SS.sft' (rc 1690900A-00002002, original rc 1690900A-00002002).
[11/02/2012 00:29:59:843 OSDF ERR] {tid=1464}
The Application Virtualization Client could not parse the OSD file 'C:\SoftCache\SoftGrid Client\OSD Cache\edCc4305-3f6C-4dcc-3d70-404eb8bd97d8.osd'. Reason: XML parsing failure (rc 00000A25-00000002)
[11/02/2012 08:24:35:869 ???? ERR] {tid=336C:usr=t405230}
corrupt cp file detected ('V:\V1321_BDP\osguard.cp'). osguard cp file, NO CORRECTIVE ACTION TAKEN
[11/02/2012 22:16:39:240 JGSW ERR] {hap=1C82:app=bDP c15 E2AM SS 1.0:tid=3D58}
The Application Virtualization Client could not connect to stream URL 'RTSP://PSWQAPP1:554/V14678993_BDP_C15_E2AM_SS/V14678993_BDP_C15_E2AM_SS.sft' (rc 1690900A-00002002, original rc 1690900A-00002002).
[11/02/2012 22:16:39:240 SWAP ERR] {hap=1C82:app=bDP c15 E2AM SS 1.0:tid=3D58}
The client was unable to connect to an Application Virtualization Server (rc 1690900A-00002002)
[11/02/2012 22:17:09:163 AMGR ERR] {tid=4F54}
The specified application name (Application Integration) is ambiguous. Some potential matches:
Application Integration 7.0.1756.1756
Application Integration 9.2.2373.2373
[11/02/2012 22:17:09:163 AMGR ERR] {tid=4F54}
The Application Virtualization Client cannot open Application Integration
[11/02/2012 00:03:14:313 SWAP WRN] {tid=507C:usr=N28712}
Could not load OSD file \\PSWQAPP1\Content\D1311_bDP_Adobe_Reader_9.3.3\D1311_bDP_Adobe_Reader 9.3.3.osd
[11/02/2012 00:03:14:313 AMGR INF] {tid=507C:usr=i435145}
The app manager could not create an application from '\\PSWQAPP1\Content\D1311_bDP_Adob_dobe_Reader_9.3.3\D1311_bDP_Adob_b_Adobe Reader 9.3.3.osd' (rc 0C405664-00000002).
====
[11/02/2012 13:35:16:987 JGSW ERR] {hap=1:app=Abaculus 1.0.0.1:tid=14C8:usr=R3R7DF42}
The Application Virtualization Client could not connect to stream URL 'RTSP:%SFT_SRV%:554/D1311_bDP_Adob_b_Adobe_Abaculus_15_01/D1311_bDP_Adob_b_Adobe_Abaculus_15_01.sft' (rc 19D02E0A-10000002, original rc 19D02E0A-10000002).
[11/02/2012 13:35:47:998 SWAP ERR] {hap=2:app=AboutPI-SDK 1.3.0.26:tid=1568:usr=I337721}
Could not load app
I am looking to place a logic with in my script to catch the below text from the log file and output to a file with the computer Name and error message. Below are key errors in the “CoreAPP.txt“ file; if any found in current date there is something wrong and I need to fix Manually.
The aim of the script is to report the below errors if found on current date in the “CoreAPP.txt“ file.
1. The Application Virtualization Client could not connect to stream
2. XML parsing failure (rc 00000A25-00000002)
3. corrupt cp file detected
4. The client was unable to connect
5. Virtualization Client cannot open Application Integration
6. Could not load OSD file
Below is my VBscript:
Code:
option Explicit
dim Fso, InFile, out, strComputer, today, strFilePath, InputFile, strLine
Set Fso = CreateObject("Scripting.FileSystemObject")
Set InFile = fso.OpenTextFile("list.txt", ForReading,False,TriStateTrue)
Set out = fso.CreateTextFile("error.log")
today = Date()
Const ForReading = 1, ForWriting = 2, ForAppending = 3
const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
Do While Not (InFile.AtEndOfStream)
strComputer = InFile.ReadLine
Set fso = CreateObject("Scripting.FileSystemObject")
strFilePath = "\\" & strComputer & "\d$\LOGFILES\"
Set InputFile = fso.OpenTextFile(strFilePath & "CoreAPP.txt", ForReading,False,TriStateTrue)
Do While Not (InputFile.AtEndOfStream)
strLine = InputFile.ReadLine
if InStr (strLine, today) = 0 Then ' in the log file if text found with today date then it should read from there and look for any of below 6 texts
If InStr(strLine, "corrupt cp file detected") > 0 Then
'Kindly help me to integrate below 6 with in this script
'1. The Application Virtualization Client could not connect to stream
'2. XML parsing failure (rc 00000A25-00000002)
'3. corrupt cp file detected
'4. The client was unable to connect
'5. Virtualization Client cannot open Application Integration
'6. Could not load OSD file
out.WriteLine strLine & vbTab & strComputer
End If
End If
Loop
InputFile.close
Loop
out.Close
InFile.Close
The script reads the computers information from list.txt file.
Sample of list.txt
Code:
Server1
server2
server3
CoreAPP.txt file will be there on above (list.txt) server. And the Path is D:\ LOGFILES \CoreAPP.txt
The problem with the current script is script looking for entire file, instead of current date (today is 11/2/2012 but my script showing the output of 11/1/2012 & 10/31/2012 also) information. I mean the script writing output with regardless of Date check this resulting output with past date and current date text in the error.log.
Looking for help!!!!!!!!!!