-
-
Notifications
You must be signed in to change notification settings - Fork 201
Open
Labels
needs: docsIndicates that the issue needs documentation updatesIndicates that the issue needs documentation updatesscope: cliAnything related to CLIAnything related to CLI
Description
Motivation
Examining the Fibratus logs can be a hassle, especially if the end user is not familiar with Powershell. It would be much more convenient if the Fibratus CLI provided the facilities for grepping log files, filtering relevant log messages, etc.
Feature
Expand the Fibratus CLI with a new logs
command. The command should ideally provide the following set of modifiers:
-f
: tails the log file in realtime as the file gets written by the Fibratus process-n
: shows the last N lines of the log file-h
: shows the first N lines of the log file-l
: filters the log messages by the log level (debug, info, warning, and error)--grep
: accepts the Go-compatible regular expression and applies on each log line. If it produces any match, the log line is shown on the console.
If the command is run without any modifiers, the entire log file is read and dumped on the console.
Examples:
Show last 10 lines and watch for subsequent changes in realtime:
$ fibratus logs -n 10 -f
Filter logs by info level
$ fibratus logs -l info
Additional context
For watching the file changes in realtime, consider the usage of the fsnotify package.
Metadata
Metadata
Assignees
Labels
needs: docsIndicates that the issue needs documentation updatesIndicates that the issue needs documentation updatesscope: cliAnything related to CLIAnything related to CLI