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.

  • 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 '11 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 '11 at 15:25

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

| improve this answer | |

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.