{"id":27627246,"url":"https://github.com/treasure-data/chef-td-agent","last_synced_at":"2025-04-23T13:53:45.856Z","repository":{"id":2077643,"uuid":"3016881","full_name":"treasure-data/chef-td-agent","owner":"treasure-data","description":"Chef Cookbook for td-agent (Treasure Agent or Fluentd)","archived":false,"fork":false,"pushed_at":"2024-03-18T23:15:52.000Z","size":244,"stargazers_count":127,"open_issues_count":21,"forks_count":119,"subscribers_count":85,"default_branch":"master","last_synced_at":"2024-04-10T19:38:18.827Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://supermarket.chef.io/cookbooks/td-agent","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/treasure-data.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,"governance":null}},"created_at":"2011-12-20T03:02:10.000Z","updated_at":"2024-04-10T19:38:18.828Z","dependencies_parsed_at":"2023-07-05T19:49:19.129Z","dependency_job_id":null,"html_url":"https://github.com/treasure-data/chef-td-agent","commit_stats":{"total_commits":234,"total_committers":50,"mean_commits":4.68,"dds":0.5085470085470085,"last_synced_commit":"fdb75ce53550c43bdcc0878f849c6ee3c8886283"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treasure-data%2Fchef-td-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treasure-data%2Fchef-td-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treasure-data%2Fchef-td-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treasure-data%2Fchef-td-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/treasure-data","download_url":"https://codeload.github.com/treasure-data/chef-td-agent/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250444253,"owners_count":21431615,"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-04-23T13:53:45.123Z","updated_at":"2025-04-23T13:53:45.843Z","avatar_url":"https://github.com/treasure-data.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/treasure-data/chef-td-agent.svg?branch=master)](https://travis-ci.org/treasure-data/chef-td-agent)\n\n# DESCRIPTION\n\n[Chef](https://www.chef.io/chef/) cookbook for td-agent (Treasure Data Agent). The release log of td-agent is available [here](http://docs.treasure-data.com/articles/td-agent-changelog).\n\nNOTE: td-agent is open-sourced as the [Fluentd project](http://github.com/fluent/). If you want to use a stable version of Fluentd, using this cookbook is recommended.\n\n# INSTALLATION\n\n## Installing with Berkshelf\n\nThis cookbook is released on [Chef Supermarket](https://supermarket.chef.io/). You can install the cookbook using [Berkshelf](http://berkshelf.com/).\n\n```sh\n$ echo 'cookbook \"td-agent\"' \u003e\u003e Berksfile\n$ berks install\n```\n\n## Installing with knife-github-cookbooks\n\nThe [knife-github-cookbooks](https://github.com/websterclay/knife-github-cookbooks) gem is a plugin for knife that supports installing cookbooks directly from a GitHub repository. To install with this plugin, please follow these steps:\n\n```sh\n$ gem install knife-github-cookbooks\n$ cd chef-repo\n$ knife cookbook github install treasure-data/chef-td-agent\n```\n\n## NOTICE\n\nThis cookbook may be used on Amazon Linux but we cannot guarantee if td-agent will work properly because\nAWS doesn't guarantee binary compatibility with RHEL (they aim to be \"as compatible as possible\").\nIf users encounter any compatibility issues with td-agent on Amazon Linux, they should contact AWS.\n\n# REQUIREMENTS\n\nThis cookbook has these external dependencies.\n\n* apt cookbook\n* yum cookbook\n\n# ATTRIBUTES\n\n## api\\_key\n\nAPI Key, and the Secret Key are required.\n\n* `node[:td_agent][:api_key]` (required)\n\n## plugins\n\nA list of fluentd plugins to install. The `fluent-plugin-` prefix is automatically added. Additional variables can be passed.\n\n- `node[:td_agent][:plugins]`\n\n### Example\n\nThis installs the latest version of `fluent-plugin-flowcounter` and version 0.0.9 of `fluent-plugin-rewrite`.\n\n```ruby\nnode[:td_agent][:plugins] = [\n  \"flowcounter\",\n  { \"rewrite\" =\u003e { \"version\" =\u003e \"0.0.9\" } }\n]\n```\n\n## version\n\nYou can install the latest td-agent 2 using the `version` attribute and major version.\n\n```ruby\nnode[:td_agent][:version] = '2'\n```\n\nYou can also specify the full version.\n\n```ruby\nnode[:td_agent][:version] = '2.0.4'\n```\n\n## pinning\\_version and version\n\nIf `pinning_version` is true, then `version`'s td-agent will be installed. The default `version` is the latest version.\n\n* `node[:td_agent][:pinning_version]`\n* `node[:td_agent][:version]`\n\nIn this case, you should set the full version in `node[:td_agent][:version]`.\n\n## uid\n\nUID of td-agent user. Automatically assigned by default.\n\n## gid\n\nGID of td-agent group. Automatically assigned by default.\n\n# RESOURCES / PROVIDERS\n\n## td\\_agent\\_gem\n\nInstalls a gem or fluentd plugin using the embedded `fluent-gem`\n\n### Actions\n\n| Action  | Description                                                                             |\n| ------- | --------------------------------------------------------------------------------------- |\n| install | Install the gem, optinally with a specific version. Default.                            |\n| upgrade | Upgrade to the latest gem                                                               |\n| remove  | Remove the gem                                                                          |\n| purge   | Purge the gem                                                                           |\n\n### Attributes\n\n| Attribute      | Description                                                                      |\n| -------------- | -------------------------------------------------------------------------------- |\n| package\\_name  |  Gem name. Defaults to `name`                                                    |\n| version        | Gem version. Installs the latest if none specified                               |\n| source         | Local .gem file                                                                  |\n| options        | Options passed to the gem command                                                |\n| gem\\_binary    | Override path to the gem command                                                 |\n| response\\_file | Not supported                                                                    |\n| plugin         | If true, no need to prefix the gem name w/ \"fluent-plugin-\". Defaults to `false` |\n\n### Examples\n\nThis installs `fluent-plugin-datacounter` (v0.2.0)\n\n```ruby\ntd_agent_gem \"datacounter\" do\n  version \"0.2.0\"\n  plugin true\nend\n```\n\nThis installs the latest version of `aws-sdk`\n\n```ruby\ntd_agent_gem \"aws-sdk\" do\n  plugin false\nend\n```\n\n## td_agent_source\n\nCreate file with source definition in `/etc/td-agent/conf.d` directory. It works only if `node[:td_agent][:includes]` is `true`\n\nNotice: If you use some plugins in your sources, you should install it before you call lwrp.\n\n### Actions\n\n| Action | Description |\n|----------|----------------|\n| :create | Create a file |\n| :delete | Delete a file |\n\n### Attributes\n\n| Attribute | Description |\n|-------------|----------------|\n| source_name | File name. To its value will be added `.conf`. Defaults to `name`  |\n| type | Type of source. This is name of input plugin. |\n| tag | Tag, what uses in fluentd routing. |\n| parameters | Parameters of source. Hash. |\n\n### Example\n\nThis example creates the source with `tail` type and  `syslog` tag which reads from `/var/log/messages` and parses it as `syslog`.\n\n```ruby\ntd_agent_source 'test_in_tail' do\n  type 'tail'\n  tag 'syslog'\n  parameters(format: 'syslog',\n         path: '/var/log/messages')\nend\n```\n\n## td_agent_match\n\nCreate file with match definition in `/etc/td-agent/conf.d` directory. It works only if `node[:td_agent][:includes]` is `true`\n\nNotice: Notice: If you use some plugins in your matches, you should install it before you call lwrp.\n\n### Actions\n\n| Action | Description |\n|----------|----------------|\n| :create | Create a file |\n| :delete | Delete a file |\n\n### Attributes\n\n| Attribute | Description |\n|-------------|----------------|\n| match_name | File name. To its value will be added `.conf`. Defaults to `name`  |\n| type | Type of match. This is name of output plugin. |\n| tag | Tag, what uses in fluentd routing. |\n| parameters | Parameters of match. Hash. |\n\n### Example\nThis example creates the match with type `copy` and tag `webserver.*` which sends log data to local graylog2 server.\n\n```ruby\ntd_agent_match 'test_gelf_match' do\n  type 'copy'\n  tag 'webserver.*'\n  parameters( store: [{ type: 'gelf',\n                   host: '127.0.0.1',\n                   port: 12201,\n                   flush_interval: '5s'},\n                   { type: 'stdout' }])\nend\n```\n\n## td_agent_filter\n\nCreate file with filter definition in `/etc/td-agent/conf.d` directory. It works only if `node[:td_agent][:includes]` is `true`\n\nNotice: Notice: If you use some plugins for your filters, you should install them before you call lwrp.\n\n### Actions\n\n| Action | Description |\n|----------|----------------|\n| :create | Create a filter |\n| :delete | Delete a filter |\n\n### Attributes\n\n| Attribute | Description |\n|-------------|----------------|\n| filter_name | File name. To its value will be added `.conf`. Defaults to `name`  |\n| type | Type of filter. This is name of output plugin. |\n| tag | Tag, what uses in fluentd routing. |\n| parameters | Parameters of filter. Hash. |\n\n### Example\nThis example creates the filter with type `record_transformer` and tag `webserver.*` which adds the `hostname` field with the server's hostname as its value:\n\n```ruby\ntd_agent_filter 'filter_webserver' do\n  type 'record_transformer'\n  tag 'webserver.*'\n  parameters(\n    record: [ { host_param: %Q|\"#{Socket.gethostname}\"| } ]\n  )\nend\n```\n\n## td_agent_plugin\n\nInstall plugin from url to `/etc/td-agent/plugin` dir.\n\n### Actions\n\n| Action | Description |\n|----------|----------------|\n| :create | Install plugin |\n| :delete | Uninstall plugin |\n\n### Attributes\n\n| Attribute | Description |\n|-------------|----------------|\n| plugin_name | File name. To its value will be added `.rb`. Defaults to `name`  |\n| url | Url what contains plugin file. Value of this attribute may be the same as remote_file resource.  |\n\n### Example\n\nInstall plugin `gelf.rb` from url `https://raw.githubusercontent.com/emsearcy/fluent-plugin-gelf/master/lib/fluent/plugin/out_gelf.rb`\n\n```ruby\ntd_agent_plugin 'gelf' do\n  url 'https://raw.githubusercontent.com/emsearcy/fluent-plugin-gelf/master/lib/fluent/plugin/out_gelf.rb'\nend\n```\n\n## includes\n\nOptionally include `/etc/td-agent/conf.d/*.conf` files (i.e. symlinks, other recipes, etc.)\n\n* `node[:td_agent][:includes] = false`\n\n## default\\_config\n\nOptionally prevent `/etc/td-agent/td-agent.conf` from including default config.\n\n* `node[:td_agent][:default_config] = true`\n\n# USAGE\n\nThis is an example role file.\n\n```ruby\nname \"base\"\ndescription \"base server role.\"\nrun_list(\n  \"recipe[apt]\",\n  \"recipe[yum]\",\n  \"recipe[td-agent]\",\n)\noverride_attributes(\n  # for td-agent\n  :td_agent =\u003e {\n    :api_key =\u003e 'foo_bar_buz',\n    :plugins =\u003e [\n      'rewrite'\n    ]\n  }\n)\n```\n\n# HTTP API Options\n\n* `node[:td_agent][:in_http][:enable_api] = true`\n\nAccess to the API may be disabled by setting `enable_api` to `false`. This may be of particular use when\ntd-agent is being used on endpoint systems that are forwarding logs to a centralized td-agent server.\n\n# License\n\nCopyright 2014-today Treasure Data, Inc.\n\nThe code is licensed under the Apache License 2.0 (see  LICENSE for details).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftreasure-data%2Fchef-td-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftreasure-data%2Fchef-td-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftreasure-data%2Fchef-td-agent/lists"}