nixos-config/terranix/graylog/config.nix
Ingolf Wagner 973e3b3305
reformat
2021-11-01 19:30:41 +01:00

47 lines
1.4 KiB
Nix

with builtins; {
imports = [ ./provider.nix ./nginx.nix ./journald.nix ];
# create default index
resource.graylog_index_set.default =
let
maxIndexSize = 200;
maxIndexCount = 20;
isDefault = true;
in
{
title = "default";
description = ''
This is the default index set, where everything ends up which is
not specifically send to another index.
Be aware this index can only hold ${
toString (maxIndexCount * maxIndexSize)
}MB of logs!
'';
default = isDefault;
index_prefix = "graylog";
rotation_strategy_class =
"org.graylog2.indexer.rotation.strategies.SizeBasedRotationStrategy";
retention_strategy_class =
"org.graylog2.indexer.retention.strategies.DeletionRetentionStrategy";
index_analyzer = "standard";
index_optimization_disabled = false;
writable = true;
shards = 1;
replicas = 0;
index_optimization_max_num_segments = 1;
field_type_refresh_interval = 5000;
retention_strategy = toJSON ({
max_number_of_indices = maxIndexCount;
type =
"org.graylog2.indexer.retention.strategies.DeletionRetentionStrategyConfig";
});
rotation_strategy = toJSON ({
#max_docs_per_index = 30000000;
max_size = maxIndexSize * 1024 * 1024;
type =
"org.graylog2.indexer.rotation.strategies.SizeBasedRotationStrategyConfig";
});
};
}