Giter Site home page Giter Site logo

ansible-role-filebeat's Introduction

Ansible Filebeat role

Ansible Galaxy Travis

Installs Elastic's Filebeat for forwarding logs.

Role Variables

  • filebeat_version - The version of filebeat to install. Defaults to 6.4.2.
  • filebeat_state - Defaults to present. Set it to absent to uninstall filebeat.
  • filebeat_config - YAML representation of your filebeat config. This is templated directly into the configuration file as YAML. See the example configuration for an exhaustive list of configuration options. Defaults to:
filebeat_config:
  filebeat:
    prospectors:
      - paths:
          - /var/log/messages
          - /var/log/*.log
        input_type: log
  output:
    file:
      path: /tmp/filebeat
      filename: filebeat
  logging:
    to_syslog: true
    level: error
  • filebeat_ca_cert - If provided, the contents of this variable will be placed into the file identified by filebeat_ca_path on the target host. You can then include the filebeat_ca_path within your configuration to properly authenticate your TLS connections to Logstash/Elasticsearch/etc.

If you wish to load your CA certificate from a file, use the file lookup plugin, e.g.:

filebeat_ca_cert: "{{ lookup('file', '/path/to/ca.crt') }}"
  • filebeat_ca_path - If a CA certificate is provided in filebeat_ca_cert, it will be created at this path.

Similar to the CA variables, you can upload SSL certificates and keys for filebeat using these variables:

  • filebeat_ssl_cert - Contents of the SSL certificate
  • filebeat_ssl_cert_path - Destination of the certificate on the Ansible controlled host
  • filebeat_ssl_key - Contents of the SSL key
  • filebeat_ssl_key_path - Destination of the SSL key on the Ansible controlled host

You can also store the config in separate filebeat.yml file and include it using lookup:

filebeat_config: "{{ lookup('file', './filebeat.yml')|from_yaml }}"

Common Configurations

Connecting to Elasticsearch:

filebeat_config:
  filebeat:
    prospectors:
      - paths:
          - /var/log/messages
          - /var/log/*.log
        input_type: log
  output:
    elasticsearch:
      hosts:
        - "http://localhost:9200"
      username: "bob"
      password: "12345"
  logging:
    to_syslog: true
    level: error

License

BSD

Author Information

David Wittman

ansible-role-filebeat's People

Contributors

andyshinn avatar davidwittman avatar jamesbelchamber avatar vorou avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.