Is there an oc
or kubectl
command that prints out only events of the last 5 Minutes?
Something like:
oc get events --last="5-Minutes"
CodePudding user response:
Events for the last 5 Minutes or N mins is currently an Open issue you can follow this github link for more feature enhancements. You can also raise a comment under this link or else you can raise a new feature request . We can also use the below commands as of now :
This command gives all the events with the time stamp. Refer to this doc
$ kubectl get events --sort-by='.metadata.creationTimestamp' -A
To sort out the events by the last seen timestamp, execute the following cited command in the shell:
$ kubectl get events --sort-by=’.lastTimestamp’
Adding --output-watch-events=true gives the deleted Events also :
$ kubectl get events -n my-namespace --output-watch-events=true --watch-only