Skip to content

Filebeat

services.filebeat.enable

Whether to enable filebeat. Type: boolean

Default

false

Example

true

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/logging/filebeat.nix

services.filebeat.inputs

Inputs specify how Filebeat locates and processes input data.

This is like services.filebeat.settings.filebeat.inputs, but structured as an attribute set. This has the benefit that multiple NixOS modules can contribute settings to a single filebeat input.

An input type can be specified multiple times by choosing a different <name> for each, but setting to the same value.

See https://www.elastic.co/guide/en/beats/filebeat/current/configuration-filebeat-options.html.

Type: attribute set of (JSON value)

Default

{ }

Example

{journald.id = "everything"; # Only for filebeat7log = {enabled = true;paths = ["/var/log/*.log"];};};

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/logging/filebeat.nix

services.filebeat.inputs.<name>.type

The input type.

Look for the value after type: on the individual input pages linked from https://www.elastic.co/guide/en/beats/filebeat/current/configuration-filebeat-options.html.

Type: string

Default

"‹name›"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/logging/filebeat.nix

services.filebeat.modules

Filebeat modules provide a quick way to get started processing common log formats. They contain default configurations, Elasticsearch ingest pipeline definitions, and Kibana dashboards to help you implement and deploy a log monitoring solution.

This is like services.filebeat.settings.filebeat.modules, but structured as an attribute set. This has the benefit that multiple NixOS modules can contribute settings to a single filebeat module.

A module can be specified multiple times by choosing a different <name> for each, but setting to the same value.

See https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-modules.html.

Type: attribute set of (JSON value)

Default

{ }

Example

{nginx = {access = {enabled = true;var.paths = [ "/path/to/log/nginx/access.log*" ];};error = {enabled = true;var.paths = [ "/path/to/log/nginx/error.log*" ];};};};

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/logging/filebeat.nix

services.filebeat.modules.<name>.module

The name of the module.

Look for the value after module: on the individual input pages linked from https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-modules.html.

Type: string

Default

"‹name›"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/logging/filebeat.nix

services.filebeat.package

The filebeat package to use. Type: package

Default

pkgs.filebeat

Example

filebeat7

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/logging/filebeat.nix

services.filebeat.settings

Configuration for filebeat. See https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-reference-yml.html for supported values.

Options containing secret data should be set to an attribute set containing the attribute _secret - a string pointing to a file containing the value the option should be set to. See the example to get a better picture of this: in the resulting {file}filebeat.yml file, the output.elasticsearch.password key will be set to the contents of the {file}/var/keys/elasticsearch_password file.

Type: JSON value

Default

{ }

Example

{settings = {output.elasticsearch = {hosts = [ "myEShost:9200" ];username = "filebeat_internal";password = { _secret = "/var/keys/elasticsearch_password"; };};logging.level = "info";};};

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/logging/filebeat.nix

services.filebeat.settings.output.elasticsearch.hosts

The list of Elasticsearch nodes to connect to.

The events are distributed to these nodes in round robin order. If one node becomes unreachable, the event is automatically sent to another node. Each Elasticsearch node can be defined as a URL or IP:PORT. For example: http://192.15.3.2, https://es.found.io:9230 or 192.24.3.2:9300. If no port is specified, 9200 is used.

Type: list of string

Default

["127.0.0.1:9200"]

Example

["myEShost:9200"]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/logging/filebeat.nix