Search for magazines on multiple machines

Does anyone know of a good tool that allows you to track and search for log files that are distributed across a cluster of machines. We have several web and application servers, and digging through the logs on each server one at a time is a pain.

+3
source share
4 answers

You can use the following bash script (if you can ssh to remote computers 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

+1
source

, /, splunk. YMMV.

+1

You can use fabric to delay multiple hosts and grep all the results:

$ fab -P -u 'USER' -p 'PASSWORD' --linewise -H host1,host2,host3 -- tail -f /path/to/my/log.log | grep ERROR
0
source

Splunk is very effective at combining log files for searching and displaying results in a graph of the number of hits over time, but it is also expensive. I recently learned about Kibana , which is an open source alternative to splunk.

0
source

Source: https://habr.com/ru/post/1705821/


All Articles