forked from elastic/ecs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Phase 2 in conversion to asciidoc (elastic#334)
* Phase 2 in conversion to asciidoc * Update docs/convert.asciidoc Trying the new suggest feature for changing v7.1 to v7.0. Co-Authored-By: karenzone <[email protected]> * Start incorporating review comments * Update faq.asciidoc Fix typo in anchor
- Loading branch information
Showing
9 changed files
with
253 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
[[convert-to-ecs]] | ||
== Converting an implementation to ECS | ||
|
||
A common schema helps you correlate and use data from various sources. | ||
|
||
Fields for most Elastic modules and solutions (version 7.0 and later) are mapped | ||
to the Elastic Common Schema. You may want to map data from other | ||
implementations to ECS to help you correlate data across all of your products | ||
and solutions. | ||
|
||
Before you start a conversion, be sure that you understand the basics below. | ||
|
||
[float] | ||
[[core-or-ext]] | ||
=== Core and extended fields | ||
|
||
* *Core fields.* Fields that are most common across all use cases are called *core fields*. | ||
+ | ||
These generalized fields are used by analysis content | ||
(searches, visualizations, dashboards, alerts, machine learning jobs, reports) | ||
across use cases. Analysis content designed to operate on these | ||
fields should work properly on data from any relevant source. | ||
+ | ||
Focus on populating these fields first. | ||
|
||
* *Extended fields.* Any field that is not a core field is called an *extended field*. | ||
Extended fields may apply to more narrow use cases, or may be more open | ||
to interpretation depending on the use case. Extended fields are more likely to | ||
change over time. | ||
|
||
Each {ecs} <<ecs-fields,field>> in a table is identified as core or extended. | ||
|
||
[float] | ||
[[ecs-comv]] | ||
=== An approach to mapping an existing implementation | ||
|
||
Here's the recommended approach for converting an existing implementation to {ecs}. | ||
|
||
. Start with Core fields. | ||
+ | ||
Populate core fields first. Look at your set of event fields, and find | ||
the appropriate ECS field name for each one. | ||
|
||
. Move on to Extended fields. | ||
+ | ||
Map fields that may be specific to various data sources using {ecs} extended | ||
fields. Look at {ecs} extended fields, and decide how to populate these fields | ||
with the data you have available. Even if you have already mapped a field to an | ||
{ecs} core field, you can still map it to an extended field. | ||
|
||
Populating both core and extended fields helps ensure reusability of ECS analysis | ||
content. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
[[ecs-faq]] | ||
== FAQ | ||
|
||
[float] | ||
[[ecs-benefits]] | ||
=== What are the benefits of using ECS? | ||
|
||
The benefits to a user adopting these fields and names in their clusters are: | ||
|
||
* **Data correlation.** Ability to easily correlate data from the same or different sources, including: | ||
** data from metrics, logs, and application performance management (apm) tools | ||
** data from the same machines/hosts | ||
** data from the same service | ||
* **Ease of recall.** Improved ability to remember commonly used field names (because there is a single set, not a set per data source) | ||
* **Ease of deduction.** Improved ability to deduce field names (because the field naming follows a small number of rules with few exceptions) | ||
* **Reuse.** Ability to re-use analysis content (searches, visualizations, dashboards, alerts, reports, and machine learning jobs) across multiple data sources | ||
* **Future proofing.** Ability to use any future Elastic-provided analysis content in your environment without modifications | ||
|
||
[float] | ||
[[conflict]] | ||
=== What if I have fields that conflict with ECS? | ||
|
||
The | ||
{ref}/rename-processor.html[rename | ||
processor] can help you resolve field conflicts. For example, imagine that you | ||
already have a field called "user," but ECS employs `user` as an object. You can | ||
use the rename processor on ingest time to rename your field to the matching ECS | ||
field. If your field does not match ECS, you can rename your field to | ||
`user.value` instead. | ||
|
||
[float] | ||
[[addl-fields]] | ||
=== What if my events have additional fields? | ||
|
||
Events may contain fields in addition to ECS fields. These fields can follow the | ||
ECS naming and writing rules, but this is not a requirement. | ||
|
||
[float] | ||
[[dot-notation]] | ||
=== Why does ECS use a dot notation instead of an underline notation? | ||
|
||
There are two common key formats for ingesting data into Elasticsearch: | ||
|
||
* Dot notation: `user.firstname: Nicolas`, `user.lastname: Ruflin` | ||
* Underline notation: `user_firstname: Nicolas`, `user_lastname: Ruflin` | ||
|
||
ECS uses the dot notation to represent nested objects. | ||
|
||
[float] | ||
[[notation-diff]] | ||
==== What is the difference between the two notations? | ||
|
||
Ingesting `user.firstname: Nicolas` and `user.lastname: Ruflin` is identical to ingesting the following JSON: | ||
|
||
``` | ||
"user": { | ||
"firstname": "Nicolas", | ||
"lastname": "Ruflin" | ||
} | ||
``` | ||
|
||
In Elasticsearch, `user` is represented as an {ref}/object.html[object | ||
datatype]. In the case of the underline notation, both are just | ||
{ref}/mapping-types.html[string datatypes]. | ||
|
||
NOTE: ECS does not use {ref}/nested.html[nested | ||
datatypes], which are arrays of objects. | ||
|
||
[float] | ||
[[dot-adv]] | ||
==== Advantages of dot notation | ||
|
||
With dot notation, each prefix in Elasticsearch is an object. Each object can have | ||
{ref}/object.html#object-params[parameters] | ||
that control how fields inside the object are treated. In the context of ECS, | ||
for example, these parameters would allow you to disable dynamic property | ||
creation for certain prefixes. | ||
|
||
Individual objects give you more flexibility on both the ingest and the event | ||
sides. In Elasticsearch, for example, you can use the remove processor to drop | ||
complete objects instead of selecting each key inside. You don't have to know | ||
ahead of time which keys will be in an object. | ||
|
||
In Beats, you can simplify the creation of events. For example, you can treat | ||
each object as an object (or struct in Golang), which makes constructing and | ||
modifying each part of the final event easier. | ||
|
||
[float] | ||
[[dot-disadv]] | ||
==== Disadvantage of dot notation | ||
|
||
In Elasticsearch, each key can have only one type. For example, if `user` is an | ||
`object`, you can't use it as a `keyword` type in the same index, like `{"user": | ||
"nicolas ruflin"}`. This restriction can be an issue in certain datasets. For | ||
the ECS data itself, this is not an issue because all fields are predefined. | ||
|
||
[float] | ||
[[underline]] | ||
==== What if I already use the underline notation? | ||
|
||
As long as there are no conflicts, underline notation and ECS dot notation can | ||
coexist in the same document. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.