How add file config for lambda promtail

Hi team,

I’m using lambda promtail to push the aws logs to my loki server. I’m trying to add the config file for lambda promtail to parse and relabel some labels. I’m following this doc to set it up:

But it still does not work. I can not apply the “job_name: push1” to lambda promtail.
Here is my promtail config file in the Loki server:

server:
  http_listen_port: 9080
  grpc_listen_port: 0

positions:
  filename: /tmp/positions.yaml

clients:
  - url: http://my_public_ip:3100/loki/api/v1/push
    external_labels:
      vm_name: ${HOSTNAME}
      zone: Staging
      export: loki
scrape_configs:
  - job_name: system
    static_configs:
      - targets:
          - localhost
        labels:
          source: sys-varlogs
          __path__: /var/log/*log
      - targets:
          - localhost
        labels:
          source: sys-messages
          __path__: /var/log/messages
      - targets:
          - localhost
        labels:
          source: sys-secure
          __path__: /var/log/secure
  - job_name: docker
    docker_sd_configs:
      - host: unix:///var/run/docker.sock
        refresh_interval: 5s
    relabel_configs:
      - source_labels:
         - __meta_docker_container_name
        regex: /(.*)
        target_label: source
  - job_name: push1
    loki_push_api:
      server:
        http_listen_port: 3500
        grpc_listen_port: 3600
      labels:
        # Adds a label on all streams indicating it was processed by the lambda-promtail workflow.
        promtail: 'lambda-promtail'
    relabel_configs:
      - source_labels: ['__aws_log_type']
        target_label: 'log_type'
      # Maps the cloudwatch log group into a label called `log_group` for use in Loki.
      - source_labels: ['__aws_cloudwatch_log_group']
        target_label: 'log_group'
      # Maps the loadbalancer name into a label called `loadbalancer_name` for use in Loki.
      - source_labels: ['__aws_s3_log_lb']
        target_label: 'loadbalancer_name'

And here is lambda promtail variable config:

Did I miss any config?

1 Like