Skip to content

Custom traefik plugin that logs custom messages to Elasticsearch

License

Notifications You must be signed in to change notification settings

alkem-io/traefik-plugin-elastic

 
 

Repository files navigation

This repository includes a traefik middleware plugin that writes to a configurable elasticsearch endpoint and index. The repository is based on the official sample for developing traefik plugins.

Build Status

Configuration

The following declaration (given here in YAML) defines traefik elastic plugin:

# Static configuration

experimental:
  plugins:
    traefik-plugin-elastic:
      moduleName: github.com/alkem-io/traefik-plugin-elastic
      version: v0.1.1

Here is an example of a file provider dynamic configuration (given here in YAML), where the interesting part is the http.middlewares section:

# Dynamic configuration

http:
  routers:
    my-router:
      rule: host(`demo.localhost`)
      service: service-foo
      entryPoints:
        - web
      middlewares:
        - traefik-plugin-middleware

  services:
   service-foo:
      loadBalancer:
        servers:
          - url: http://127.0.0.1:5000
  
  middlewares:
    traefik-plugin-middleware:
      plugin:
        traefik-plugin-elastic:
          ElasticsearchURL: http://localhost:9200
          Message: Test Elasticsearch
          IndexName: test-index
          VerifyTLS: false
          Username: elastic
          Password: elastic_user_password
          APIKey: api_key

About

Custom traefik plugin that logs custom messages to Elasticsearch

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 97.9%
  • Makefile 2.1%