mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-28 14:22:50 +03:00
nixos/logstash: add option examples
This commit is contained in:
parent
10e61f53d8
commit
1453be4740
@ -20,16 +20,39 @@ in
|
|||||||
inputConfig = mkOption {
|
inputConfig = mkOption {
|
||||||
default = ''stdin { type => "example" }'';
|
default = ''stdin { type => "example" }'';
|
||||||
description = "Logstash input configuration";
|
description = "Logstash input configuration";
|
||||||
|
example = ''
|
||||||
|
# Read from journal
|
||||||
|
pipe {
|
||||||
|
command => "${pkgs.systemd}/bin/journalctl -f -o json"
|
||||||
|
type => "syslog" codec => json {}
|
||||||
|
}
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
filterConfig = mkOption {
|
filterConfig = mkOption {
|
||||||
default = ''noop {}'';
|
default = ''noop {}'';
|
||||||
description = "logstash filter configuration";
|
description = "logstash filter configuration";
|
||||||
|
example = ''
|
||||||
|
if [type] == "syslog" {
|
||||||
|
# Keep only relevant systemd fields
|
||||||
|
# http://www.freedesktop.org/software/systemd/man/systemd.journal-fields.html
|
||||||
|
prune {
|
||||||
|
whitelist_names => [
|
||||||
|
"type", "@timestamp", "@version",
|
||||||
|
"MESSAGE", "PRIORITY", "SYSLOG_FACILITY",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
outputConfig = mkOption {
|
outputConfig = mkOption {
|
||||||
default = ''stdout { debug => true debug_format => "json"}'';
|
default = ''stdout { debug => true debug_format => "json"}'';
|
||||||
description = "Logstash output configuration";
|
description = "Logstash output configuration";
|
||||||
|
example = ''
|
||||||
|
redis { host => "localhost" data_type => "list" key => "logstash" codec => json }
|
||||||
|
elasticsearch { embedded => true }
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user