Open Kantis opened 3 years ago
Hi @Kantis
Thank you for your suggestion.
I can see what you want to achieve, and I believe you can achieve it with grep
A
and B
options:
i.e. cw tail my-log-group -b7d | grep ERROR -A 2 -B 2
will give you 2 lines before and after the grep hit.
Problem
It's frustrating to see surrounding events when you find something of interest in the log.
Proposal
Provide an additional parameter
-l, --relative-to="<Full DATE/DATETIME>"
to thecw tail
function, that can be used in conjunction to the relative parameters for-b, -e
. Example:Also it could be nice if -b and -e supported down to millisecond precision? Perhaps worthy of a separate ticket..
Alternatives
I considered whether the before/after should be merged into a single additional parameter, but I think it's more natural this way..