Need a rapid way of pulling your logs back using salt? With one config option in /etc/salt/master
and two quick commands, you can do this in parallel across your boxes.
First, use archive.tar
to tarball up your logs
salt '*' archive.tar cvzf /tmp/logs.tgz /var/log/
Next up, cp.push
to pull the logs back from the minions up to the master
In order to use cp.push
, you'll need to set file_recv
to True
within /etc/salt/master
.
# /etc/salt/master
...
file_recv=True
Then restart the master
service restart salt-master
Now simply push
the logs from the minion to the master.
salt '*' cp.push /tmp/logs.tgz
They'll end up in /var/cache/salt/master/minions/<minion_id>/files/