2

I've been searching for a small but functional PHP script or similar that I can expose via apache. Basically I'd like what "tail -f /var/log/something" does, but visible via a web browser. I'm finding various solutions, but most of them operate with something similar to "tail -10" under the hood - which is fine if the log is "slow" in writing - as you can imagine data can be "lost" between poll attempts of more than that number of lines was written.

Is there anything lightweight that satisfies what I am looking for? Something like Splunk is way beyond what I need or want.

2
  • I actually submitted the "tail -f" feature request for Splunk several years ago. What didn't you like about Splunk for this requirement?
    – dmourati
    May 31, 2011 at 22:44
  • Splunk has a high footprint compared to what you would see with a simple script. I am using it for the moment - it's like using a backhoe to blank a flower.
    – draeath
    Jun 2, 2011 at 15:25

2 Answers 2

2

For realtime tailing, you probably want websockets. Node.js comes to mind. See the first answer here. Edit: guess that answer suggested but didn't implement socket.io. I'd google around for nodejs tail dash f

0

Instead of using tail, you could diff your current content against the file, and just remove "> " from each of the diff output before adding it to the page.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .