Skip to content

Instantly share code, notes, and snippets.

@gerjantd
Created January 30, 2014 11:33
Show Gist options
  • Save gerjantd/8706765 to your computer and use it in GitHub Desktop.
Save gerjantd/8706765 to your computer and use it in GitHub Desktop.
Tail remote log, save new lines locally and prettify json embedded in log lines using swatch and python
ssh user@host tail -F /usr/share/tomcat/logs/catalina.out >> /tmp/host-catalina.out
vi ~/.swatchrc:
watchfor /"from"/
pipe 'cut -f5- -d" "|python -mjson.tool'
swatch -c ~/.swatchrc -t /tmp/host-catalina.out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment