github.com/yankunsam/loki/v2@v2.6.3-0.20220817130409-389df5235c27/docs/sources/clients/aws/ec2/promtail-ec2-final.yaml (about)

     1  server:
     2    http_listen_port: 3100
     3    grpc_listen_port: 0
     4  
     5  clients:
     6    - url: https://<user id>:<api secret>@logs-prod-us-central1.grafana.net/loki/api/v1/push
     7  
     8  positions:
     9    filename: /opt/promtail/positions.yaml
    10  
    11  scrape_configs:
    12    - job_name: journal
    13      journal:
    14        json: false
    15        max_age: 12h
    16        path: /var/log/journal
    17        labels:
    18          job: systemd-journal
    19      relabel_configs:
    20        - source_labels: ["__journal__systemd_unit"]
    21          target_label: "unit"
    22    - job_name: ec2-logs
    23      ec2_sd_configs:
    24        - region: us-east-2
    25          access_key: REDACTED
    26          secret_key: REDACTED
    27      relabel_configs:
    28        - source_labels: [__meta_ec2_tag_Name]
    29          target_label: name
    30          action: replace
    31        - source_labels: [__meta_ec2_instance_id]
    32          target_label: instance
    33          action: replace
    34        - source_labels: [__meta_ec2_availability_zone]
    35          target_label: zone
    36          action: replace
    37        - action: replace
    38          replacement: /var/log/**.log
    39          target_label: __path__
    40        - source_labels: [__meta_ec2_private_dns_name]
    41          regex: "(.*)"
    42          target_label: __host__