Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using loki docker driver with loki-pipeline-stages and geoip #12407

Open
KVInventoR opened this issue Mar 30, 2024 · 1 comment
Open

Using loki docker driver with loki-pipeline-stages and geoip #12407

KVInventoR opened this issue Mar 30, 2024 · 1 comment

Comments

@KVInventoR
Copy link

KVInventoR commented Mar 30, 2024

I tried to add support for geoip in pipeline stages for loki docker driver.

But, when I run:
docker compose up -d
it's always failing with error:

Error response from daemon: failed to create task for container: f
ailed to initialize logging driver: 
error creating logger: error creating Loki logger: 
invalid geoip stage config: open ./GeoLite2-ASN.mmdb: no such file or directory

I tried to set multiple path to /GeoLite2-ASN.mmdb, like as: .//GeoLite2-ASN.mmdb or full path: /root/GeoLite2-ASN.mmdb
Is there any change to get geoip work with Loki driver?

    hostname: gogstash
    restart: always
    environment:
      GOMAXPROCS: 4
      CONFIG: "config.yml"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"
      - "./config/config.yml:/config.yml:ro"
      - "/logging:/logging:rw"
      - "./GeoLite2-City.mmdb:/GeoLite2-City.mmdb:ro"
      - "./GeoLite2-ASN.mmdb:/GeoLite2-ASN.mmdb:ro"
      - "./config/nginx_access.grok:/nginx_access.grok:ro"
    logging:
      driver: loki
      options:
        loki-url: "https://loki-host.com:3100/loki/api/v1/push"
        max-size: "10m"
        max-file: 6
        keep-file: "false"
        loki-tenant-id: "docker"
        loki-external-labels: "job=nginx_access,container_name={{.Name}}"
        loki-pipeline-stages: |
          - docker: {}
          - json:
              expressions:
                sender_ip: sender_ip
                sender_host: sender_host
                log_name: log_name
                geo2ip_country: geo2ip_country
                clientip: clientip
          - geoip:
              db: "/GeoLite2-ASN.mmdb"
              source: "clientip"
              db_type: "asn"
          - labels:
              sender_ip:
              sender_host:
              geo2ip_country:
              log_name:
          - output:
              source: message```


@JStickler
Copy link
Contributor

Questions have a better chance of being answered if you ask them on the community forums.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants