News for hackers. Stuff that matters.
Re:Show HN: My Single-File Python Script I Used to Replace S... by 10000truths on Thursday September 21, 2023 @02:37PM (#37602023)
They scale perfectly fine, as long as you filter locally before aggregating. Lo and behold:

  mkdir -p /tmp/ssh_output
  while read ssh_host; do
      touch "/tmp/ssh_output/${ssh_host}.log"
      ssh "$ssh_host" grep 'keyword' /var/my/app.log > "/tmp/ssh_output/${ssh_host}.log" &
  done < ssh_hosts.txt
  wait
  cat /tmp/ssh_output/*.log
  rm -rf /tmp/ssh_output
Tweak as needed. Truncation limits and real-time tailing are left as an exercise to the reader.

There are no comments on this comment yet.