Monitor log in realtime, and run a command on a particular event

Latest response

I think I could probably create a python script to do this, but I wanted to see if someone has been here before me.

We already have a crude working script that "greps" logs searching for a particular event.
The event can easily be identified. The event contains a filename and filepath.
The script then performs a "chattr" on that file.
The script runs once ever 5 mins.

However we now need it to run in real time so as soon as the event occurs the script is triggered.

Responses