Grafana agent not scraping logs from all containers of AWS ECS cluster

Hi.
Am using grafana agent (static mode version: “v0.35.2”)to scrape logs from aws ECS and send it loki
but it is only able to scrape only its own logs and ecs agent container’s log.

grafana agent image: “grafana/agent:v0.35.2”
version: v0.35.2

Analysis:

  • It is only scraping the logs from the containers which are in bridge network mode
  • not scraping the logs from the containers running in awsvpc network mode

could someone help here please to scrape and ingest the logs from the containers running in awsvpc network mode also.

grafana agent config file.

server:
  log_level: debug

logs:
  configs:
  - name: default
    clients:
      - url: https://loki.stg.toplyne.io/loki/api/v1/push
        tenant_id: fake
    positions:
      filename: /tmp/positions.yaml
    scrape_configs:
      - job_name: flog_scrape
        docker_sd_configs:
          - host: unix:///var/run/docker.sock
            refresh_interval: 5s
        relabel_configs:
          - source_labels: ['__meta_docker_container_name']
            regex: '/(.*)'
            target_label: 'container'