Hi all,
I have an app that uses log4net for log rotation.
log4net generates multiple files with same name and changes extension when files are rotated.

I have a logrt item for reading this log and only SACMService.log file should be processed.
I'm using this expression for item:
logrt[\\172.29.32.194\d$\SACM\Services\SACMService\Logs\ SACMService.log,@REGEX_FOR_ERROR]
where @REGEX_FOR_ERROR searches, for "Error" and other keywords.
This item definition is working ok, but the problem is that ALL FILES are processed in this item, so when a log is rotated, all old alerts are open again (due file SACMService.log changes to SACMService.log.1, SACMService.log.1 changes to SACMService.log.2, and so)
I tried fixing name in regex as:
logrt[\\172.29.32.194\d$\SACM\Services\SACMService\Logs" SACMService.log",@REGEX_FOR_ERROR]
(added quotes to file name), but in this case none of the files is processed.
Please help me how I need to define file name regex in order to only get "SACMService.log" file but not the others.
As you can see, with this regex all the files (original and other extensions) are matched by regex:

Regards.
I have an app that uses log4net for log rotation.
log4net generates multiple files with same name and changes extension when files are rotated.
I have a logrt item for reading this log and only SACMService.log file should be processed.
I'm using this expression for item:
logrt[\\172.29.32.194\d$\SACM\Services\SACMService\Logs\ SACMService.log,@REGEX_FOR_ERROR]
where @REGEX_FOR_ERROR searches, for "Error" and other keywords.
This item definition is working ok, but the problem is that ALL FILES are processed in this item, so when a log is rotated, all old alerts are open again (due file SACMService.log changes to SACMService.log.1, SACMService.log.1 changes to SACMService.log.2, and so)
I tried fixing name in regex as:
logrt[\\172.29.32.194\d$\SACM\Services\SACMService\Logs" SACMService.log",@REGEX_FOR_ERROR]
(added quotes to file name), but in this case none of the files is processed.
Please help me how I need to define file name regex in order to only get "SACMService.log" file but not the others.
As you can see, with this regex all the files (original and other extensions) are matched by regex:
Regards.
Comment