Skip to content

Commit

Permalink
Update the CLI reference for Elastic Agent (#22289) (#22397)
Browse files Browse the repository at this point in the history
* Update the CLI reference

* Add changes from review
  • Loading branch information
dedemorton authored Nov 3, 2020
1 parent 894fbc8 commit 3f34f6b
Showing 1 changed file with 199 additions and 22 deletions.
221 changes: 199 additions & 22 deletions x-pack/elastic-agent/docs/elastic-agent-command-line.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,15 @@ beta[]
* <<elastic-agent-enroll-command,enroll>>
* <<elastic-agent-help-command,help>>
* <<elastic-agent-inspect-command,inspect>>
* <<elastic-agent-install-command,install>>
* <<elastic-agent-restart-command,restart>>
* <<elastic-agent-run-command,run>>
* <<elastic-agent-uninstall-command,uninstall>>
* <<elastic-agent-upgrade-command,upgrade>>
* <<elastic-agent-version-command,version>>

NOTE: You might need to log in as a root user to run these commands.

++++
<hr>
++++
Expand All @@ -39,7 +45,7 @@ overwrites the `elastic-agent.yml` file in the agent directory.
----
elastic-agent enroll <kibana_url> <enrollment_token> [--ca-sha256 <string>]
[--certificate-authorities <string>] [--force] [--help]
[--insecure][global-flags]
[--insecure] [global-flags]
----

[discrete]
Expand All @@ -60,7 +66,7 @@ verification.
Comma-separated list of root certificates used for server verification.

`--force`::
Force overwrite of current policy without prompting for confirmation.
Force overwrite of current configuration without prompting for confirmation.
This flag is helpful when using automation software or scripted deployments.

`--help`::
Expand Down Expand Up @@ -125,9 +131,9 @@ elastic-agent help enroll
[[elastic-agent-inspect-command]]
== elastic-agent inspect

Show the current {agent} policy.
Show the current {agent} configuration.

If no parameters are specified, shows the full {agent} policy.
If no parameters are specified, shows the full {agent} configuration.

[discrete]
=== Synopsis
Expand All @@ -139,13 +145,10 @@ elastic-agent inspect output [--output <string>] [--program <string>]
[--help] [global-flags]
----


//TODO: Clarify what these commands return.

[discrete]
=== Options

`output`:: Display the current policy for the output. This command
`output`:: Display the current configuration for the output. This command
accepts additional flags:
+
--
Expand Down Expand Up @@ -176,6 +179,106 @@ elastic-agent inspect output --output default --program filebeat
<hr>
++++

[discrete]
[[elastic-agent-install-command]]
== elastic-agent install

Install {agent} permanently on the system and manage it by using the system's
service manager. The agent will start automatically after installation is
complete.

You must run this command as the root user (or Administrator on Windows)
to write files to the correct locations. This command overwrites the
`elastic-agent.yml` file in the agent directory.

[discrete]
=== Synopsis

[source,shell]
----
elastic-agent install [--ca-sha256 <string>] [--certificate-authorities <string>]
[--enrollment-token <string>] [--force] [--help]
[--insecure] [--kibana-url <string>]
[global-flags]
----

[discrete]
=== Options

`--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.

`--enrollment-token <string>`::
Enrollment token generated by {fleet}. You can use the same enrollment token for
multiple agents.

`--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 `install` command.

`--insecure`::
Allow an insecure connection to {kib}. When this flag is specified, API keys are
sent in clear text. We strongly recommend that you use a secure connection.

`--kibana-url <string>`::
URL of the {kib} endpoint where {fleet} is running.

{global-flags-link}

[discrete]
=== Examples

[source,shell]
----
elastic-agent install -f --kibana-url=https://yourhost:5601 \
--enrollment-token=OEV0bmauVUI0a3dmdWc1T3Bad1o6VGxCa3U4UEFTQ0NycbBSUFwoazVBdx==
----

++++
<hr>
++++

[discrete]
[[elastic-agent-restart-command]]
== elastic-agent restart

Restart the currently running Elastic Agent daemon.

[discrete]
=== Synopsis

[source,shell]
----
elastic-agent restart [--help] [global-flags]
----

[discrete]
=== Options

`--help`::
Show help for the `restart` command.

{global-flags-link}

[discrete]
=== Examples

[source,shell]
----
elastic-agent restart
----

++++
<hr>
++++

[discrete]
[[elastic-agent-run-command]]
== elastic-agent run
Expand All @@ -197,30 +300,22 @@ elastic-agent run [global-flags]
These flags are valid whenever you run `elastic-agent` on the command line.

`-c <string>`::
The policy file to use. If not specified, {agent} uses
`{path.home}/elastic-agent.yml`.
The configuration file to use. If not specified, {agent} uses
`{path.config}/elastic-agent.yml`.

`--e`::
Log to stderr and disable syslog/file output.

`--environment <environmentVar>`::
The environment in which the agent will run.

//TODO: Clarify what we mean by environment by showing an example.

`--path.config <string>`::
The directory where {agent} looks for its policy file. The default
The directory where {agent} looks for its configuration file. The default
varies by platform.

`--path.data <string>`::
The data directory where {agent} stores managed binaries and their logs. Also
stores logs for any programs started and managed by {agent}.
+
If not specified, {agent} uses `{path.home}/data`.

`--path.home <string>`::
The home directory of {agent}. `path.home` determines the location of the
policy files and data directory.
The root directory of {agent}. `path.home` determines the location of the
configuration files and data directory.
+
If not specified, {agent} uses the current working directory.

Expand All @@ -235,7 +330,89 @@ Set log level to INFO.

[source,shell]
----
elastic-agent run -v --path.logs path/to/my/logs
elastic-agent run -c myagentconfig.yml
----

++++
<hr>
++++

[discrete]
[[elastic-agent-uninstall-command]]
== elastic-agent uninstall

Permanently uninstall {agent} from the system.

You must run this command as the root user (or Administrator on Windows)
to remove files.

[discrete]
=== Synopsis

[source,shell]
----
elastic-agent uninstall [--force] [--help] [global-flags]
----

[discrete]
=== Options

`--force`::
Uninstall {agent} and do not prompt for confirmation. This flag is helpful
when using automation software or scripted deployments.

`--help`::
Show help for the `uninstall` command.

{global-flags-link}

[discrete]
=== Examples

[source,shell]
----
elastic-agent uninstall
----

++++
<hr>
++++

[discrete]
[[elastic-agent-upgrade-command]]
== elastic-agent upgrade

Upgrade the currently running {agent} to the specified version.

[discrete]
=== Synopsis

[source,shell]
----
elastic-agent upgrade <version> [--source-uri <string>] [--help] [flags]
----

[discrete]
=== Options

`version`::
The version of {agent} to upgrade to.

`--source-uri <string>`::
The source URI to download the new version from. By default, {agent} uses the
Elastic Artifacts URL.

`--help`::
Show help for the `upgrade` command.

{global-flags-link}

[discrete]
=== Examples

[source,shell]
----
elastic-agent upgrade 7.10.1
----

++++
Expand Down

0 comments on commit 3f34f6b

Please sign in to comment.