Created
December 10, 2012 21:12
-
-
Save justincy/4253465 to your computer and use it in GitHub Desktop.
Filter out stacktraces from a logfile and format them nicely
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$inputfile = "C:\path\to\logfile.log" | |
$outputfile = "C:\path\to\output.log" | |
$stacktraces = get-content $inputfile | where { $_ -like '{*' } | get-unique | |
new-item $outputfile -type file -force | |
foreach($st in $stacktraces) { | |
add-content $outputfile (ConvertFrom-Json $st).stacktrace | |
add-content $outputfile "`r`n===========================================================================`r`n" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment