Support additional command line options (#5)

* Support additional command line options

* Apply suggestions from code review

Co-authored-by: Alejandro Moreno <alemorcuq@gmail.com>

* Update README.md

Co-authored-by: Alejandro Moreno <alemorcuq@gmail.com>

* Quote variable

* Fix variable

Co-authored-by: Alejandro Moreno <alemorcuq@gmail.com>
Co-authored-by: Alejandro Moreno <amorenoc@vmware.com>
This commit is contained in:
fengxsong
2021-04-29 15:33:10 +08:00
committed by GitHub
parent 19472f5bb4
commit e62d52858c
3 changed files with 14 additions and 0 deletions

View File

@@ -51,6 +51,7 @@ export LOGSTASH_EXPOSE_API="${LOGSTASH_EXPOSE_API:-no}"
export LOGSTASH_ENABLE_MULTIPLE_PIPELINES="${LOGSTASH_ENABLE_MULTIPLE_PIPELINES:-false}"
export LOGSTASH_HEAP_SIZE="${LOGSTASH_HEAP_SIZE:-1g}"
export LOGSTASH_MAX_ALLOWED_MEMORY_PERCENTAGE="${LOGSTASH_MAX_ALLOWED_MEMORY_PERCENTAGE:-100}"
export LOGSTASH_EXTRA_ARGS="${LOGSTASH_EXTRA_ARGS:-}"
EOF
}

View File

@@ -26,6 +26,11 @@ else
args=( "-f" "$LOGSTASH_CONF_FILE" )
fi
if [[ -n "$LOGSTASH_EXTRA_ARGS" ]]; then
read -r -a extra_args <<<"$LOGSTASH_EXTRA_ARGS"
args+=("${extra_args[@]}")
fi
is_boolean_yes "$LOGSTASH_EXPOSE_API" && args+=( "--http.host" "0.0.0.0" "--http.port" "$LOGSTASH_API_PORT_NUMBER" )
if am_i_root; then

View File

@@ -140,6 +140,14 @@ You can override the default configuration for logstash by mounting your own con
$ docker run -d --env LOGSTASH_CONF_FILENAME=my_config.conf -v /path/to/custom-conf-directory:/bitnami/logstash/config bitnami/logstash:latest
```
## Additional command line options
In case you want to add extra flags to the Logstash command, use the `LOGSTASH_EXTRA_ARGS` variable. Example:
```console
$ docker run -d --env LOGSTASH_EXTRA_ARGS="-w 4 -b 4096" bitnami/logstash:latest
```
## Using multiple pipelines
You can use [multiple pipelines](https://www.elastic.co/guide/en/logstash/master/multiple-pipelines.html) by setting the `LOGSTASH_ENABLE_MULTIPLE_PIPELINES` environment variable to `true`.