DEV Community

Cover image for Kubernetes: Sort events from older to newer
Sergio Peris
Sergio Peris

Posted on • Originally published at sertxu.dev

Kubernetes: Sort events from older to newer

While debuging a Kubernetes cluster it's common to see the events registered using the command:

kubectl get events -A
Enter fullscreen mode Exit fullscreen mode

This events are sorted by default using the namespace, to sort them from older to newer using the last seen column, you should run the command with the parameter --sort-by='.lastTimestamp':

kubectl get events -A --sort-by='.lastTimestamp'
Enter fullscreen mode Exit fullscreen mode

Top comments (0)