Skip to content

Instantly share code, notes, and snippets.

@proprietary
Created October 27, 2019 03:43
Show Gist options
  • Save proprietary/ae0200b6402776d21ddff246e70aeba2 to your computer and use it in GitHub Desktop.
Save proprietary/ae0200b6402776d21ddff246e70aeba2 to your computer and use it in GitHub Desktop.
pretty print nextcloud log json line by line
#!/usr/bin/bash
# Usage: nextcloud-log.sh [number of recent entries] [logfile]
tail -${1:-10} ${2:-/var/www/nextcloud/data/nextcloud.log} | xargs -L1 -d "\n" -I '{}' sh -c "echo '{}' | python3 -m json.tool"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment