{"id":16643535,"url":"https://github.com/sonots/fluent-plugin-file2","last_synced_at":"2025-07-15T16:11:47.450Z","repository":{"id":23631178,"uuid":"27000911","full_name":"sonots/fluent-plugin-file2","owner":"sonots","description":"Re-implmentation of out_file plugin for Fluentd","archived":false,"fork":false,"pushed_at":"2016-05-31T12:50:33.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-14T12:49:31.145Z","etag":null,"topics":["experimental","fluentd-output-plugin","fluentd-plugin","unmaintained-dont-use"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/sonots.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-22T14:16:00.000Z","updated_at":"2017-09-15T08:17:40.000Z","dependencies_parsed_at":"2022-08-22T03:30:34.660Z","dependency_job_id":null,"html_url":"https://github.com/sonots/fluent-plugin-file2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sonots/fluent-plugin-file2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonots%2Ffluent-plugin-file2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonots%2Ffluent-plugin-file2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonots%2Ffluent-plugin-file2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonots%2Ffluent-plugin-file2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sonots","download_url":"https://codeload.github.com/sonots/fluent-plugin-file2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonots%2Ffluent-plugin-file2/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265444920,"owners_count":23766437,"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":["experimental","fluentd-output-plugin","fluentd-plugin","unmaintained-dont-use"],"created_at":"2024-10-12T08:08:51.468Z","updated_at":"2025-07-15T16:11:47.426Z","avatar_url":"https://github.com/sonots.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fluent-plugin-file2\n\n[![Build Status](https://secure.travis-ci.org/sonots/fluent-plugin-file2.png?branch=master)](http://travis-ci.org/sonots/fluent-plugin-file2)\n\nRe-implementation of out\\_file plugin for Fluentd.\n\n## Problems of out\\_file\n\n1. `out_file` plugin is not thread-safe and process-safe. See http://d.hatena.ne.jp/sfujiwara/20121027/1351330488 (Japanese)\n2. `out_file` plugin creates multiple separated buffer files on running multiple threads (and processes). Want to write into one file cuncurrently from multiple threads (and processes).\n3. Because of 2, `symlink_path` option will be broken under multiple threads (or processes)\n4. Complex (Do we really need the File Buffer before writing file? Both is file!)\n\n## Strategy\n\nThe fundamental strategy to solve above problems is:\n\nSpecify `path` with time format, and just append contents to the strftime filename from multiple threads (and processes). No buffer file is generated anymore.\nThis is the same strategy with [strftime_logger](https://github.com/sonots/strftime_logger), which is already running on my production environment.\n\nFor compression, create a thread for compression running in an interval implied by the time format in the `path` (like 1 hour interval for %H) to compress a previously generated file.\nThe thread and process safety is achieved by a delicate implementation, just for compatibility with out\\_file, although I actually think running another cron job for compression is better approach. \n\n## Example\n\nSee [example.conf](./example/example.conf)\n\n## Configuration\n\nBasically same with out\\_file plugin. You may see the doc of [out_file](http://docs.fluentd.org/articles/out_file). \n\n* path\n\n    The path of the file such as `foo.%Y%m%d%H.log`.\n \n    The time format used as part of the file name. The following characters are replaced with actual values when the file is created:\n    \n    * %Y: year including the century (at least 4 digits)\n    * %m: month of the year (01..12)\n    * %d: Day of the month (01..31)\n    * %H: Hour of the day, 24-hour clock (00..23)\n    * %M: Minute of the hour (00..59)\n    * %S: Second of the minute (00..60)\n\n* time\\_slice\\_format (obsolete)\n\n    This option is provided just for compatibility with `out_file`. \n    Use time format in `path` parameter instead.\n\n* format\n\n    The format of the file content. The default is `out_file`.\n\n    Please refer [out_file#format](http://docs.fluentd.org/articles/out_file#format).\n\n* time\\_format\n\n    The format of the time written in files. The default format is ISO-8601.\n\n* utc\n\n    Uses UTC for path formatting. The default format is localtime.\n\n* compress\n\n    Compresses files using gzip. No compression is performed by default.\n\n* time\\_slice\\_wait (obsolete)\n\n    This option is provided just for compatibility with `out_file`.\n    Use `compress_wait` instead.\n\n* compress\\_wait\n\n    The amount of time Fluentd will wait for old logs to compress. This is used to account for delays in logs arriving to your Fluentd node. The default wait time is 10 minutes (‘10m’), where Fluentd will wait until 10 minutes past the hour for any logs that occured within the past hour.\n\n    For example, when splitting files on an hourly basis, a log recorded at 1:59 but arriving at the Fluentd node between 2:00 and 2:10 will be uploaded together with all the other logs from 1:00 to 1:59 in one transaction, avoiding extra overhead. Larger values can be set as needed.\n\n* symlink\\_path\n\n    Create symlink to the newest file created.. No symlink is created by default. This is useful for tailing file content to check logs.\n\n## Differences\n\nNotable differences with `out_file`:\n\n* No buffer file is generated.\n* `append true|false` option was removed. Always `append true`. \n* Filename is expanded using the current time, rather than the time in a chunk. \n\n## ChangeLog\n\nSee [CHANGELOG.md](CHANGELOG.md) for details.\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new [Pull Request](../../pull/new/master)\n\n## Copyright\n\nCopyright (c) 2014 Naotoshi Seo. See [LICENSE](LICENSE) for details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonots%2Ffluent-plugin-file2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsonots%2Ffluent-plugin-file2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonots%2Ffluent-plugin-file2/lists"}