Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bayashi/go-edge
`go-edge` provides the command `edge` to show the edge of logs with conditional grep
https://github.com/bayashi/go-edge
cli golang head log tail
Last synced: 9 days ago
JSON representation
`go-edge` provides the command `edge` to show the edge of logs with conditional grep
- Host: GitHub
- URL: https://github.com/bayashi/go-edge
- Owner: bayashi
- License: apache-2.0
- Created: 2023-03-06T00:30:59.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-28T07:51:37.000Z (over 1 year ago)
- Last Synced: 2024-11-06T04:05:44.154Z (about 2 months ago)
- Topics: cli, golang, head, log, tail
- Language: Go
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-edge
`go-edge` provides the command `edge` to show the edge of logs with conditional grep
## Usage
$ edge [options] FILE
## Options
-g --grep KEYWORD grep condition
-c also show the total line count## Examples
Here is the 'error.log' file.
$ cat error.log
2023/02/27 08:43:00,not found
2023/02/27 08:43:01,not found
2023/02/27 08:43:02,not found
2023/02/27 08:43:03,no authThen you execute the `edge` command. Then shown the first line and last line.
$ edge error.log
1: 2023/02/27 08:43:00,not found
4: 2023/02/27 08:43:03,no authThe number of top of line is line number of the file.
And you can use `-c` option to know total line number.
$ edge -c error.log
1: 2023/02/27 08:43:00,not found
4: 2023/02/27 08:43:03,no auth
total 4 linesThe above is pretty much the same as below command executions:
$ cat error.log | head -n1
$ cat error.log | tail -n1
$ cat error.log | wc -lWith `--grep` option, you can get filtered 1st line and last line.
$ edge --grep found error.log
1: 2023/02/27 08:43:00,not found
3: 2023/02/27 08:43:02,not foundWith `--grep` and `-c` option:
$ edge -c --grep found error.log
1: 2023/02/27 08:43:00,not found
3: 2023/02/27 08:43:02,not found
total 4 lines## Installation
go install github.com/bayashi/go-edge/cmd/edge@latest
## License
Apache License 2.0
## Author
Dai Okabayashi: @bayashi