edge - show the edge of logs with conditional grep
$ edge [options] FILE_PATH
-t --total-count also show the total line count -g --grep grep condition -gv --grepv invert grep condition -f --file file path
Here is the 4 lines 'error.log' file.
2014/06/27 08:43:00,not found 2014/06/27 08:43:01,not found 2014/06/27 08:43:02,not found 2014/06/27 08:43:03,no auth
Then you execute the edge command.
edge
$ edge error.log 1: 2014/06/27 08:43:00,not found 4: 2014/06/27 08:43:03,no auth
The first line and the last line are output with a line number.
The below command is the other example of edge with match condition.
$ edge --grep found error.log 1: 2014/06/27 08:43:00,not found 3: 2014/06/27 08:43:02,not found
The above command is mostly same as below commands.
$ cat error.log | grep found | head -n1 $ cat error.log | grep found | tail -n1 $ cat error.log | grep found | wc -l
You can get total line count too.
$ edge -t --grep found error.log 1: 2014/06/27 08:43:00,not found 3: 2014/06/27 08:43:02,not found total: 4 lines
Dai Okabayashi <bayashi@cpan.org>
App::Edge
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
To install App::Edge, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::Edge
CPAN shell
perl -MCPAN -e shell install App::Edge
For more information on module installation, please visit the detailed CPAN module installation guide.