[id="override-{beatname_lc}-config-settings"]
== Override configuration settings at the command line

++++
<titleabbrev>Override configuration settings</titleabbrev>
++++

//TODO: Convert this topic to use platform tabs.

// REVEWERS: This is a mix of new and old content. Please review.

NOTE: If you're running {beatname_uc} as a service, you can't specify
command-line flags. To specify flags, start {beatname_uc} in the foreground.

You can override any configuration setting from the command line by using flags:

`-E, --E "SETTING_NAME=VALUE"`::
Overrides a specific configuration setting. 
`-M, --M "VAR_NAME=VALUE"`::
Overrides the default configuration for a module. 

You can specify multiple overrides. Overrides are applied to the currently
running {beatname_uc} process. The {beatname_uc} configuration file is not
changed.

[float]
[[example-override-config]]
=== Example: override configuration file settings

The following configuration sends logging output to files:

["source","sh",subs="attributes"]
----
logging.level: info
logging.to_files: true
logging.files:
  path: /var/log/filebeat
  name: filebeat
  keepfiles: 7
  permissions: 0644
----

To override the logging level and send logging output to standard error instead
of a file, use the `-E` flag when you run {beatname_uc}:

["source","sh",subs="attributes"]
----
-E "logging.to_files=false" -E "logging.to_stderr=true" -E "logging.level=error"
----

[float]
[[example-override-module-setting]]
=== Example: override module settings

The following configuration sets the path to Nginx access logs:

[source,yaml]
----
- module: nginx
  access:
    var.paths: ["/var/log/nginx/access.log*"] <1> 
----

To override this setting from the command line, use the `-M` flag when you run
{beatname_uc}. The variable name must include the module and fileset name. For
example:

["source","sh",subs="attributes"]
----
-M "nginx.access.var.paths=[/path/to/log/nginx/access.log*]"
----

You can specify multiple overrides. Each override must start with `-M`. 

For information about specific variables that you can set for each fileset,
see the documentation under <<{beatname_lc}-modules>>.

