{"id":18113345,"url":"https://github.com/solarwinds/fluent-plugin-papertrail","last_synced_at":"2025-08-21T15:32:41.628Z","repository":{"id":56847094,"uuid":"106888264","full_name":"solarwinds/fluent-plugin-papertrail","owner":"solarwinds","description":"Fluentd integration with Papertrail.","archived":false,"fork":false,"pushed_at":"2023-10-31T12:45:31.000Z","size":66,"stargazers_count":22,"open_issues_count":5,"forks_count":11,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-12-10T10:02:32.471Z","etag":null,"topics":["fluent-plugin-papertrail","fluentd","gemspec","kubernetes","log","logging","papertrail"],"latest_commit_sha":null,"homepage":"","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/solarwinds.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":"2017-10-14T01:30:23.000Z","updated_at":"2024-12-08T07:52:10.000Z","dependencies_parsed_at":"2022-09-09T01:00:43.196Z","dependency_job_id":"73d536ec-90be-41f5-a91c-0b6c3d737353","html_url":"https://github.com/solarwinds/fluent-plugin-papertrail","commit_stats":{"total_commits":33,"total_committers":7,"mean_commits":4.714285714285714,"dds":0.6666666666666667,"last_synced_commit":"481a535cc82a8569d68dc928cec00dcf54db5e33"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solarwinds%2Ffluent-plugin-papertrail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solarwinds%2Ffluent-plugin-papertrail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solarwinds%2Ffluent-plugin-papertrail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solarwinds%2Ffluent-plugin-papertrail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/solarwinds","download_url":"https://codeload.github.com/solarwinds/fluent-plugin-papertrail/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230520393,"owners_count":18238948,"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":["fluent-plugin-papertrail","fluentd","gemspec","kubernetes","log","logging","papertrail"],"created_at":"2024-11-01T02:07:45.404Z","updated_at":"2024-12-20T01:15:53.725Z","avatar_url":"https://github.com/solarwinds.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fluent::Plugin::Papertrail\n\n[![Gem Version](https://badge.fury.io/rb/fluent-plugin-papertrail.svg)](https://badge.fury.io/rb/fluent-plugin-papertrail) [![CircleCI](https://circleci.com/gh/solarwinds/fluent-plugin-papertrail/tree/master.svg?style=shield)](https://circleci.com/gh/solarwinds/fluent-plugin-papertrail/tree/master)\n\n## Description\n\nThis repository contains the Fluentd Papertrail Output Plugin.\n\n## Installation\n\nInstall this gem when setting up fluentd:\n```ruby\ngem install fluent-plugin-papertrail\n```\n\n## Usage\n\n### Setup\n\nThis plugin connects to Papertrail log destinations over TCP+TLS. This connection method should be enabled by default in standard Papertrail accounts, see:\n```\npapertrailapp.com \u003e Settings \u003e Log Destinations\n```\n\nTo configure this in fluentd:\n```xml\n\u003cmatch whatever.*\u003e\n  type papertrail\n  papertrail_host \u003cyour papertrail hostname\u003e\n  papertrail_port \u003cyour papertrail port\u003e\n\u003c/match\u003e\n```\n\n### Configuring a record_transformer\n\nThis plugin expects the following fields to be set for each Fluent record:\n```\n    message   The log\n    program   The program/tag\n    severity  A valid syslog severity label\n    facility  A valid syslog facility label\n    hostname  The source hostname for papertrail logging\n```\n\nThe following example is a `record_transformer` filter, from the Kubernetes assets [in the Solarwinds fluentd-deployment repo](https://github.com/solarwinds/fluentd-deployment/blob/master/docker/conf/kubernetes.conf), that is used along with the [fluent-plugin-kubernetes_metadata_filter](https://github.com/fabric8io/fluent-plugin-kubernetes_metadata_filter) to populate the required fields for our plugin:\n```yaml\n\u003cfilter kubernetes.**\u003e\n  type kubernetes_metadata\n\u003c/filter\u003e\n\n\u003cfilter kubernetes.**\u003e\n  type record_transformer\n  enable_ruby true\n  \u003crecord\u003e\n    hostname ${record[\"kubernetes\"][\"namespace_name\"]}-${record[\"kubernetes\"][\"pod_name\"]}\n    program ${record[\"kubernetes\"][\"container_name\"]}\n    severity info\n    facility local0\n    message ${record['log']}\n  \u003c/record\u003e\n\u003c/filter\u003e\n```\n\nIf you don't set `hostname` and `program` values in your record, they will default to the environment variable `FLUENT_HOSTNAME` or `'unidentified'` and the fluent tag, respectively.\n\n### Advanced Configuration\nThis plugin inherits a few useful config parameters from Fluent's `BufferedOutput` class.\n\nParameters for flushing the buffer, based on size and time, are `buffer_chunk_limit` and `flush_interval`, respectively. This plugin overrides the inherited default `flush_interval` to `1`, causing the fluent buffer to flush to Papertrail every second. \n\nIf the plugin fails to write to Papertrail for any reason, the log message will be put back in Fluent's buffer and retried. Retrying can be tuned and inherits a default configuration where `retry_wait` is set to `1` second and `retry_limit` is set to `17` attempts.\n\nIf you want to change any of these parameters simply add them to a match stanza. For example, to flush the buffer every 60 seconds and stop retrying after 2 attempts, set something like:\n```xml\n\u003cmatch whatever.*\u003e\n  type papertrail\n  papertrail_host \u003cyour papertrail hostname\u003e\n  papertrail_port \u003cyour papertrail port\u003e\n  flush_interval 60\n  retry_limit 2\n\u003c/match\u003e\n```\n\n## Kubernetes Annotations\n\nIf you're running this plugin in Kubernetes with the kubernetes_metadata_filter plugin enabled you can redirect logs to alternate Papertrail destinations by adding annotations to your Pods or Namespaces:\n\n```\nsolarwinds.io/papertrail_host: 'logs0.papertrailapp.com'\nsolarwinds.io/papertrail_port: '12345'\n```\n\nIf both the Pod and Namespace have annotations for any running Pod, the Pod's annotation is used.\n\n## Development\n\nThis plugin is targeting Ruby 2.4 and Fluentd v1.0, although it should work with older versions of both.\n\nWe have a [Makefile](Makefile) to wrap common functions and make life easier.\n\n### Install Dependencies\n`make bundle`\n\n### Test\n`make test`\n\n### Release in [RubyGems](https://rubygems.org/gems/fluent-plugin-papertrail)\nTo release a new version, update the version number in the [GemSpec](fluent-plugin-papertrail.gemspec) and then, run:\n\n`make release`\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at: https://github.com/solarwinds/fluent-plugin-papertrail\n\n## License\n\nThe gem is available as open source under the terms of the [Apache License](LICENSE).\n\n# Questions/Comments?\n\nPlease [open an issue](https://github.com/solarwinds/fluent-plugin-papertrail/issues/new), we'd love to hear from you.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolarwinds%2Ffluent-plugin-papertrail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsolarwinds%2Ffluent-plugin-papertrail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolarwinds%2Ffluent-plugin-papertrail/lists"}