filebeat #2

Supports: xenial trusty bionic focal
Add to new model

Description

As the next-generation Logstash Forwarder, Filebeat tails logs and quickly sends this information to Logstash for further parsing and enrichment or to Elasticsearch for centralized storage and analysis.


Overview

Apache 2.0 License

This base layer provides a function to add logrotate support to any reactive charm.

Usage

Declarative via layer.yaml

options:
  logrotate:
    /var/log/foobar.log:
      - copytruncate
      - rotate 5
      - size 100k

In your charm code

from charms.layer import logrotate

@when(logrotate.installed, ...)
def setup_logrotate():
    logrotate_opts = {
        /var/log/foobar.log: [
            'copytruncate', 
            'rotate 5', 
            'size 100k', 
        ]
    }
    logrotate.configure(logrotate_opts)

Configuration

exclude_files
(string) A list of regular expressions to match the files that you want Filebeat to ignore: https://www.elastic.co/guide/en/beats/filebeat/6.7/filebeat-input-log.html#filebeat-input-log-exclude-files"
["/filebeat.*", ".*gz$"]
exclude_lines
(string) A list of regular expressions to match the lines that you want Filebeat to exclude: https://www.elastic.co/guide/en/beats/filebeat/6.7/filebeat-input-log.html#filebeat-input-log-exclude-lines"
[]
extra_inputs
(string) A YAML list which will be injected to define additional prospectors/inputs.
extra_packages
(string) Space separated list of extra deb packages to install.
fields
(string) Comma seperated list of key:value that the prospector will assign as field to each beat
harvester_buffer_size
(int) Defines the buffer size every harvester uses when fetching the file
16384
install_keys
(string) Elastic Beats apt repository key
D88E42B4
install_sources
(string) Elastic Beats apt repository
deb https://artifacts.elastic.co/packages/7.x/apt stable main
kafka_hosts
(string) A comma separated list of kafka output hosts in addition to those from relations.
kafka_topic
(string) Topic name. Format strings are allowed.
%{[type]}
kafka_topics
(string) Expert setting topics filter.
kafka_version
(string) Expert setting kafka version.
kube_logs
(boolean) Whether or not to include the Kubernetes audit log as well as any K8s metadata when container logs are present on the system: https://www.elastic.co/guide/en/beats/filebeat/6.7/add-kubernetes-metadata.html Note: this option has no effect when related to a non Charmed Kubernetes charm.
log_level
(string) Beats log level. One of debug, info, warning, error, or critical: https://www.elastic.co/guide/en/beats/filebeat/5.6/configuration-logging.html#level
info
logging_to_syslog
(boolean) Send beats logs to syslog: https://www.elastic.co/guide/en/beats/filebeat/5.6/configuration-logging.html#_to_syslog
True
logpath
(string) Comma separated log paths to monitor. Can contain wildcards.
/var/log/*.log /var/log/*/*.log
logstash_hosts
(string) A comma separated list of logstash output hosts in addition to those from relations.
logstash_ssl_cert
(string) Public SSL certificate data (base64 encoded) for connecting securely to logstash.
logstash_ssl_key
(string) Private SSL key data (base64 encoded) for connecting security to logstash.
max_bytes
(int) Maximum number of bytes a single log event can have. Default 10MB
10485760
package_status
(string) The status of service-affecting packages will be set to this value in the dpkg database. Valid values are "install" and "hold".
install
tags
(string) Comma seperated list of tags that will be assigned to each beat