-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Ingest Manager] Basic Elastic Agent documentation #19030
Changes from 2 commits
846b029
4135449
66bd030
9d7aee1
f6a4a7d
f2673e0
0003890
f0a9dc1
de8baa4
250e8e7
ce87631
b2d2657
84c2ea9
d321304
d6197fa
90f0980
780c4aa
c5522a4
8e6ea52
96a3ff5
4cc6312
1950232
1bc2c22
371d8ed
d946757
c7e162b
62bc73f
1fa71f1
5fd8923
87266ad
75b43c7
d210096
4e2221d
335ebe8
67d1877
6e6a4ab
4abc7f8
cd875fd
f17b3f3
bf55bf6
97c416b
c6a499e
7539961
71a5e81
69c6e23
8a437af
37cab7b
683fe89
816e5b0
d53710b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -1,78 +1,255 @@ | ||||
Agent's notes | ||||
|
||||
|
||||
[[requirements]] | ||||
Requirements | ||||
|
||||
The remote Kibana version of the Agent must be equal or higher than the Agent version, if this is not met | ||||
Kibana will refuse the connection. | ||||
|
||||
|
||||
[[Supported Actions by the Agent]] | ||||
|
||||
The Elastic Agent supports the following actions received by Fleet. | ||||
|
||||
Implemented: | ||||
|
||||
[[Configuration change]] | ||||
|
||||
The Elastic Agent receives a configuration encoded as a JSON object. | ||||
|
||||
[source,json] | ||||
------------------------------------------------------------------------------ | ||||
{ | ||||
"type": "CONFIG_CHANGE", | ||||
"id": "id1", | ||||
"data": { | ||||
"config": { | ||||
"id": "policy-id", | ||||
"outputs": { | ||||
"default": { | ||||
"hosts": "https://localhost:9200" | ||||
} | ||||
}, | ||||
"datasources": [{ | ||||
"id": "string", | ||||
"enabled": true, | ||||
"use_output": "default", | ||||
"inputs": [{ | ||||
"type": "logs", | ||||
"streams": [{ | ||||
"paths": ["/var/log/hello.log"] | ||||
}] | ||||
}] | ||||
}] | ||||
} | ||||
} | ||||
} | ||||
------------------------------------------------------------------------------ | ||||
|
||||
[[Planned but not implemented]] | ||||
|
||||
[source,json] | ||||
------------------------------------------------------------------------------ | ||||
{ | ||||
"type": "UPGRADE", | ||||
"id": "id1", | ||||
"target_version": "7.2.1" | ||||
} | ||||
------------------------------------------------------------------------------ | ||||
|
||||
[source,json] | ||||
------------------------------------------------------------------------------ | ||||
{ | ||||
"type": "DOWNGRADE", | ||||
"id": "id1", | ||||
"target_version": "7.2.1" | ||||
} | ||||
------------------------------------------------------------------------------ | ||||
|
||||
[source,json] | ||||
------------------------------------------------------------------------------ | ||||
{ | ||||
"type": "RELAY", | ||||
"id": "id1", | ||||
"destination": {"name":"endpoint"} | ||||
"data": {} | ||||
} | ||||
------------------------------------------------------------------------------ | ||||
[[elastic-agent-getting-started]] | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
== Get started with {beatname_uc} | ||||
|
||||
++++ | ||||
<titleabbrev>Get started</titleabbrev> | ||||
++++ | ||||
|
||||
== What is Elastic Agent | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
|
||||
Elastic Agent is single, unified agent that users can deploy to hosts or containers. Based on configuration provided, it controls which data is collected from the host or containers and where the data is sent. It will run Beats or Endpoint as needed. | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
* <<elastic-agent-installation>> | ||||
* <<elastic-agent-execution-modes>> | ||||
* <<elastic-agent-cmd-options>> | ||||
* <<elastic-agent-configuration>> | ||||
|
||||
[[elastic-agent-installation]] | ||||
== Installation | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
=== Step 1: Download Elastic Agent | ||||
dedemorton marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
See our https://www.elastic.co/downloads/beats/{beatname_lc}[download page] for | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would say something like: Download the package from the https://www.elastic.co/downloads/beats/{beatname_lc}[download page]. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that if you use {beatname_lc}, you'll need to set the attribute somewhere (probably in the index file) :beatname_lc: value Might make sense to create a new attribute for agent, tho |
||||
other installation options, such as 32-bit images. | ||||
|
||||
=== Step 2: Unpack archive | ||||
|
||||
|
||||
[[mac]] | ||||
*mac:* | ||||
dedemorton marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
ifeval::["{release-state}"=="unreleased"] | ||||
|
||||
Version {version} of {beatname_uc} has not yet been released. | ||||
|
||||
endif::[] | ||||
|
||||
ifeval::["{release-state}"!="unreleased"] | ||||
|
||||
["source","sh",subs="attributes,callouts"] | ||||
------------------------------------------------ | ||||
curl -L -O https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent-{version}-darwin-x86_64.tar.gz | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a bit odd to have step 1 and the curl command. I'd choose one or the other, not both. |
||||
tar xzvf elastic-agent-{version}-darwin-x86_64.tar.gz | ||||
------------------------------------------------ | ||||
|
||||
endif::[] | ||||
|
||||
[[linux]] | ||||
*linux:* | ||||
|
||||
ifeval::["{release-state}"=="unreleased"] | ||||
|
||||
Version {version} of {beatname_uc} has not yet been released. | ||||
|
||||
endif::[] | ||||
|
||||
ifeval::["{release-state}"!="unreleased"] | ||||
|
||||
["source","sh",subs="attributes,callouts"] | ||||
------------------------------------------------ | ||||
curl -L -O https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent-{version}-linux-x86_64.tar.gz | ||||
tar xzvf elastic-agent-{version}-linux-x86_64.tar.gz | ||||
------------------------------------------------ | ||||
|
||||
endif::[] | ||||
|
||||
[[win]] | ||||
*win:* | ||||
|
||||
ifeval::["{release-state}"=="unreleased"] | ||||
|
||||
Version {version} of {beatname_uc} has not yet been released. | ||||
|
||||
endif::[] | ||||
|
||||
ifeval::["{release-state}"!="unreleased"] | ||||
|
||||
. Download the Elastic Agent Windows zip file from the | ||||
https://www.elastic.co/downloads/beats/elastic-agent[downloads page]. | ||||
|
||||
. Extract the contents of the zip file into `C:\Program Files`. | ||||
|
||||
. Rename the `elastic-agent-<version>-windows` directory to `Elastic-Agent`. | ||||
|
||||
. Open a PowerShell prompt as an Administrator (right-click the PowerShell icon and select *Run As Administrator*). | ||||
|
||||
. From the PowerShell prompt, run the following commands to install Filebeat as a | ||||
Windows service: | ||||
+ | ||||
[source,shell] | ||||
---------------------------------------------------------------------- | ||||
PS > cd 'C:\Program Files\Elastic-Agent' | ||||
PS C:\Program Files\Elastic-Agent> .\install-service-elastic-agent.ps1 | ||||
---------------------------------------------------------------------- | ||||
|
||||
NOTE: If script execution is disabled on your system, you need to set the execution policy for the current session to allow the script to run. For example: `PowerShell.exe -ExecutionPolicy UnRestricted -File .\install-service-elastic-agent.ps1`. | ||||
|
||||
endif::[] | ||||
|
||||
=== Step 3: Run Elastic Agent | ||||
|
||||
If Elastic Agent is not installed as an auto-starting service it is possible to start in manually running. | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
|
||||
[source,shell] | ||||
---------------------------------------------------------------------- | ||||
$ ./elastic-agent run | ||||
---------------------------------------------------------------------- | ||||
|
||||
[[elastic-agent-execution-modes]] | ||||
== Execution modes | ||||
dedemorton marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
Elastic Agent is capable of running in two modes: standalone or fleet. Difference between these is in a way how where agent is configured and managed. | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
=== Standalone mode | ||||
|
||||
With standalone mode agent is configured locally and managed manually. Each agent is configured to be in this mode by default after installation. | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
Elastic Agent reads configuration file provided by `-c` argument while agent is being started or uses a default configuration located in the same directory called `elastic-agent.yml`. | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
For configuration options see link:elastic-agent_configuration_example.yml[Elastic Agent Configuration Example] | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this path will resolve correctly in the html. Where will this file live? You need to specify a path. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. referring to a file which sits beside this one in a repo. i hoped it gets copied as is and relative link will be resolved correctly |
||||
|
||||
=== Fleet mode | ||||
|
||||
With fleet mode agent is managed remotely. It uses trusted kibana instance with enabled _Ingest Manager_ and _Fleet_ to retrieve configurations from and report any agent events to. | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
Process of creating trusted communication channel between _Elastic Agent_ and _Kibana_ is called `enrolling an agent`. | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
To enroll an _Elastic Agent_ to _Fleet_ agent provides an `enroll` command. | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
|
||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
[NOTE] | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
============== | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
Agent needs to be stopped before executing enroll command. | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
============== | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
Enrolling an agent look like following: | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
[source,shell] | ||||
---------------------------------------------------------------------- | ||||
$ ./elastic-agent http://localhost:5601 $token | ||||
dedemorton marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
---------------------------------------------------------------------- | ||||
|
||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
`$token` is an Enrollment token acquired from fleet. | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
[[elastic-agent-cmd-options]] | ||||
== Command line options | ||||
|
||||
`elastic-agent run` commands provides few flags which can alter the behavior of an agent. | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
==== `-path.home` | ||||
dedemorton marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
Specifies home directory of an agent. `path.home` is used for determining location of configuration file or data directory. | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
==== `-c` | ||||
|
||||
This flags specifies configuration file to load. | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
If this is omitted elastic agent uses `{path.home}/elastic-agent.yml`. | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
|
||||
==== `-path.data` | ||||
|
||||
Data directory is used by agent to store downloaded artifacts and as a place where logs generated by Beats started and managed by the agent are written. | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
If not specified `{path.home}/data` is used. | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
[[elastic-agent-configuration]] | ||||
== Configuring Elastic Agent | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
By default Elastic Agent is configured to run in a standalone mode ingesting system data and sending them to local Elasticsearch on port 9200 with demo credentials of `elastic` user. It's also configured to monitor behavior of managed Beats in a form of tracking their logs and metrics and sending them to the same Elasticsearch instance. | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
To alter this behavior user has following options: | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
=== Configuring output | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
Elastic Agent enables definition of multiple outputs where each data source can be paired with different output. | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can say this more concisely. How about:
There are still a couple of problems with this. Will users know what a data source is? What do you mean by pairing? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sorry, my comment had some typos. Fixed. :-P |
||||
|
||||
E.g | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need for this...just introduce the example in the lead-in sentence. |
||||
[source,yaml] | ||||
------------------------------------------------------------------------------------- | ||||
outputs: | ||||
default: | ||||
type: elasticsearch | ||||
hosts: [127.0.0.1:9200] | ||||
username: elastic | ||||
password: changeme | ||||
|
||||
monitoring: | ||||
type: elasticsearch | ||||
api_key: VuaCfGcBCdbkQm-e5aOx:ui2lp2axTNmsyakw9tvNnw | ||||
hosts: ["localhost:9200"] | ||||
ca_sha256: "7lHLiyp4J8m9kw38SJ7SURJP4bXRZv/BNxyyXkCcE/M=" | ||||
------------------------------------------------------------------------------------- | ||||
|
||||
In the example above 2 outputs are provided. One called `default` and one called `monitoring`. | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
Difference between them is in authentication method they are using, while first one uses username password pair second one contains api key. | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
[NOTE] | ||||
============== | ||||
Configuration is invalid without definition of default output | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
============== | ||||
|
||||
=== Enable/Disable Beats monitoring | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
To disable or enable monitoring of managed Beats following section is available: | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
[source,yaml] | ||||
------------------------------------------------------------------------------------- | ||||
settings.monitoring: | ||||
# enabled turns on monitoring of running processes | ||||
enabled: true | ||||
# enables log monitoring | ||||
logs: true | ||||
# enables metrics monitoring | ||||
metrics: true | ||||
# specifies output to be used | ||||
use_output: monitoring | ||||
------------------------------------------------------------------------------------- | ||||
|
||||
|
||||
In case `settings.monitoring.enabled` is set to `false` monitoring of Beats is turned on and other options are ignored. | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you mean that it's turned off. Also I think this section needs to be easier to scan. I'll recommend edits to fix that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh yes thanks for notice
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
If `settings.monitoring.enabled` is set to `true` Elastic Agent watches Metrics or Logs of Beats according to `settings.monitoring.metrics` or `settings.monitoring.logs` values. | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
Having both set to `false` results in the same behavior as disabling monitoring. | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
`use_output` option specifies output to which events will be send. | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
=== Specifying data sources | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
By default Elastic Agent ingests some system metrics. Its default configuration can look like this: | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
|
||||
[source,yaml] | ||||
------------------------------------------------------------------------------------- | ||||
datasources: | ||||
- namespace: default | ||||
use_output: default | ||||
inputs: | ||||
- type: system/metrics | ||||
streams: | ||||
- metricset: cpu | ||||
dataset: system.cpu | ||||
- metricset: memory | ||||
dataset: system.memory | ||||
- metricset: network | ||||
dataset: system.network | ||||
- metricset: filesystem | ||||
dataset: system.filesystem | ||||
------------------------------------------------------------------------------------- | ||||
|
||||
This configuration configures gathering cpu, memory, network and filesystem metrics and sending them to default output. | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
If `use_output` option is not specified, output called `default` is used. | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
For more examples please refer to link:elastic-agent_configuration_example.yml[Elastic Agent Configuration Example] | ||||
michalpristas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michalpristas I think the requirement is that the Agent must be equal or higher than the Agent minor version. I think we are still able to make patch releases for Agent without updating the whole stack. Can you confirm?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we removed sending kbn-version as there was a check on kibana side which required it to be
==
when sent. not sure what the status of the check is atm cc @nchaulet