pipe in a cgi script
Hi all,
so my scenario goes like this: I got an app that writes something into a log file. For some reason, i want the log file to be monitorable through a web browser. So I made a simple cgi script, with the "tail -f my_app.log" command in the very end. This works just fine.
Then I want another script that will show only lines containing particular text. So I probably want to do something like "tail -f my_app.log | grep my_string", but this does not work - it gives no output in a browser window.
The strange thing (according to me at least ;-)) is, that doing (in a terminal):
su apache
./my_cgi_script_with_grep.cgi
works fine!!! Why the hell it does not work in a browser window? There are no complaints in syslogs, and no output to stderr ( 2>&1 does no show anything neither).
|