NetXMS Support Forum

English Support => General Support => Topic started by: mashedpotatorocket on October 25, 2022, 09:32:25 PM

Title: Parse log file without trailing newline
Post by: mashedpotatorocket on October 25, 2022, 09:32:25 PM
Hi.

I have a log parser for TeamViewer's "Connections_incoming.txt". Example file attached.
It works when i manually add a new line with a trailing newline (CRLF), but TeamViewer doesn't add a newline at the end of new log entries, it's added at the beginning (which means the log file has an empty row at the top).

How can I make NetXMS notice new log entries when they doesn't end with CRLF?


While I'm at it, if I use named captures, how do I reference them by name in the Event Message?

(?<ID>.*?)\t(?<RemoteClient>.*?)\t(?<StartTime>.*?)\t(?<EndTime>.*?)\t(?<LoggedonUser>.*?)\t(?<Action>.*?)\t(?<GUID>.*?)\t
Title: Re: Parse log file without trailing newline
Post by: Victor Kirhenshtein on October 31, 2022, 04:55:13 PM
It is not possible without changes in log parser code. Named capture groups also not supported. I've added feature requests for both:

https://track.radensolutions.com/issue/NX-2312 (https://track.radensolutions.com/issue/NX-2312)
https://track.radensolutions.com/issue/NX-2313 (https://track.radensolutions.com/issue/NX-2313)

Best regards,
Victor
Title: Re: Parse log file without trailing newline
Post by: mashedpotatorocket on November 01, 2022, 12:27:23 PM
Ah, ok.  Thank you very much!