{"id":28233500,"url":"https://github.com/logdna/logspout","last_synced_at":"2025-06-14T23:30:49.541Z","repository":{"id":52671588,"uuid":"143919414","full_name":"logdna/logspout","owner":"logdna","description":"LogDNA Docker integration","archived":false,"fork":false,"pushed_at":"2023-10-20T21:14:37.000Z","size":11311,"stargazers_count":16,"open_issues_count":12,"forks_count":19,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-06-03T15:25:46.504Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/logdna.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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-08-07T19:43:22.000Z","updated_at":"2024-07-10T18:31:01.000Z","dependencies_parsed_at":"2024-06-19T00:17:46.357Z","dependency_job_id":"d7c483cf-a352-44db-ad40-5e5614daa0fc","html_url":"https://github.com/logdna/logspout","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logdna%2Flogspout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logdna%2Flogspout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logdna%2Flogspout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logdna%2Flogspout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/logdna","download_url":"https://codeload.github.com/logdna/logspout/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logdna%2Flogspout/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":258977471,"owners_count":22787125,"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":[],"created_at":"2025-05-18T21:10:11.427Z","updated_at":"2025-06-14T23:30:49.534Z","avatar_url":"https://github.com/logdna.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LogDNA LogSpout\nA Docker LogSpout image to stream logs from your containers to LogDNA.\n\n## How to Use\n\n### Environment Variables\nThe following variables can be used to tune `LogSpout` for specific use cases.\n\n#### Log Router Specific\n* __FILTER_NAME__: Filter by Container Name with Wildcards, *Optional*\n* __FILTER_ID__: Filter by Container ID with Wildcards, *Optional*\n* __FILTER_SOURCES__: Filter by Comma-Separated List of Sources, *Optional*\n* __FILTER_LABELS__: Filter by Comma-Separated List of Labels, *Optional*\n\n__Note__: More information can be found [here](https://github.com/gliderlabs/logspout/tree/0da75a223db992cd5abc836796174588ddfc62b4/routesapi#routes-resource).\n\n#### Ingestion Specific\n* __LOGDNA_KEY__: LogDNA Ingestion Key, *Required*\n* __HOSTNAME__: Alternative Hostname, *Optional*\n  * __Default__: System's Hostname\n* __LOGDNA_URL__: Specific Endpoint to Stream Log into, *Optional*\n  * __Default__: `logs.logdna.com/logs/ingest`\n* __TAGS__: Comma-Separated List of Tags, *Optional*\n\n__Note__: Logging the `LogSpout` Container is recommended to keep track of HTTP Request Errors or Exceptions.\n\n#### Limits\n* __FLUSH_INTERVAL__: How frequently batches of logs are sent (in `milliseconds`), *Optional*\n  * __Default__: 250\n* __HTTP_CLIENT_TIMEOUT__: Time limit (in `seconds`) for requests made by this HTTP Client, *Optional*\n  * __Default__: 30\n  * __Source__: [net/http/client.go#Timeout](https://github.com/golang/go/blob/master/src/net/http/client.go#L89-L104)\n* __INACTIVITY_TIMEOUT__: How long to wait for inactivity before declaring failure in the `Docker API` and restarting, *Optional*\n  * __Default__: 1m\n  * __Note__: More information about the possible values can be found [here](https://github.com/gliderlabs/logspout#detecting-timeouts-in-docker-log-streams). Also see [`time.ParseDuration`](https://golang.org/pkg/time/#ParseDuration) for valid format as recommended [here](https://github.com/gliderlabs/logspout/blob/e671009d9df10e8139f6a4bea8adc9c7878ff4e9/router/pump.go#L112-L116).\n* __MAX_BUFFER_SIZE__: The maximum size (in `mb`) of batches to ship to `LogDNA`, *Optional*\n  * __Default__: 2\n* __MAX_REQUEST_RETRY__: The maximum number of retries for sending a line when there are network failures, *Optional*\n  * __Default__: 5\n\n### Docker\nCreate and run container named *logdna* from this image using CLI:\n```bash\nsudo docker run --name=\"logdna\" --restart=always \\\n-d -v=/var/run/docker.sock:/var/run/docker.sock \\\n-e LOGDNA_KEY=\"\u003cLogDNA Ingestion Key\u003e\" \\\nlogdna/logspout:latest\n```\n\n### Docker Cloud\nAppend the following to your Docker Cloud stackfile:\n```yaml\nlogdna:\n  autoredeploy: true\n  deployment_strategy: every_node\n  environment:\n    - LOGDNA_KEY=\"\u003cLogDNA Ingestion Key\u003e\"\n    - TAGS='{{.Container.Config.Hostname}}'\n  image: 'logdna/logspout:latest'\n  restart: always\n  volumes:\n    - '/var/run/docker.sock:/var/run/docker.sock'\n```\n\n### Elastic Container Service (ECS)\nModify your ECS Cloud Configuration file to have `LogDNA` Service as described below:\n```yaml\nservices:\n  logdna:\n    environment:\n        - LOGDNA_KEY=\"\u003cLogDNA Ingestion Key\u003e\"\n        - TAGS='{{ if .Container.Config.Labels }}{{index .Container.Config.Labels \"com.amazonaws.ecs.task-definition-family\"}}:{{index .Container.Config.Labels \"com.amazonaws.ecs.container-name\"}}{{ else }}{{.ContainerName}}{{ end }}'\n    image: logdna/logspout:latest\n    restart: always\n    volumes:\n      - /var/run/docker.sock:/var/run/docker.sock\n    deploy:\n      mode: global\n```\n\n### Rancher\nModify your Rancher Compose Stackfile to have `LogDNA` Service as described below:\n```yaml\nversion: '2'\nservices:\n  logdna:\n    image: logdna/logspout:latest\n    environment:\n      LOGDNA_KEY=\"\u003cLogDNA Ingestion Key\u003e\"\n    restart: always\n    labels:\n      io.rancher.container.hostname_override: container_name\n      io.rancher.container.pull_image: always\n      io.rancher.os.scope: system\n    volumes:\n    - /var/run/docker.sock:/tmp/docker.sock\n```\n\n### Docker Swarm\nModify your Docker Swarm Compose file to have `LogDNA` Service as described below:\n```yaml\nversion: \"3\"\nnetworks:\n  logging:\nservices:\n  logdna:\n    image: logdna/logspout:latest\n    networks:\n      - logging\n    volumes:\n      - /etc/hostname:/etc/host_hostname:ro\n      - /var/run/docker.sock:/var/run/docker.sock\n    environment:\n      - LOGDNA_KEY=\"\u003cLogDNA Ingestion Key\u003e\"\n    deploy:\n      mode: global\n```\n\n### Notes\nDo not forget to add `-u root` (in CLI) or `user: root` (in YAML) in case of having permission issues.\n\n## Contributing\nContributions are always welcome. See the [contributing guide](/CONTRIBUTING.md) to learn how you can help. Build instructions for the agent are also in the guide.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogdna%2Flogspout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flogdna%2Flogspout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogdna%2Flogspout/lists"}