To run Logstash from the command line, use the following command:
bin/logstash [options]
Where options
are command-line flags that you canspecify to control Logstash execution. The location of the bin
directoryvaries by platform. See Logstash Directory Layout to find the location of bin\logstash
onyour system.
The following example runs Logstash and loads the Logstash config defined inthe mypipeline.conf
file:
bin/logstash -f mypipeline.conf
Any flags that you set at the command line override the corresponding settingsin logstash.yml, but the fileitself is not changed. It remains as-is for subsequent Logstash runs.
Specifying command line options is useful when you are testing Logstash.However, in a production environment, we recommend that you uselogstash.yml to control Logstash execution. Usingthe settings file makes it easier for you to specify multiple options, and itprovides you with a single, versionable file that you can use to start upLogstash consistently for each run.
Logstash has the following flags. You can use the --help
flag to display this information.
--node.name NAME
-f, --path.config CONFIG_PATH
Load the Logstash config from a specific file or directory. If a directory is given, allfiles in that directory will be concatenated in lexicographical order and then parsed as asingle config file. Specifying this flag multiple times is not supported. If you specifythis flag multiple times, Logstash uses the last occurrence (for example, -f foo -f bar
is the same as -f bar
).
You can specify wildcards (globs) and any matched files willbe loaded in the order described above. For example, you can use the wildcard feature toload specific files by name:
bin/logstash --debug -f '/tmp/{one,two,three}'
With this command, Logstash concatenates three config files, /tmp/one
, /tmp/two
, and/tmp/three
, and parses them into a single config.
-e, --config.string CONFIG_STRING
input { stdin { type => stdin } }
and if no output is specified, then the following is used as the default output:
output { stdout { codec => rubydebug } }
. If you wish to use both defaults, please use the empty string for the
-e
flag. The default is nil.
--java-execution
false
for this option to revert to the legacy Ruby execution engine instead of the default Java execution engine.
--modules
-M
option to assign values to default variables for the specified module. If
--modules
is used on the command line, any modules in
logstash.yml
will be ignored, as will any settings there. This flag is mutually exclusive to the
-f
and
-e
flags. Only one of
-f
,
-e
, or
--modules
may be specified. Multiple modules can be specified by separating them with a comma, or by invoking the
--modules
flag multiple times.
-M, --modules.variable
-M "MODULE_NAME.var.PLUGIN_TYPE.PLUGIN_NAME.KEY_NAME=value"
for Logstash variables. For other settings, it will be
-M "MODULE_NAME.KEY_NAME.SUB_KEYNAME=value"
. The
-M
flag can be used as many times as is necessary. If no
-M
options are specified, then the default value for that setting will be used. The
-M
flag is only used in conjunction with the
--modules
flag. It will be ignored if the
--modules
flag is absent.
--pipeline.id ID
main
.
-w, --pipeline.workers COUNT
-b, --pipeline.batch.size SIZE
jvm.options
config file. See
Logstash Configuration Files for more info.
-u, --pipeline.batch.delay DELAY_IN_MS
--pipeline.unsafe_shutdown
--path.data PATH
data
directory under Logstash home.
-p, --path.plugins PATH
PATH/logstash/TYPE/NAME.rb
where
TYPE
is
inputs
,
filters
,
outputs
, or
codecs
, and
NAME
is the name of the plugin.
-l, --path.logs PATH
--log.level LEVEL
Set the log level for Logstash. Possible values are:
fatal
: log very severe error messages that will usually be followed by the application abortingerror
: log errorswarn
: log warningsinfo
: log verbose info (this is the default)debug
: log debugging info (for developers)trace
: log finer-grained messages beyond debugging info--config.debug
--log.level=debug
enabled). WARNING: The log message will include any
password options passed to plugin configs as plaintext, and may result in plaintext passwords appearing in your logs!
-i, --interactive SHELL
-V, --version
-t, --config.test_and_exit
--log.level=debug
, Logstash will log the combined config file, annotating each config block with the source file it came from.
-r, --config.reload.automatic
--config.reload.interval RELOAD_INTERVAL
--http.host HTTP_HOST
--http.port HTTP_PORT
--log.format FORMAT
--path.settings SETTINGS_DIR
logstash.yml
settings file as well as the log4j logging configuration. This can also be set through the LS_SETTINGS_DIR environment variable. The default is the
config
directory under Logstash home.
-h, --help