-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Open
Labels
Description
In a lot places, Logstash allows to reference fields with the sprintf format(https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html#sprintf). Unfortunately if the referenced field does not exist, sprintf defaults to leave the the reference untouched, which may lead to very unsatisfactory results. Therefore I suggest to allow a default value for the sprintf interpolation, e.g.
output {
file {
path => "/var/log/%{type:-default}.%{+yyyy.MM.dd.HH}"
}
}
As delimiter between the field reference and the default value I suggest :- (taken from bash, unlikely to exist in a Logstash event field name).
boernd, mguggi, ebuildy, tushartyagi, ArtursL and 27 morepemonttopemontto and ArtemChekunovpemontto and ArtemChekunov