• Stars
    star
    127
  • Rank 281,191 (Top 6 %)
  • Language
    Ruby
  • License
    Apache License 2.0
  • Created almost 13 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Chef Cookbook for td-agent (Treasure Agent or Fluentd)

Build Status

DESCRIPTION

Chef cookbook for td-agent (Treasure Data Agent). The release log of td-agent is available here.

NOTE: td-agent is open-sourced as the Fluentd project. If you want to use a stable version of Fluentd, using this cookbook is recommended.

INSTALLATION

Installing with Berkshelf

This cookbook is released on Chef Supermarket. You can install the cookbook using Berkshelf.

$ echo 'cookbook "td-agent"' >> Berksfile
$ berks install

Installing with knife-github-cookbooks

The 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:

$ gem install knife-github-cookbooks
$ cd chef-repo
$ knife cookbook github install treasure-data/chef-td-agent

NOTICE

This cookbook may be used on Amazon Linux but we cannot guarantee if td-agent will work properly because AWS doesn't guarantee binary compatibility with RHEL (they aim to be "as compatible as possible"). If users encounter any compatibility issues with td-agent on Amazon Linux, they should contact AWS.

REQUIREMENTS

This cookbook has these external dependencies.

  • apt cookbook
  • yum cookbook

ATTRIBUTES

api_key

API Key, and the Secret Key are required.

  • node[:td_agent][:api_key] (required)

plugins

A list of fluentd plugins to install. The fluent-plugin- prefix is automatically added. Additional variables can be passed.

  • node[:td_agent][:plugins]

Example

This installs the latest version of fluent-plugin-flowcounter and version 0.0.9 of fluent-plugin-rewrite.

node[:td_agent][:plugins] = [
  "flowcounter",
  { "rewrite" => { "version" => "0.0.9" } }
]

version

You can install the latest td-agent 2 using the version attribute and major version.

node[:td_agent][:version] = '2'

You can also specify the full version.

node[:td_agent][:version] = '2.0.4'

pinning_version and version

If pinning_version is true, then version's td-agent will be installed. The default version is the latest version.

  • node[:td_agent][:pinning_version]
  • node[:td_agent][:version]

In this case, you should set the full version in node[:td_agent][:version].

uid

UID of td-agent user. Automatically assigned by default.

gid

GID of td-agent group. Automatically assigned by default.

RESOURCES / PROVIDERS

td_agent_gem

Installs a gem or fluentd plugin using the embedded fluent-gem

Actions

Action Description
install Install the gem, optinally with a specific version. Default.
upgrade Upgrade to the latest gem
remove Remove the gem
purge Purge the gem

Attributes

Attribute Description
package_name Gem name. Defaults to name
version Gem version. Installs the latest if none specified
source Local .gem file
options Options passed to the gem command
gem_binary Override path to the gem command
response_file Not supported
plugin If true, no need to prefix the gem name w/ "fluent-plugin-". Defaults to false

Examples

This installs fluent-plugin-datacounter (v0.2.0)

td_agent_gem "datacounter" do
  version "0.2.0"
  plugin true
end

This installs the latest version of aws-sdk

td_agent_gem "aws-sdk" do
  plugin false
end

td_agent_source

Create file with source definition in /etc/td-agent/conf.d directory. It works only if node[:td_agent][:includes] is true

Notice: If you use some plugins in your sources, you should install it before you call lwrp.

Actions

Action Description
:create Create a file
:delete Delete a file

Attributes

Attribute Description
source_name File name. To its value will be added .conf. Defaults to name
type Type of source. This is name of input plugin.
tag Tag, what uses in fluentd routing.
parameters Parameters of source. Hash.

Example

This example creates the source with tail type and syslog tag which reads from /var/log/messages and parses it as syslog.

td_agent_source 'test_in_tail' do
  type 'tail'
  tag 'syslog'
  parameters(format: 'syslog',
         path: '/var/log/messages')
end

td_agent_match

Create file with match definition in /etc/td-agent/conf.d directory. It works only if node[:td_agent][:includes] is true

Notice: Notice: If you use some plugins in your matches, you should install it before you call lwrp.

Actions

Action Description
:create Create a file
:delete Delete a file

Attributes

Attribute Description
match_name File name. To its value will be added .conf. Defaults to name
type Type of match. This is name of output plugin.
tag Tag, what uses in fluentd routing.
parameters Parameters of match. Hash.

Example

This example creates the match with type copy and tag webserver.* which sends log data to local graylog2 server.

td_agent_match 'test_gelf_match' do
  type 'copy'
  tag 'webserver.*'
  parameters( store: [{ type: 'gelf',
                   host: '127.0.0.1',
                   port: 12201,
                   flush_interval: '5s'},
                   { type: 'stdout' }])
end

td_agent_filter

Create file with filter definition in /etc/td-agent/conf.d directory. It works only if node[:td_agent][:includes] is true

Notice: Notice: If you use some plugins for your filters, you should install them before you call lwrp.

Actions

Action Description
:create Create a filter
:delete Delete a filter

Attributes

Attribute Description
filter_name File name. To its value will be added .conf. Defaults to name
type Type of filter. This is name of output plugin.
tag Tag, what uses in fluentd routing.
parameters Parameters of filter. Hash.

Example

This example creates the filter with type record_transformer and tag webserver.* which adds the hostname field with the server's hostname as its value:

td_agent_filter 'filter_webserver' do
  type 'record_transformer'
  tag 'webserver.*'
  parameters(
    record: [ { host_param: %Q|"#{Socket.gethostname}"| } ]
  )
end

td_agent_plugin

Install plugin from url to /etc/td-agent/plugin dir.

Actions

Action Description
:create Install plugin
:delete Uninstall plugin

Attributes

Attribute Description
plugin_name File name. To its value will be added .rb. Defaults to name
url Url what contains plugin file. Value of this attribute may be the same as remote_file resource.

Example

Install plugin gelf.rb from url https://raw.githubusercontent.com/emsearcy/fluent-plugin-gelf/master/lib/fluent/plugin/out_gelf.rb

td_agent_plugin 'gelf' do
  url 'https://raw.githubusercontent.com/emsearcy/fluent-plugin-gelf/master/lib/fluent/plugin/out_gelf.rb'
end

includes

Optionally include /etc/td-agent/conf.d/*.conf files (i.e. symlinks, other recipes, etc.)

  • node[:td_agent][:includes] = false

default_config

Optionally prevent /etc/td-agent/td-agent.conf from including default config.

  • node[:td_agent][:default_config] = true

USAGE

This is an example role file.

name "base"
description "base server role."
run_list(
  "recipe[apt]",
  "recipe[yum]",
  "recipe[td-agent]",
)
override_attributes(
  # for td-agent
  :td_agent => {
    :api_key => 'foo_bar_buz',
    :plugins => [
      'rewrite'
    ]
  }
)

HTTP API Options

  • node[:td_agent][:in_http][:enable_api] = true

Access to the API may be disabled by setting enable_api to false. This may be of particular use when td-agent is being used on endpoint systems that are forwarding logs to a centralized td-agent server.

License

Copyright 2014-today Treasure Data, Inc.

The code is licensed under the Apache License 2.0 (see LICENSE for details).

More Repositories

1

digdag

Workload Automation System
Java
1,301
star
2

serverengine

A framework to implement robust multiprocess servers like Unicorn
Ruby
756
star
3

prestogres

PostgreSQL protocol gateway for Presto distributed SQL query engine
C
293
star
4

perfectqueue

Highly available distributed queue built on RDBMS
Ruby
124
star
5

treasure-boxes

Treasure Boxes - pre-built pieces of code for developing, optimizing, and analyzing your data.
Python
109
star
6

td-agent

This repository is OBSOLETE, check gh/treasure-data/omnibus-td-agent
Shell
109
star
7

perfectsched

Highly available distributed cron built on RDBMS
Ruby
97
star
8

omnibus-td-agent

td-agent (Fluentd) Packaging Scripts
Shell
82
star
9

trino-client-ruby

Trino/Presto client library for Ruby
Ruby
69
star
10

td-js-sdk

JavaScript SDK for Treasure Data
JavaScript
69
star
11

digdag-docs

Documents for Digdag Workflow Engine
HTML
50
star
12

td

CUI Interface
Ruby
49
star
13

elastic-beanstalk-td-agent

Example of installing td-agent on AWS Elastic Beanstalk (see .ebextentions directory)
Ruby
49
star
14

td-client-python

Treasure Data API library for Python
Python
46
star
15

pandas-td

Interactive data analysis with Pandas and Treasure Data.
Python
38
star
16

angular-treasure-overlay-spinner

Add a spinner to an element when binding is truthy.
JavaScript
36
star
17

kafka-fluentd-consumer

Kafka Consumer for Fluentd
Java
32
star
18

td-logger-ruby

Treasure Data logging library for Ruby / Rails
Ruby
27
star
19

luigi-td-example

Example Repository for Building Complex Data Pipeline with Luigi +TD
Python
24
star
20

td-ios-sdk

iOS SDK for Treasure Data
Objective-C
23
star
21

td-client-ruby

Ruby Client Library for Treasure Data
Ruby
23
star
22

td-android-sdk

Android SDK for Treasure Data
Java
22
star
23

heroku-td-agent

Treasure Agent on Heroku platform (accept HTTP logging)
Ruby
20
star
24

pytd

Treasure Data Driver for Python
Jupyter Notebook
18
star
25

luigi-td

Luigi Workflow Engine integration for Treasure Data
Python
16
star
26

td-logger-java

Treasure Data Logging Library for Java
Java
12
star
27

fluent-plugin-metricsense

MetricSense - application metrics collection plugin
Ruby
12
star
28

td-client-java

Java Client Library for Treasure Data
Java
12
star
29

td-client-node

Node.js Client Library for Treasure Data
JavaScript
12
star
30

metricsense

MetricSense for Ruby - application metrics collection API
Ruby
11
star
31

td-jdbc

JDBC Driver for Treasure Data
Java
11
star
32

embulk-input-google_analytics

Embulk Input Plugin for Google Analytics
Ruby
11
star
33

td-client-go

Go Client Library for Treasure Data
Go
11
star
34

sqsrun

Generic Amazon SQS Worker Executor Service
Ruby
10
star
35

Lead-List-from-CrunchBase-

Python
10
star
36

embulk-output-td

Embulk output plugin for Treasure Data
Java
10
star
37

td-ue4-sdk

Treasure Data Unreal Engine 4 SDK
C++
10
star
38

fluent-plugin-td-monitoring

Fluentd Plugin for Treasure Agent Monitoring Service
Ruby
10
star
39

stdout-hook

Import your event logs from STDOUT to TD or Fluentd
Ruby
9
star
40

ipython-notebook-examples

iPython notebook examples for Treasure Data
9
star
41

treasuredata_fdw

PostgreSQL Foreign Data Wrapper for Treasure Data
C
8
star
42

embulk-input-zendesk

Embulk Input Plugin for Zendesk
Java
8
star
43

embulk-input-td

Treasure Data Input Plugin for Embulk
Java
8
star
44

embulk-input-mixpanel

Embulk Input Plugin for Mixpanel
Ruby
8
star
45

td-notebooks

Jupyter notebook examples for Treasure Data
Jupyter Notebook
8
star
46

lambda-local-proxy

Local API proxy that calls an AWS Lambda function
Go
7
star
47

embulk-input-marketo

Embulk Input Plugin for Marketo
Java
7
star
48

treasure-academy-cdp

Python
6
star
49

fluent-plugin-td

Fluentd plugin for Treasure Data Service
Ruby
6
star
50

embulk-output-mailchimp

Embulk output plugin for Mailchimp
Java
6
star
51

lda-board

Auto segmentation UI using LDA
Ruby
5
star
52

fluent-plugin-librato-metrics

Librato Metrics output plugin for Fluentd event collector
Ruby
5
star
53

td-logger-python

Python logging module for td-agent
Python
4
star
54

embulk-filter-add_time

Java
4
star
55

embulk-input-jira

Embulk Input Plugin for JIRA
Java
4
star
56

RTD

Simple R client for Treasure Data
HTML
4
star
57

td-unity-sdk-package

Unity SDK for TreasureData
C#
3
star
58

eslint-plugin-td

Stores td-console config so that it can be reused
JavaScript
3
star
59

embulk-parser-query_string

Embulk parser plugin for URL-encoded key value pairs
Ruby
3
star
60

react-treasure-preview-table

console preview table for user data, react component
JavaScript
3
star
61

js-examples

HTML
3
star
62

facebook-open-academy-fluentd-2015

This is the "course page" for Facebook Open Academy 2015 (Winter) for Fluentd
3
star
63

td-cordova-sdk

Treasure Data SDK Cordova Plugin
JavaScript
3
star
64

rsched

Generic Reliable Scheduler
Ruby
3
star
65

hive-udf-neologd

Hive Japanese NLP UDFs with NEologd
Java
2
star
66

angular-treasure-focus-class

Adds a class to an element on focus and removes it when focus is lost.
JavaScript
2
star
67

prestogres-odbc

Fork of PostgreSQL ODBC driver for Prestogres
C
2
star
68

dockerfiles

The collection of Dockerfile
Shell
2
star
69

td-js-consent

This repo is for Treasure Data JavaScript Consent Management UIs
JavaScript
2
star
70

td2slack

Treasure Data to Slack app
Ruby
2
star
71

td-import-java

Treasure Data Import Tool by Java
Java
2
star
72

underwrap

A very thin wrapper of Undertow and Resteasy
Java
2
star
73

TD-API-Documentation-postman-collections

1
star
74

embulk-reporter-fluentd

Java
1
star
75

juju-layer-td-agent

Shell
1
star
76

subtree-deploy

Ruby
1
star
77

heroku-td

Heroku CLI plugin for Treasure Data
Ruby
1
star
78

td-react-native-sdk

Treasure Data React Native SDK
JavaScript
1
star
79

td2email

td2email
Ruby
1
star
80

PodSpecs

Ruby
1
star
81

td-libyaml

Binary Packaging Scripts for td-libyaml (dependency of td-agent package)
1
star
82

pytd-legacy

[DEPRECATED] This repo is being deprecated. Please check out
Python
1
star
83

treasure-academy-sql

1
star