In IBM Cloud Pak for Integration (CP4I) v2021.2, which runs on Red Hat OpenShift, administrators often need to retrieve logs from pods to diagnose issues or monitor application behavior. The correct OpenShift CLI (oc) command to retrieve logs from a specific pod is:
sh
CopyEdit
oc logs
This command fetches the logs of a running container within the specified pod. If a pod has multiple containers, the -c flag is used to specify the container name:
sh
CopyEdit
oc logs -c
A. oc get logs → Incorrect. The oc get command is used to list resources (such as pods, deployments, etc.), but it does not retrieve logs.
C. oc describe → Incorrect. This command provides detailed information about a pod, including events and status, but not logs.
D. oc retrieve logs → Incorrect. There is no such command in OpenShift CLI.
IBM Cloud Pak for Integration Logging and Monitoring
Red Hat OpenShift CLI (oc) Reference
IBM Cloud Pak for Integration Troubleshooting
Explanation of Other Options:IBM Cloud Pak for Integration (CP4I) v2021.2 Administration References:
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit