Quantcast
Channel: THWACK: Popular Discussions - Kiwi Syslog
Viewing all articles
Browse latest Browse all 15803

Parsing a SYSLOG field

$
0
0

I'm parsing a concatenated field from my syslog server output to produce among others a time field, but the time it returns is 8 hours off from the actual time the transaction occured.   The time displayed prior to parsing the concatenated field is correct... it apparently is the parsing script (below) which is introducing the time bias.

Example... when a record is transacted at 14:47:00 on 2010-11-10 the time field produced by the script from the parsed field it shows up as 10:47:00 PM ... .8 hours later than the event actually appeared

The script I'm using (below this line) includes a date conversion referencing the epoch date (1 January, 1970,00.00.00) 

Is there a means to modify this so the time field it references is not 8 hours ahead of the actual time off the transaction in the result provided in the syslog?

MessageDelimiter = "<009>"
 
With Fields
 
DelimitedFields = Split(.VarCleanMessageText, MessageDelimiter)

TimeOfAccess = DateAdd("s",DelimitedFields(2),"1-Jan-1970 00:00:00")

SQLcmd = "INSERT INTO " & DatabaseTable & " (" & DatabaseFields & ") VALUES (" & _
Quote(.VarDate) & "," & _
Quote(.VarTime) & "," & _
Quote(.ConvertPriorityToText(.VarPriority)) & "," & _
Quote(.VarPeerAddress) & "," & _
Quote(DelimitedFields(0)) & "," & _
Quote(DelimitedFields(1)) & "," & _
Quote(TimeOfAccess) & "," & _
Quote(DelimitedFields(3)) & "," & _
Quote(DelimitedFields(4)) & "," & _
Quote(DelimitedFields(5)) & "," & _
Quote(DelimitedFields(6)) & "," & _
Quote(DelimitedFields(7)) & "," & _
Quote(DelimitedFields(8)) & "," & _
Quote(DelimitedFields(9)) & "," & _
Quote(DelimitedFields(10)) & "," & _
Quote(DelimitedFields(11)) & "," & _
Quote(DelimitedFields(12)) & "," & _
Quote(DelimitedFields(13)) & ")"

.VarCustom01 = SQLcmd

' Log the data to database using ConnectionString, DatabaseTable, SQLcmd and Timeout of 30 seconds
Call .ActionLogToODBC(ConnectionString, DatabaseTable, SQLcmd, 30)

 
End With
' Return "SUCCESS" or "OK"
Main="OK"
 
End Function
 
Function Quote(Data)
 
    ' Replace all occurrences of ' with '' to escape existing quotes
    ' Wrap data with single quotes   
 
    Quote = "'" & Replace(Data, "'", "''") & "'"
 
End Function


Viewing all articles
Browse latest Browse all 15803

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>