diff --git a/x-pack/elastic-agent/docs/elastic-agent-command-line.asciidoc b/x-pack/elastic-agent/docs/elastic-agent-command-line.asciidoc index 49ddbdce466..541e9a44d01 100644 --- a/x-pack/elastic-agent/docs/elastic-agent-command-line.asciidoc +++ b/x-pack/elastic-agent/docs/elastic-agent-command-line.asciidoc @@ -15,9 +15,15 @@ beta[] * <> * <> * <> +* <> +* <> * <> +* <> +* <> * <> +NOTE: You might need to log in as a root user to run these commands. + ++++
++++ @@ -39,7 +45,7 @@ overwrites the `elastic-agent.yml` file in the agent directory. ---- elastic-agent enroll [--ca-sha256 ] [--certificate-authorities ] [--force] [--help] - [--insecure][global-flags] + [--insecure] [global-flags] ---- [discrete] @@ -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`:: @@ -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 @@ -139,13 +145,10 @@ elastic-agent inspect output [--output ] [--program ] [--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: + -- @@ -176,6 +179,106 @@ elastic-agent inspect output --output default --program filebeat
++++ +[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 ] [--certificate-authorities ] + [--enrollment-token ] [--force] [--help] + [--insecure] [--kibana-url ] + [global-flags] +---- + +[discrete] +=== Options + +`--ca-sha256 `:: +Comma-separated list of certificate authority hash pins used for certificate +verification. + +`--certificate-authorities `:: +Comma-separated list of root certificates used for server verification. + +`--enrollment-token `:: +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 `:: +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== +---- + +++++ +
+++++ + +[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 +---- + +++++ +
+++++ + [discrete] [[elastic-agent-run-command]] == elastic-agent run @@ -197,8 +300,8 @@ elastic-agent run [global-flags] These flags are valid whenever you run `elastic-agent` on the command line. `-c `:: -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. @@ -206,21 +309,13 @@ Log to stderr and disable syslog/file output. `--environment `:: The environment in which the agent will run. -//TODO: Clarify what we mean by environment by showing an example. - `--path.config `:: -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 `:: -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 `:: -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. @@ -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 +---- + +++++ +
+++++ + +[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 +---- + +++++ +
+++++ + +[discrete] +[[elastic-agent-upgrade-command]] +== elastic-agent upgrade + +Upgrade the currently running {agent} to the specified version. + +[discrete] +=== Synopsis + +[source,shell] +---- +elastic-agent upgrade [--source-uri ] [--help] [flags] +---- + +[discrete] +=== Options + +`version`:: +The version of {agent} to upgrade to. + +`--source-uri `:: +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 ---- ++++