DEV Community

Wajahat Ali Abid
Wajahat Ali Abid

Posted on

Enable ContainerLogV2 on AKS

ContainerLogV2 provides additional data over ContainerLog (which is v1). The additional data includes

  • ContainerName
  • PodName
  • PodNamespace

To enable ContainerLogV2 on an existing AKS cluster, you need to create a configmap. Here's how you do this

  • Download the template ConfigMap YAML file for ContainerLog
  • Set containerlog_schema_version = "v2" in the yaml file
  • Update the exclude_namespaces under log_collection_settings.stdout and log_collection_settings.stderr as per your use case
  • Save the changes
  • Connect to Kubernetes cluster using CLI
kubectx my-cluster
Enter fullscreen mode Exit fullscreen mode
  • Run the following command to create the configmap.
kubectl apply -f container-azm-ms-agentconfig.yaml
Enter fullscreen mode Exit fullscreen mode
  • Done

I hope this helps. Refer to Container insights log schema and Configure data collection in Container insights using ConfigMap for more insights.

Top comments (0)