linux通过跳板机查询多台服务器日志
作者:互联网
例如跳板机可登录ip有下:
192.168.100.1
192.168.100.252
192.168.100.8
192.168.100.7
192.168.100.11
192.168.100.9
192.168.100.5
192.168.100.6
192.168.100.3
192.168.100.2
192.168.100.10
192.168.100.4
可使用循环语句查询每台机器:
for newcore_ip in 192.168.100.1 192.168.100.252 192.168.100.8 192.168.100.7 192.168.100.11 192.168.100.9 192.168.100.5 192.168.100.6 192.168.100.3 192.168.100.2 192.168.100.10 192.168.100.4; do echo -e "目标服务器:${newcore_ip}"; ssh -l log "${newcore_ip}" cat 目录/xxx.log.2020-08-19 |grep '条件'; done ;
标签:ip,100.10,100.11,192.168,newcore,100.252,linux,日志,多台 来源: https://www.cnblogs.com/zyf-yxm/p/13533833.html