cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to: Capturing log content from file that container is creating

sivart_89
Advisor

I have a container that is writing log files to a directory within itself. How can I capture that log content? The OneAgent itself is capturing the stdout just fine but the file it is creating is not being captured. I thought I could setup a custom log source but that seems to only apply to the filesystem on the k8 node itself, my understanding at least. Any suggestions here?

2 REPLIES 2

Esam_Eid
Advisor

Hi,

yes, you need to include the log file for that pod (process group) 

Regards 

I setup a test but can't seem to get this working. My test includes writing content every 30 seconds to a log file at /tmp/some-file.log within the oneagent container. What would things look like to pull back the log file within the specific container?

Is there really not a better way then to use the process group? It seems like another layer of complexity to have to use the process group. Can we not specify the container name instead? We would then prefer to have the capability to filter down that container to a specific k8 cluster and namespace, even workload so that we are sure we are capturing the logs from only the specific container, rather than potentially same named containers but in different namespace and clusters.

With using the process group it does seem to be specific to the ID. I rather not use any filtering based off the name which is ultimately tied to the ID, if the ID ever changes (we change the hostgroup) then things won't work.

Featured Posts