Created
September 27, 2016 09:51
-
-
Save jplindstrom/db97b1ee322eb37dcb00741ac3cb52b0 to your computer and use it in GitHub Desktop.
Display the length of time between log lines.
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
# Assumes the first digit is a timestamp, and that all of them have the same width. Most useful with ms precision. | |
# tail -f logfile | THIS_FILTER | |
perl -MList::Util=min -nE 'state $last= 0; /"([\dT:,-]+)"/ and do { my $c = ($1 =~ s/\D//gr); my $d = $c - $last; my $w = min(200, $d / 5); say $d . ": " . ("x" x $w); $last = $c }; print $_' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment