Skip to content

Instantly share code, notes, and snippets.

@luszczynski
Last active May 7, 2020 00:37
Show Gist options
  • Save luszczynski/e119f9882535ff469c1082a9a258fa20 to your computer and use it in GitHub Desktop.
Save luszczynski/e119f9882535ff469c1082a9a258fa20 to your computer and use it in GitHub Desktop.
Get Stacktrace from log

Get Stacktrace from log

cat teste.log | sed -n -e '/ERROR \[/,/\.\.\. [0-9]* more$/ p'
cat teste.log | sed -n -e '/ERROR \[/,/\.\.\. [0-9]* more$/ p' | while read x ; do echo $x ; done
tail -f teste.log | sed -n -e '/ERROR \[/,/\.\.\. [0-9]* more$/ p'
cat example.log | awk '/ERROR \[/,/\.\.\. [0-9]* more$|^$/'
cat teste.log | awk '/ERROR \[/,/\.\.\. [0-9]* more$/' 
cat teste.log | grep -P '(?:\S+?Exception|ERROR \[|\h+at ([a-z]+\.)*)'
tail -f teste.log | grep -P '(?:\S+?Exception|ERROR \[|\h+at ([a-z]+\.)*)'
grep -P '(?:\S+?Exception|ERROR \[|\h+at ([a-z|A-Z]+\.)*)' example.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment