Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
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

2 Answers 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

share|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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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