Monitor the file modification date with nxlog?


#1 cps86

Hello

Is it possible to monitor the log file modification date? I do not want to check log file contents, to check whether pattern was found or not. The only thing which I want to is to get modification date of a log file, and if it's older than X minutes -> generate an event.

I tried different configs, with schedule, with im_null modules, exec, file_mtime function... And nothing... Still doesn't work.

#2 b0ti Nxlog ✓
#1 cps86
Hello Is it possible to monitor the log file modification date? I do not want to check log file contents, to check whether pattern was found or not. The only thing which I want to is to get modification date of a log file, and if it's older than X minutes -> generate an event. I tried different configs, with schedule, with im_null modules, exec, file_mtime function... And nothing... Still doesn't work.

The easiest would be to create a script (shell, perl, python, whatever) that check this in a loop periodically via stat and then emits the message. Then configure im_exec to run this.