Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Searching Logs on multiple machines

Does anyone know of a good tool that allows you to tail and search through log files that are spread across a cluster of machines. We have multiple web servers and app servers and digging through the logs on each server one by one is a pain.

like image 544
Nick Avatar asked Sep 06 '25 03:09

Nick


2 Answers

You can use the following bash script (if you can ssh to the remote machines and have read access to the log files)

(echo "machine1"; ssh machine1 tail /var/log/messages; echo "machine2"; ssh machine2 tail /var/log/messages;) | less

like image 122
lothar Avatar answered Sep 07 '25 23:09

lothar


I don't know how much work it is to install/configure, but I've heard a few good things about splunk. YMMV.

like image 25
Mike Ellery Avatar answered Sep 07 '25 23:09

Mike Ellery