You can use a regular expression. See http://regexr.com/3e7qr for the following one that I have developed.
INFO \| ([^\|]*) \|.*QUAL_QUEUE_GOHEAD_IT
Using this in vb
testInput = "Line 8123: Feb 01 19:44:40.961 | INFO | JEZHckpTehtA-ADSW4T14T5 | PROD | 10.86.99.108 | Feb 01 2016 19:44:29.595 | EVNT=SWIdmst|DQLN=YN| DQLN=EQUAL_QUAL_QUEUE_GOHEAD_IT" & vbcrlf & _
"Line 8123: Feb 01 19:44:40.961 | INFO | JEZHckpTehtA-ADSxxxT5 | PROD | 10.86.99.108 | Feb 01 2016 19:44:29.595 | EVNT=SWIdmst|DQLN=YN| DQLN=EQUAL_QUAL_QUEUE_GOHEAD_IT"
Set re = New RegExp
re.Pattern = "INFO \| ([^\|]*) \|.*QUAL_QUEUE_GOHEAD_IT"
re.Global = True
Set matches = re.Execute(testInput)
If matches.Count > 0 Then
msg = "Found " & matches.Count & " matches:" & vbCRLF
For Each match In Matches
msg = msg & "Found match """ & match.SubMatches(0) & vbcrlf
Next
msgbox msg, 0, "VBScript Regular Expression Tester"
Else
msgbox "No match", 0, "VBScript Regular Expression Tester"
End Ifs
--- update with file reading ----
Set objFSO = CreateObject("Scripting.FileSystemObject")
objStartFolder = "C:\temp\batches"
Set objFolder = objFSO.GetFolder(objStartFolder)
For Each objFile in objFolder.Files
set oStream = objFile.OpenAsTextStream(1)
If not oStream.AtEndOfStream Then
contents = oStream.ReadAll
End If
oStream.Close
Set re = New RegExp
re.Pattern = "INFO \| ([^\|]*) \|.*QUAL_QUEUE_GOHEAD_IT"
re.Global = True
Set matches = re.Execute(contents)
For Each match In Matches
varid = match.SubMatches(0)
ProcessMatch objFile.Path, varid
Next
Next
sub ProcessMatch(path, id)
Msgbox "Match " & id & " found in " & path
end sub