-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Doc: Add tutorial for filter-elastic_integration #15932
base: main
Are you sure you want to change the base?
Changes from 6 commits
55d5045
f81c0c8
63962dc
66f68ec
8829aec
8884ee1
7c140de
a7800a8
4b4e672
56f006a
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 | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,183 @@ | ||||||
[[ea-integrations-tutorial]] | ||||||
=== Tutorial: {ls} `elastic_integration filter` to extend Elastic {integrations} | ||||||
++++ | ||||||
<titleabbrev>Tutorial: {ls} `elastic_integration filter`</titleabbrev> | ||||||
++++ | ||||||
|
||||||
You can use {ls} to transform events collected by {agent} using our {integrations-docs}[Elastic integrations]. | ||||||
You get the benefits of Elastic integrations--such as the simplicity of ingesting data from a wide variety of data | ||||||
sources and ensuring compliance with the {ecs-ref}/index.html[Elastic Common Schema (ECS)]--combined with the extra | ||||||
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.
|
||||||
processing power of {ls}. | ||||||
|
||||||
This new functionality is made possible by the <<plugins-filters-elastic_integration,elastic_integration filter>> plugin. | ||||||
When you include the `elastic_integration` filter in your configuration, {ls} reads certain field values generated by the {agent}, | ||||||
and uses them to apply the transformations from Elastic integrations to further process events before sending them to their | ||||||
configured destinations. | ||||||
karenzone marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
This tutorial walks you through adding the {integrations-docs}/crowdstrike-intro[Crowdstrike integration], using {ls} to | ||||||
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. @flexitrev, would you like to highlight a different integration for this tutorial and use case? |
||||||
remove the `_version` field, and then sending the data to {ess} or self-managed {es}. | ||||||
Comment on lines
+18
to
+19
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 believe that removing the My worry here is that people will copy/paste this config and assume that it is necessary. 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. ToDo: Come up with a better example that won't mislead users |
||||||
|
||||||
|
||||||
[[ea-integrations-prereqs]] | ||||||
==== Prerequisites and requirements | ||||||
|
||||||
You'll need: | ||||||
|
||||||
* A working {es} cluster | ||||||
karenzone marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
* {fleet} server | ||||||
* An {agent} configured to send output to {ls} | ||||||
* An active Elastic Enterprise https://www.elastic.co/subscriptions[subscription] | ||||||
* A user configured with the <<plugins-filters-elastic_integration-minimum_required_privileges,minimum required privileges>> | ||||||
|
||||||
NOTE: Even though the focus of this tutorial is {Fleet}-managed agents, you can use the `elastic_integration` filter and this | ||||||
general approach with {fleet-guide}/elastic-agent-configuration.html[self-managed agents]. | ||||||
|
||||||
|
||||||
[[ea-integrations-process-overview]] | ||||||
==== Process overview | ||||||
|
||||||
* <<ea-integrations-fleet>> | ||||||
* <<ea-integrations-create-policy>> | ||||||
* <<ea-integrations-pipeline>> | ||||||
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. Don't we need to setup LS instance before the LS policy? - I haven't fully followed the steps, not sure what experience I get when setting the policy first. |
||||||
|
||||||
[discrete] | ||||||
[[ea-integrations-fleet]] | ||||||
=== Configure {fleet} to send data from {agent} to {ls} | ||||||
|
||||||
. For {fleet}-managed agents, go to {kib} and navigate to *Fleet > Settings*. | ||||||
|
||||||
. Create a new output and specify {ls} as the output type. | ||||||
|
||||||
. Add the {ls} hosts (domain or IP address/s) that the {agent} should send data to. | ||||||
|
||||||
. Add the client SSL certificate and the Client SSL certificate key to the configuration. | ||||||
|
||||||
. Click *Save and apply settings* in the bottom right-hand corner of the page. | ||||||
|
||||||
[discrete] | ||||||
[[ea-integrations-create-policy]] | ||||||
=== Create an {agent} policy with the necessary integrations | ||||||
|
||||||
. In {kib} navigate to *Fleet > Agent* policies, and select *Create agent policy*. | ||||||
|
||||||
. Give this policy a name, and then select *Advanced options*. | ||||||
|
||||||
. Change the *Output for integrations* setting to the {ls} output you created. | ||||||
|
||||||
. Click *Create agent policy*. | ||||||
|
||||||
. Select the policy name, and click *Add integration*. | ||||||
+ | ||||||
This step takes you to the integrations browser, where you can select an integration that has everything | ||||||
necessary to _integrate_ the data source with your other data in the {stack}. | ||||||
We'll use Crowdstrike as our example in this tutorial. | ||||||
|
||||||
. On the *Crowdstrike* integration overview page, click *Add Crowdstrike* to configure the integration. | ||||||
|
||||||
. Configure the integration to collect the data you need. | ||||||
On step 2 at the bottom of the page (*Where to add this integration?*), make sure that the “Existing hosts” option | ||||||
is selected and the Agent policy selected is the Logstash policy we created for our Logstash output. | ||||||
This policy should be selected by default. | ||||||
|
||||||
. Click *Save and continue*. | ||||||
+ | ||||||
You have the option to add the {agent} to your hosts. | ||||||
If you haven't already, {fleet-guide}/elastic-agent-installation.html[install the {agent}] on the host where you want to collect data. | ||||||
|
||||||
|
||||||
[discrete] | ||||||
[[ea-integrations-pipeline]] | ||||||
=== Configure {ls} to use the `elastic_integration` filter plugin | ||||||
|
||||||
. Create a new {logstash-ref}/configuration.html[{ls} pipeline]. | ||||||
. Be sure to include these plugins: | ||||||
|
||||||
* <<plugins-inputs-elastic_agent,`elastic_agent` input>> | ||||||
* <<plugins-filters-elastic_integration,`elastic_integration` filter>> | ||||||
* <<plugins-outputs-elasticsearch,`elasticsearch` output>> | ||||||
|
||||||
Note that every event sent from the {agent} to {ls} contains specific meta-fields. | ||||||
{ls} expects events to contain `data_stream.type`, `data_stream.dataset`, and `data_stream.namespace`. | ||||||
karenzone marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
{ls} uses this information and its connection to {es} to determine which integrations to apply to the event before sending the event to its destination output. | ||||||
{ls} frequently synchronizes with {es} to ensure that it has the most recent versions of the enabled integrations. | ||||||
|
||||||
|
||||||
[discrete] | ||||||
[[ea-integrations-ess-sample]] | ||||||
==== Sample configuration: output to {ess} | ||||||
|
||||||
This sample illustrates using the `elastic_agent` input and the `elastic_integration` filter for processing in {ls}, and then sending the output to {ess}. | ||||||
|
||||||
Check out the <<plugins-filters-elastic_integration,elastic_integration filter plugin docs>> for the full list of configuration options. | ||||||
|
||||||
[source,txt] | ||||||
----- | ||||||
input { | ||||||
elastic_agent { port => 5055 } | ||||||
} | ||||||
|
||||||
filter { | ||||||
elastic_integration { | ||||||
cloud_id => "your-cloud:id" | ||||||
api_key => "api-key" | ||||||
remove_field => ["_version"] | ||||||
} | ||||||
} | ||||||
|
||||||
output { | ||||||
stdout {} | ||||||
elasticsearch { | ||||||
cloud_auth => "elastic:<pwd>" | ||||||
cloud_id => "your-cloud-id" | ||||||
} | ||||||
} | ||||||
----- | ||||||
karenzone marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
All processing occurs in {ls} before events are forwarded to {ess}. | ||||||
|
||||||
[discrete] | ||||||
[[ea-integrations-es-sample]] | ||||||
==== Sample configuration: output to self-managed {es} | ||||||
|
||||||
This sample illustrates using the `elastic_agent` input and the `elastic_integration` filter for processing in {ls}, and then sending the output to {es}. | ||||||
|
||||||
Check out the <<plugins-filters-elastic_integration,elastic_integration filter plugin docs>> for the full list of configuration options. | ||||||
|
||||||
Check out <<plugins-filters-elastic_integration-minimum_required_privileges>> for more info. | ||||||
|
||||||
[source,txt] | ||||||
----- | ||||||
input { | ||||||
elastic_agent { port => 5055 } | ||||||
} | ||||||
|
||||||
filter { | ||||||
elastic_integration { | ||||||
hosts => "{es-host}:9200" | ||||||
ssl_enabled => true | ||||||
ssl_certificate_authorities => ["/usr/share/logstash/config/certs/ca-cert.pem"] | ||||||
auth_basic_username => "elastic" <1> | ||||||
auth_basic_password => "changeme" <2> | ||||||
remove_field => ["_version"] | ||||||
} | ||||||
} | ||||||
|
||||||
output { | ||||||
stdout { | ||||||
codec => rubydebug # to debug datastream inputs | ||||||
} | ||||||
## add elasticsearch | ||||||
elasticsearch { | ||||||
hosts => "{es-host}:9200" | ||||||
password => "changeme" | ||||||
user => "elastic" | ||||||
cacert => "/usr/share/logstash/config/certs/ca-cert.pem" | ||||||
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. Modern versions of the Elasticsearch Output plugin still support legacy settings like
Suggested change
|
||||||
} | ||||||
} | ||||||
----- | ||||||
karenzone marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
<1> The user credentials that you specify in the `elastic_integration` filter must have sufficient privileges to get information about {es} and the integrations that you are using. | ||||||
<2> The user credentials that you specify in the `elastic_integration` filter must have sufficient privileges to get information about {es} and the integrations that you are using. | ||||||
|
||||||
All processing occurs in {ls} before events are forwarded to {es}. |
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.