Home > Mobile >  Openshift cmd only get events of last 5 Minutes
Openshift cmd only get events of last 5 Minutes

Time:11-02

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 :

  1. This command gives all the events with the time stamp. Refer to this doc

    $ kubectl get events --sort-by='.metadata.creationTimestamp' -A

  2. To sort out the events by the last seen timestamp, execute the following cited command in the shell:

    $ kubectl get events --sort-by=’.lastTimestamp’

  3. Adding --output-watch-events=true gives the deleted Events also :

    $ kubectl get events -n my-namespace --output-watch-events=true --watch-only

  • Related