Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

real time display of log files - any other ideas?

Status
Not open for further replies.

scratchpad

Programmer
Jan 18, 2007
1
CY
I read thread452-566155 re displaying log files in near real time. That thread uses tail (linux) and perl/html forcing the web page to refresh.

Ive got a number of different jobs reading a syslog alarm log file - would like it to be viewable from any other pc on the LAN so I can keep an eye on events via a web browser.

I also update icons on a main alarm web page using javascript/perl also using this heavy refresh technique - need to move to more advanced methods.

Does anyone have any alternatives to this to do this smoother i.e. using java (tcp/udp updates) that uses a stream or other techniques??

Any comments welcome.

 
Hi

Use server-push :
Code:
[COLOR=#00FFFF black]#!/bin/bash[/color]

[teal]echo[/teal] -e [green]"Content-type: text/html\n"[/green]

[teal]cat[/teal] <<EOT
<html>
<body>
<pre>
EOT

tail -f [green]"/path/to/log"[/green]
The modern browsers will keep the connection open and render the content as it arrives.

I wrote a [tt]bash[/tt] script just because it is more clear.

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top