Elastic Agent command line options
editElastic Agent command line options
editThis functionality is in beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features.
Elastic Agent provides commands for running the agent and doing common tasks:
elastic-agent enroll
editEnroll the Elastic Agent in Fleet.
We recommend that you run this command as the root user because some
integrations require root privileges to collect sensitive data. This command
overwrites the elastic-agent.yml
file in the agent directory.
Synopsis
editelastic-agent enroll <kibana_url> <enrollment_token> [--ca-sha256 <string>] [--certificate-authorities <string>] [--force] [--help] [--insecure][global-flags]
Options
edit-
kibana_url
- Required. URL of the Kibana endpoint where Ingest Manager is running.
-
enrollment_token
- Required. Enrollment token generated by Ingest Manager. You can use the same enrollment token for multiple agents.
-
--ca-sha256 <string>
- Comma-separated list of certificate authority hash pins used for certificate verification.
-
--certificate-authorities <string>
- Comma-separated list of root certificates used for server verification.
-
--force
- Force overwrite of current configuration without prompting for confirmation. This flag is helpful when using automation software or scripted deployments.
-
--help
-
Show help for the
enroll
command. -
--insecure
- Allow an insecure connection to Kibana. When this flag is specified, API keys are sent in clear text. We strongly recommend that you use a secure connection.
For more flags, see Global flags.
Example
editelastic-agent enroll http://localhost:5601 ZnmNIdzVITUJua2QIdU5FTWROVjY6dHY2N1EybWNTMUdPejg5ODbYcVpNUQ==
elastic-agent help
editShow help for a specific command.
Synopsis
editelastic-agent help <command> [--help] [global-flags]
Options
edit-
command
- The name of the command.
-
--help
-
Show help for the
help
command.
For more flags, see Global flags.
Example
editelastic-agent help enroll
elastic-agent inspect
editShow the current Elastic Agent configuration.
If no parameters are specified, shows the full Elastic Agent configuration.
Synopsis
editelastic-agent inspect [--help] [global-flags] elastic-agent inspect output [--output <string>] [--program <string>] [--help] [global-flags]
Options
edit-
output
-
Display the current configuration for the output. This command accepts additional flags:
-
--output <string>
- The name of the output to introspect.
-
--program <string>
-
The type of program to introspect. For example,
filebeat
. This option must be combined with--output
.
-
-
--help
-
Show help for the
inspect
command.
For more flags, see Global flags.
Examples
editelastic-agent inspect elastic-agent inspect output --output default elastic-agent inspect output --output default --program filebeat
elastic-agent run
editStart the elastic-agent
process.
Synopsis
editelastic-agent run [global-flags]
Global flags
editThese flags are valid whenever you run elastic-agent
on the command line.
-
-c <string>
-
The configuration file to use. If not specified, Elastic Agent uses
{path.home}/elastic-agent.yml
. -
--e
- Log to stderr and disable syslog/file output.
-
--environment <environmentVar>
- The environment in which the agent will run.
-
--path.config <string>
- The directory where Elastic Agent looks for its configuration file. The default varies by platform.
-
--path.data <string>
-
The data directory where Elastic Agent stores managed binaries and their logs. Also stores logs for any programs started and managed by Elastic Agent.
If not specified, Elastic Agent uses
{path.home}/data
. -
--path.home <string>
-
The home directory of Elastic Agent.
path.home
determines the location of the configuration files and data directory.If not specified, Elastic Agent uses the current working directory.
-
--path.logs <string>
- Path to the log output for Elastic Agent. The default varies by platform.
-
--v
- Set log level to INFO.
Example
editelastic-agent run -v --path.logs path/to/my/logs
elastic-agent version
editShow the version of Elastic Agent.
Synopsis
editelastic-agent version [--help] [global-flags]
Options
edit-
--help
-
Show help for the
version
command.
For more flags, see Global flags.
Example
editelastic-agent version