How to monitor a file / filechanges /appendings?

Hey,

I have a simple .log file which I want to monitor. I’m looking, if possible, for the following possibilities:

  1. Every time something gets appended to the file, an event should be raised. Given that a new line was appended, I also would like to be able to get the content of the appended line, so I can react on it.
  2. Contrary to the first approach, I don’t want to ‘watch’ the file all the time: I want to check it in a time interval (e.g. 3 minutes) and get the appended content since the last check.

Is something like this possible using powershell (keep in mind, I care about the file content).

Thanks 🙂

submitted by /u/Fasyx
[link] [comments]

Leave a Reply