Forum Discussion
Hi,
Thank you for sharing your solution here. Hopefully, it will help others who may have similair question.
Thanks everyone.
I also managed to capture the type of the message to send to sumologic. Not sure if this is the best way to do it. But works very well for me. Thought of sharing so it might be helpful for someone.
# Checks the data type of the log data
if LogDataType == ldtTable:
# Obtain the total number of rows in the dataset
Num = DataSet.RowCount
for i in range(0, Num):
Row = DataSet.Rows[i]
# Obtain the time of the current row & write this to the log file
TimeVal = Row.ValueByName["Time"]
ExportFile.WriteLine(aqConvert.VarToStr(TimeVal))
# Obtain the type of the current row & write this to the log file
TypeVal = Row.ValueByName["Type"]
if (TypeVal == 822415382):
Type = "Event"
elif (TypeVal == 990187621):
Type = "Message"
elif (TypeVal == 18446744073223342617):
Type = "Checkpoint"
elif (TypeVal == 1174736231):
Type = "Warning"
elif (TypeVal == 923080487):
Type = "Error"
ExportFile.WriteLine(Type)
# Obtain the message of the current row & write this to the log file
MsgVal = Row.ValueByName["Message"]
ExportFile.WriteLine(aqConvert.VarToStr(MsgVal))
--------------------------------------------
So the output looks something like this:
28/08/18 15:29:31
Event
The process "firefox" was closed.
28/08/18 15:29:32
Message
Mozilla Firefox was launched.
Related Content
Recent Discussions
- 42 minutes agoSvetaG