Skip to content

Commit 7b7a517

Browse files
BhargaviGudisaschagrunert
authored andcommitted
OCPBUGS-59523 - Update installation-usage.md to clarify audit log location
OCPBUGS-59523 - Updated indentaion
1 parent d919cb2 commit 7b7a517

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

installation-usage.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,11 +1009,27 @@ To enable a single pod log the activity following these steps:
10091009
kubectl apply -f my-pod.yaml
10101010
```
10111011
5. **Monitor the Audit Logs:**
1012-
1013-
To monitor the audit log tail:
1012+
1013+
There are two ways to monitor audit logs generated by the json-enricher container:
1014+
1015+
a. To monitor the audit log tail:
10141016
```shell
10151017
kubectl -n security-profiles-operator logs --since=1m --selector name=spod -c json-enricher --max-log-requests 6 -f
10161018
```
1019+
b. To monitor the audit log file:
1020+
1021+
The audit log file specified in the auditLogPath is written to the node's file system where the pod is running. To monitor or inspect the audit logs, you must access the node directly and check the file at the specified path (e.g., `/tmp/logs/audit1.log`).
1022+
1023+
To monitor or inspect the audit logs, you need to:
1024+
1. Identify the node on which the pod is scheduled:
1025+
```shell
1026+
kubectl get pod my-pod -o wide
1027+
```
1028+
2. SSH to a node and view the audit log:
1029+
```shell
1030+
sudo ssh core@<node-name>
1031+
cat /tmp/logs/audit1.log
1032+
```
10171033
By following above steps, you can enable and monitor audit logs in JSON lines format for your Kubernetes pods,
10181034
giving you better visibility into their activities.
10191035

0 commit comments

Comments
 (0)