Skip to content

Instantly share code, notes, and snippets.

@rbramwell
Forked from obazoud/puppet-agent.sh
Created April 18, 2016 01:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rbramwell/46dc856de1f5781b55cbf9f2b71be543 to your computer and use it in GitHub Desktop.
Save rbramwell/46dc856de1f5781b55cbf9f2b71be543 to your computer and use it in GitHub Desktop.
Append hostname and current timestamp in puppet logs
cd /etc/puppet/ && puppet agent --test --environment=$1 --verbose --debug 2>&1 | awk -v hostname=$(hostname) '{print hostname" - " strftime("%Y-%m-%d %H:%M:%S") " - " $0}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment