Which CLI command will retrieve the logs from a pod?
A.
oc get logs ...
B.
oc logs ...
C.
oc describe ...
D.
oc retrieve logs ...
The Answer Is:
B
This question includes an explanation.
Explanation:
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:
C1000-130 PDF/Engine
Printable Format
Value of Money
100% Pass Assurance
Verified Answers
Researched by Industry Experts
Based on Real Exams Scenarios
100% Real Questions
Get 60% Discount on All Products,
Use Coupon: "8w52ceb345"