Open
Description
A discussion in PR #102 led to the following proposal. Logstash's file input currently uses the following algorithm to select the sincedb path:
- If the
sincedb_path
option is set, use that path and require that it points to a file. - If $SINCEDB_DIR is set, generate a sincedb filename and store it in $SINCEDB_DIR.
- If $HOME is set, generate a sincedb filename and store it in $HOME.
- Bail out with an error.
The SINCEDB_DIR environment variable support isn't documented, and in PR #102 which adds such documentation @jordansissel suggested that we instead deprecate that variable since the configuration interface is confusing.
So, to simplify the interface without making it less expressive I suggest that the algorithm instead becomes this:
- If the
sincedb_path
option is set to a valid file, use that file. - If the
sincedb_path
option is set to a valid directory, generate a sincedb filename and store it in that directory. - If the
sincedb_path
option isn't explicitly set we fall back to its default value of $HOME (if set). - Bail out with an error.
This makes the sincedb_path
option a one-stop shop for configuring the sincedb path.