GithubHelp home page GithubHelp logo

zyun53 / ansible-role-fluentd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from geerlingguy/ansible-role-fluentd

0.0 1.0 0.0 11 KB

Ansible role - Fluentd (td-agent)

Home Page: https://galaxy.ansible.com/geerlingguy/fluentd

License: MIT License

ansible-role-fluentd's Introduction

Ansible Role: Fluentd

Build Status

An Ansible Role that installs Fluentd on RedHat/CentOS or Debian/Ubuntu. This role installs td-agent, which is a standalone version that doesn't require Ruby to be installed on the system separately. See differences between td-agent and Fluentd here.

Requirements

N/A

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml):

fluentd_package_state: present

The td-agent Fluentd package state; set to latest to upgrade or change versions.

fluentd_service_name: td-agent
fluentd_service_state: started
fluentd_service_enabled: true

Controls the Fluentd service options.

fluentd_plugins:
  - fluent-plugin-elasticsearch

# Alternative format:
fluentd_plugins:
  - name: fluent-plugin-elasticsearch
    version: '4.0.6'
    state: present

A list of Fluentd plugins to install.

fluentd_conf_sources: |
  [see defaults/main.yml for default content]

fluentd_conf_filters: |
  [see defaults/main.yml for default content]

fluentd_conf_matches: |
  [see defaults/main.yml for default content]

The configuration which will be placed into the td-agent.conf file which controls how Fluentd listens for, filters, and routes log data. The defaults set up some basic options which can direct data to Treasure Data, but you should override these values with what's appropriate for your logs.

For example, if you want to monitor an Apache HTTP server's access log, you would add a source:

fluentd_conf_sources: |
  <source>
    @type tail
    @id input_tail
    <parse>
      @type apache2
    </parse>
    path /var/log/httpd-access.log
    tag apache.access
  </source>

And then you could route apache log entries to Elasticsearch using:

fluentd_conf_matches: |
  <match apache.**>
    @type elasticsearch
    host log.example.com
    port 9200
    user myuser
    password mypassword
    logstash_format true
  </match>

Note that Elasticsearch would require the Fluentd plugin fluent-plugin-elasticsearch to be installed.

Dependencies

N/A

Example Playbook

- hosts: search

  vars:
    fluentd_conf_sources: |
      <source>
        @type tail
        @id input_tail
        <parse>
          @type apache2
        </parse>
        path /var/log/httpd-access.log
        tag apache.access
      </source>

  roles:
    - geerlingguy.fluentd

License

MIT / BSD

Author Information

This role was created in 2020 by Jeff Geerling, author of Ansible for DevOps.

ansible-role-fluentd's People

Contributors

geerlingguy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.