nixos-config/terranix/graylog/config.nix

46 lines
1.4 KiB
Nix
Raw Normal View History

2021-07-13 22:33:04 +02:00
with builtins; {
2021-07-14 17:43:31 +02:00
imports = [ ./provider.nix ./nginx.nix ./journald.nix ];
2021-07-13 22:33:04 +02:00
2021-07-13 23:16:00 +02:00
# create default index
2021-07-14 12:12:36 +02:00
resource.graylog_index_set.default = let
maxIndexSize = 200;
maxIndexCount = 20;
2021-07-15 23:09:55 +02:00
isDefault = true;
2021-07-14 12:12:36 +02:00
in {
2021-07-13 23:16:00 +02:00
title = "default";
description = ''
This is the default index set, where everything ends up which is
not specifically send to another index.
2021-07-14 12:12:36 +02:00
Be aware this index can only hold ${
toString (maxIndexCount * maxIndexSize)
}MB of logs!
2021-07-13 23:16:00 +02:00
'';
default = isDefault;
2021-07-15 23:09:55 +02:00
index_prefix = "graylog";
2021-07-13 23:16:00 +02:00
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;
2021-07-13 23:16:00 +02:00
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;
2021-07-14 12:12:36 +02:00
type =
"org.graylog2.indexer.rotation.strategies.SizeBasedRotationStrategyConfig";
2021-07-13 23:16:00 +02:00
});
};
2021-07-13 22:33:04 +02:00
}