Remote Logstalgia

From fakedWiki
Revision as of 16:37, 3 February 2011 by Jan (talk | contribs) (→‎HostN)
Jump to: navigation, search

How do you combine the logs of two (or more) hosts running Varnish, and visualize them on a remote workstation with Logstalgia?

Use netcat to send the output of varnishncsa on each of the hosts to socat listening on one of the hosts, which combines the input and listens for a connection from the workstation, and connect with netcat from the workstation to socat and pipe the output to Logstalgia.

Relay

Listen on port 31337 for incoming logs, listen on port 1337 for output connections, allowing multiple input and output clients.

socat tcp4-listen:31337,fork,reuseaddr stdout | socat stdin tcp4-listen:1337,fork,reuseaddr

Host1

Send Varnish log from host1 via netcat to socat on localhost

varnishncsa | nc localhost 31337

HostN

Send Varnish log via netcat from hostN to socat on host1

varnishncsa | nc host1 31337

Workstation

Run Logstalgia on workstation, with output from relay. Download NetCat for Windows here

nc.exe host1 1337 | logstalgia.exe --sync