{"id":15286508,"url":"https://github.com/eeddaann/fluent-plugin-loki","last_synced_at":"2025-04-10T04:04:26.148Z","repository":{"id":33931885,"uuid":"163602750","full_name":"eeddaann/fluent-plugin-loki","owner":"eeddaann","description":"Fluntd output plugin to Grafana Loki","archived":false,"fork":false,"pushed_at":"2024-05-11T11:00:08.000Z","size":16,"stargazers_count":26,"open_issues_count":2,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T04:04:20.036Z","etag":null,"topics":["fluentd","grafana","grafana-loki","loki"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eeddaann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-30T16:49:27.000Z","updated_at":"2025-03-04T03:28:23.000Z","dependencies_parsed_at":"2024-10-31T02:01:30.462Z","dependency_job_id":"3c038280-24df-4715-8f12-036d87383c54","html_url":"https://github.com/eeddaann/fluent-plugin-loki","commit_stats":{"total_commits":8,"total_committers":2,"mean_commits":4.0,"dds":0.125,"last_synced_commit":"05fd6b4f62cc2db4441e4af72455592a9a1dfc0b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eeddaann%2Ffluent-plugin-loki","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eeddaann%2Ffluent-plugin-loki/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eeddaann%2Ffluent-plugin-loki/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eeddaann%2Ffluent-plugin-loki/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eeddaann","download_url":"https://codeload.github.com/eeddaann/fluent-plugin-loki/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248154984,"owners_count":21056543,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fluentd","grafana","grafana-loki","loki"],"created_at":"2024-09-30T15:15:14.282Z","updated_at":"2025-04-10T04:04:26.104Z","avatar_url":"https://github.com/eeddaann.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fluent-plugin-loki\n\n[Fluentd](https://fluentd.org/) output plugin to [Grafana Loki](https://github.com/grafana/loki).\n\n- Can be used to ship docker logs to Loki (using [Fluentd docker logging driver](https://docs.docker.com/config/containers/logging/fluentd/))\n- Enable easier transtion to Loki - an alternative to Loki's Promtail \n\n## Installation\n\n### RubyGems\n\n```\n$ gem install fluent-plugin-loki\n```\n\n## Configuration\nsample configuration:\n```\n\u003cmatch *\u003e\n  @type loki\n  endpoint_url    http://127.0.0.1:3100\n  labels          {\"env\":\"prod\",\"farm\":\"a\"} # default: nil\n  tenant          abcd           # default: nil\n  rate_limit_msec 100            # default: 0 = no rate limiting\n  raise_on_error  false          # default: true\n  authentication  basic          # default: none\n  username        alice          # default: ''\n  password        bobpop         # default: '', secret: true\n  buffered        true           # default: false. Switch non-buffered/buffered mode\n  cacert_file     /etc/ssl/endpoint1.cert # default: ''\n  token           tokent         # default: ''\n  custom_headers  {\"token\":\"arbitrary\"} # default: nil\n\u003c/match\u003e\n```\n- **endpoint_url** - Loki's endpoint\n- **tenant** - Loki tenant id\n- **labels** - Labels for filtering in Grafana (currently they are static)\n\n(generated by running: ```fluent-plugin-config-format output loki -p lib/fluent/plugin```)\n\n## Usage examples for common fluentd inputs:\n### syslog\n*Setting up rsyslog*\nOpen ```/etc/rsyslog.d/50-default.conf``` and append the following line:\n```*.* @127.0.0.1:5140```\nThen restart the rsyslogd service:\n```sudo systemctl restart syslog```\n*sample fluentd config:*\n```\n\u003csource\u003e\n  @type syslog\n  port 5140\n  bind 0.0.0.0\n  tag system\n\u003c/source\u003e\n```\n*simulate data:*\n```logger \"came from syslog\"```\n### file\n*sample fluentd config:*\n```\n## File input\n## read apache logs with tag=apache.access\n#\u003csource\u003e\n#  @type tail\n#  format apache\n#  path /var/log/httpd-access.log\n#  tag apache.access\n#\u003c/source\u003e\n```\n### HTTP\n*sample fluentd config:*\n```\n# HTTP input\n# http://localhost:8888/\u003ctag\u003e?json=\u003cjson\u003e\n# for ex: http://localhost:8888/baz?json={\"src\":\"http\"}\n\u003csource\u003e\n  @type http\n  @id http_input\n\n  port 8888\n\u003c/source\u003e\n```\n*simulate data:*\n```bash\ncurl -X POST -d 'json={\"src\":\"http\"}' http://localhost:8888\n```\n### tcp\n*sample fluentd config:*\n```\n## built-in TCP input\n## $ echo \u003cjson\u003e | fluent-cat \u003ctag\u003e\n\u003csource\u003e\n  @type forward\n  @id forward_input\n\u003c/source\u003e\n```\n*simulate data:*\n```bash\necho '{\"src\":\"tcp\"}' | fluent-cat tcp\n```\n\n## Development (using Docker)\n- Set up Loki and Grafana (can be done by running their [docker-compose](https://github.com/grafana/loki/blob/master/production/docker-compose.yaml))\n- Add loki data source to grafana\n- Run Fluentd container with volume mapping to the dummy configuration and to the plugin:\n```bash\ndocker run -d \\\n  -p 9880:9880 \\\n  -v $(pwd)/development/conf:/fluentd/etc \\\n  -v $(pwd)/lib/fluent/plugin:/etc/fluent/plugin -e FLUENTD_CONF=fluentd.conf \\\n  fluent/fluentd\n```\n- Execute to send log: ```curl -X POST -d 'json={\"foo\":\"baz\"}' http://localhost:9880```\n\n\n## Copyright\n\n* Copyright(c) 2018- Edan Shahmoon\n* License\n  * Apache License, Version 2.0\n\nHeavily based on [fluent-plugin-out-http](https://github.com/fluent-plugins-nursery/fluent-plugin-out-http)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feeddaann%2Ffluent-plugin-loki","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feeddaann%2Ffluent-plugin-loki","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feeddaann%2Ffluent-plugin-loki/lists"}