Skip to content

Instantly share code, notes, and snippets.

@convenient
Last active June 20, 2017 14:05
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 convenient/9846247e14e3c0950994ed8bd0fcc1c7 to your computer and use it in GitHub Desktop.
Save convenient/9846247e14e3c0950994ed8bd0fcc1c7 to your computer and use it in GitHub Desktop.
Group magento system log by frequency
cut -f 5- -d ':' /var/www/vhosts/project.com/var/log/system.log | sort -n | uniq -c | sort -nr | head -20
Get all 404 requests from log
`lecli query --loggroup bes_web --leql 'where(status=404 AND request!=/(.*?)favicon.ico/)' -r 'last 1 hour'`
`grep -Eo ".{0,255}query" 404.log | sed -e 's/\", "query//' | cut -d ":" -f9 | sed 's/^.//'`
cat reqs.log | sed -e 's/.*userAgent...//' -e 's/.referer.*..//'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment