Remote Logstalgia: Difference between revisions

From fakedWiki
Jump to: navigation, search
No edit summary
m (11 revisions imported)
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
How to combine the logs of two hosts running Varnish, and visualize them on a remote workstation with Logstalgia?
How do you combine the logs of two (or more) hosts running Varnish, and visualize them on a remote workstation with Logstalgia?


Send the output of two or more hosts to netcat listening on one of the hosts, which combines the input and listens for a connection from the workstation.
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 ====
==== Relay ====
Listen on port 31337 for incoming logs, relay to port 1337, allow multiple clients (and disconnects without exiting).  
Listen on port 31337 for incoming logs, listen on port 1337 for output connections, allowing multiple input and output clients.  
<pre>
<pre>
sudo apt-get install netcat-openbsd
socat tcp4-listen:31337,fork,reuseaddr stdout | socat stdin tcp4-listen:1337,fork,reuseaddr
nc -l -k 31337 | nc -l -k 1337
</pre>
</pre>


==== Host1 ====
==== Host1 ====
Send Varnish log from host1 to relay on host1
Send Varnish log via netcat to socat on localhost
<pre>
<pre>
varnishncsa | nc localhost 31337
varnishncsa | nc localhost 31337
</pre>
==== Host2 ====
Send Varnish log from host2 to relay on host1
<pre>
varnishncsa | nc host2 31337
</pre>
</pre>


==== HostN ====
==== HostN ====
Send Varnish log from hostN to relay on host1
Send Varnish log via netcat to socat on host1
<pre>
<pre>
varnishncsa | nc host1 31337
varnishncsa | nc host1 31337
</pre>
</pre>


==== Workstation ====
==== Workstation ====
Run Logstalgia on workstation, with output from relay. Download NetCat for Windows [http://www.stuartaxon.com/2008/05/22/netcat-in-windows/ here]
Connect with netcat to host1 and pipe output from socat to Logstalgia. ([http://www.stuartaxon.com/2008/05/22/netcat-in-windows/ netcat for Windows ])
<pre>
<pre>
nc.exe host1 1337 | logstalgia.exe --sync
nc.exe host1 1337 | logstalgia.exe --sync
</pre>
==== Deprecated ====
Instead of using netcat, my first tries were with SSH... quick & dirty, but worked - at least for 2 hosts.
<pre>
plink.exe host1 "varnishncsa >&2 | ssh user@host2 varnishncsa" 2>&1 | logstalgia.exe --sync
</pre>
</pre>

Latest revision as of 21:10, 26 August 2016

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 via netcat to socat on localhost

varnishncsa | nc localhost 31337

HostN

Send Varnish log via netcat to socat on host1

varnishncsa | nc host1 31337

Workstation

Connect with netcat to host1 and pipe output from socat to Logstalgia. (netcat for Windows )

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

Deprecated

Instead of using netcat, my first tries were with SSH... quick & dirty, but worked - at least for 2 hosts.

plink.exe host1 "varnishncsa >&2 | ssh user@host2 varnishncsa" 2>&1 | logstalgia.exe --sync