Show recent Kubernetes warning events in chronological order
Build a paste-ready command, then review its compatibility and effects before running it.
kubectl get events -A --field-selector type=Warning --sort-by=.lastTimestamp -o custom-columns='TIME:.lastTimestamp,NAMESPACE:.metadata.namespace,REASON:.reason,OBJECT:.involvedObject.name,MESSAGE:.message'Compatibility
Linux + macOS + WindowsVerified for Linux, macOS, Windows using bash, zsh, powershell syntax.
Operational knowledgereview due 2027-01-19
Requirementskubectlkubectl must be installed and available on PATH.Network accessThe target must be reachable from the current environment.
Version supportkubectl Current supported releasesVerified for linux, macos, windows using bash, zsh, powershell syntax; consult compatibility notes for platform-specific differences.
Expected signalsTIME NAMESPACE REASON OBJECT MESSAGERepresentative successful output; values vary with the selected target and system state.
Known errorskubectl: command not foundkubectl is missing or is not available on PATH.
Verifykubectl get events -A --field-selector type=Warning --sort-by=.lastTimestamp -o custom-columns='TIME:.lastTimestamp,NAMESPACE:.metadata.namespace,REASON:.reason,OBJECT:.involvedObject.name,MESSAGE:.message'The output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01kubectlCommandRuns the kubectl stage of this one-liner.
02getArgumentPasses get to kubectl.
03eventsArgumentPasses events to kubectl.
04-AOptionConfigures kubectl with the -A option.
05--field-selectorOptionConfigures kubectl with the --field-selector option.
06type=WarningArgumentPasses type=Warning to kubectl.
07--sort-by=.lastTimestampOptionConfigures kubectl with the --sort-by=.lastTimestamp option.
08-oOptionSelects an output file or output format for this command.
09custom-columns='TIME:.lastTimestamp,NAMESPACE:.metadata.namespace,REASON:.reason,OBJECT:.involvedObject.name,MESSAGE:.message'ArgumentPasses custom-columns='TIME:.lastTimestamp,NAMESPACE:.metadata.namespace,REASON:.reason,OBJECT:.involvedObject.name,MESSAGE:.message' to kubectl.
This advanced community-curated one-liner combines several stages. Review every option and placeholder before running it.
Example input
kubectl get events -A --field-selector type=Warning --sort-by=.lastTimestamp -o custom-columns='TIME:.lastTimestamp,NAMESPACE:.metadata.namespace,REASON:.reason,OBJECT:.involvedObject.name,MESSAGE:.message'
Example output
TIME NAMESPACE REASON OBJECT MESSAGE
2026-07-23T09:40:12Z payments BackOff worker-7d8f6b9c8f-mp2kr Back-off restarting failed container
2026-07-23T09:42:55Z default FailedScheduling api-6cf59bd8dc-xm9kq 0/3 nodes are available
Illustrative output — exact values vary by system and data.
Official sources