Created
December 24, 2023 02:08
-
-
Save kaellego/8c58d5c167314844ddbdb3fc7079ae23 to your computer and use it in GitHub Desktop.
output file vbscript ksc parse.vbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' Definição das variáveis | |
Dim strSeverity, strComputer, strDomain, strEvent, strDescr, strRiseTime | |
Dim strKLCSAKEventTaskDisplayName, strKLProduct, strKLVersion, strHostIP, strHostConnIP | |
Dim strMessage, strTelegramBotToken, strTelegramChatID, objShell, strURL, strJSONMessage, strJSONMessage1 | |
Dim fso, logFile, strLogFile | |
' Recebendo os valores das variáveis de ambiente | |
strSeverity = WScript.Arguments(0) | |
strComputer = WScript.Arguments(1) | |
strDomain = WScript.Arguments(2) | |
strEvent = WScript.Arguments(3) | |
strDescr = WScript.Arguments(4) | |
strRiseTime = WScript.Arguments(5) | |
strKLCSAKEventTaskDisplayName = WScript.Arguments(6) | |
strKLProduct = WScript.Arguments(7) | |
strKLVersion = WScript.Arguments(8) | |
strHostIP = WScript.Arguments(9) | |
strHostConnIP = WScript.Arguments(10) | |
' Caminho do arquivo de log | |
strLogFile = "debug_vbs_log.txt" | |
' Criando/abrindo o arquivo de log | |
Set fso = CreateObject("Scripting.FileSystemObject") | |
Set logFile = fso.OpenTextFile(strLogFile, 8, True) | |
' Escrevendo as entradas no arquivo de log | |
logFile.WriteLine vbCrLf & "Data/Hora: " & Now | |
logFile.WriteLine "Output: " & strSeverity & " " & strComputer & " " & strDomain & " " & strEvent & " " & strDescr & " " & strRiseTime & " " & strKLCSAKEventTaskDisplayName & " " & strKLProduct & " " & strKLVersion & " " & strHostIP & " " & strHostConnIP & " " & vbCrLf | |
' Fechando o arquivo de log | |
logFile.Close |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment