Require a unit on lsheap and esheap in SOC Configuration

Without forcedType or regex, SOC accepted a unitless heap such as 500.
AlignBestGuess stored it as a YAML integer, which rendered -Xms500
(bytes) and restart-looped the service. On the next save, AlignType
then tried ParseInt on the corrected 500m and rejected it.

forcedType: string makes SOC store the value as a string whatever the
stored type, so an existing integer can be corrected. The regex blocks
unitless values in the UI. k, m and g are allowed (either case), matching
what the bundled JDKs accept for -Xms/-Xmx; the Logstash JVM options
parser passes them through unchanged. Heaps too small to start fail in
the JVM whatever the unit, so the regex doesn't check size.
This commit is contained in:
Josh Patterson committed 2026-12-04 08:04:04 -05:00
1 parent 62a7ba40f6
commit 9152e6fce0
2 files changed
+9 -3

No files matched your search

+4 -1
View File
@@ -17,7 +17,10 @@ elasticsearch:
global: True
advanced: True
esheap:
description: Specify the memory heap size in (m)egabytes for Elasticsearch.
description: Heap size to use for Elasticsearch, as a number followed by k (kilobytes), m (megabytes) or g (gigabytes), such as 600m.
forcedType: string
regex: ^[1-9][0-9]*[kKmMgG]$
regexFailureMessage: Must be a number followed by k, m or g, such as 600m.
helpLink: elasticsearch
index_clean:
description: Determines if indices should be considered for deletion by available disk space in the cluster. Otherwise, data is retained by the configured lifecycle settings. This setting only applies to EVAL, STANDALONE, and HEAVY NODE installations. Other installations use lifecycle settings only.
+5 -2
View File
@@ -403,8 +403,11 @@ logstash:
custom8: *pipeline_settings
custom9: *pipeline_settings
settings:
lsheap:
description: Heap size to use for logstash
lsheap:
description: Heap size to use for Logstash, as a number followed by k (kilobytes), m (megabytes) or g (gigabytes), such as 500m.
forcedType: string
regex: ^[1-9][0-9]*[kKmMgG]$
regexFailureMessage: Must be a number followed by k, m or g, such as 500m.
helpLink: logstash
global: False
config: