Using SSH to grep keywords from multiple servers
Try GNU parallel
parallel --tag ssh {} grep -l "KEYWORD" /etc/hosts :::: Linux.prod.dat
parallel
run command multiple times substituting{}
with lines from Linux.prod.dat
file.--tag
switch adds value from the Linux.prod.dat on the beginning of the file. So, the output of the command will look like:
server1 /etc/hostsserver5 /etc/hostsserver7 /etc/hosts
Where server1, server5, etc. will be names of the servers where /etc/hosts
contains KEYWORD