简体   繁体   中英

Log processing - send each new line in a log file as a parameter to script in real time

I have an active log file (which means there are new lines of log information appended to the file in real time).

What I want: When there is a new line appended, pass the new line of log as a parameter to a script (Bash, C, or even PHP).

What is better: instead of open a new process for every new line of log appended, run a demon process in the background to accept each line of new input.

I tried to Google, but haven't found any useful keyword to start.

By the way, it's running on Debian.

而不是为每个附加的新日志行打开一个新进程,而是在后台运行一个恶魔进程以接受新输入的每一行。

tail -f log | demon&

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM