Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Backport #329 to 1.0: Clarify the difference between @timestamp and event.created (#329) #360

Merged
merged 2 commits into from
Mar 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ All notable changes to this project will be documented in this file based on the

### Improvements

* Clarified the difference between `@timestamp` and `event.created`. #329

### Deprecated

## [1.0.0-beta2](https://github.com/elastic/ecs/compare/v1.0.0-beta1...v1.0.0-beta2)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ The base set contains all fields which are on the top level. These fields are co

| Field | Description | Level | Type | Example |
|---|---|---|---|---|
| <a name="@timestamp"></a>@timestamp | Date/time when the event originated.<br/>For log events this is the date/time when the event was generated, and not when it was read.<br/>Required field for all events. | core | date | `2016-05-23T08:05:34.853Z` |
| <a name="@timestamp"></a>@timestamp | Date/time when the event originated.<br/>This is the date/time extracted from the event, typically representing when the event was generated by the source.<br/>If the event source has no original timestamp, this value is typically populated by the first time the event was received by the pipeline.<br/>Required field for all events. | core | date | `2016-05-23T08:05:34.853Z` |
| <a name="tags"></a>tags | List of keywords used to tag each event. | core | keyword | `["production", "env2"]` |
| <a name="labels"></a>labels | Key/value pairs.<br/>Can be used to add meta information to events. Should not contain nested objects. All values are stored as keyword.<br/>Example: `docker` and `k8s` labels. | core | object | `{'application': 'foo-bar', 'env': 'production'}` |
| <a name="message"></a>message | For log events the message field contains the log message.<br/>In other use cases the message field can be used to concatenate different values which are then freely searchable. If multiple messages exist, they can be combined into one message. | core | text | `Hello World` |
Expand Down Expand Up @@ -215,7 +215,7 @@ The event fields are used for context information about the log or metric event
| <a name="event.hash"></a>event.hash | Hash (perhaps logstash fingerprint) of raw field to be able to demonstrate log integrity. | extended | keyword | `123456789012345678901234567890ABCD` |
| <a name="event.duration"></a>event.duration | Duration of the event in nanoseconds.<br/>If event.start and event.end are known this value should be the difference between the end and start time. | core | long | |
| <a name="event.timezone"></a>event.timezone | This field should be populated when the event's timestamp does not include timezone information already (e.g. default Syslog timestamps). It's optional otherwise.<br/>Acceptable timezone formats are: a canonical ID (e.g. "Europe/Amsterdam"), abbreviated (e.g. "EST") or an HH:mm differential (e.g. "-05:00"). | extended | keyword | |
| <a name="event.created"></a>event.created | event.created contains the date when the event was created.<br/>This timestamp is distinct from @timestamp in that @timestamp contains the processed timestamp. For logs these two timestamps can be different as the timestamp in the log line and when the event is read for example by Filebeat are not identical. `@timestamp` must contain the timestamp extracted from the log line, event.created when the log line is read. The same could apply to package capturing where @timestamp contains the timestamp extracted from the network package and event.created when the event was created.<br/>In case the two timestamps are identical, @timestamp should be used. | core | date | |
| <a name="event.created"></a>event.created | event.created contains the date/time when the event was first read by an agent, or by your pipeline.<br/>This field is distinct from @timestamp in that @timestamp typically contain the time extracted from the original event.<br/>In most situations, these two timestamps will be slightly different. The difference can be used to calculate the delay between your source generating an event, and the time when your agent first processed it. This can be used to monitor your agent's or pipeline's ability to keep up with your event source.<br/>In case the two timestamps are identical, @timestamp should be used. | core | date | |
| <a name="event.start"></a>event.start | event.start contains the date when the event started or when the activity was first observed. | extended | date | |
| <a name="event.end"></a>event.end | event.end contains the date when the event ended or when the activity was last observed. | extended | date | |
| <a name="event.risk_score"></a>event.risk_score | Risk score or priority of the event (e.g. security solutions). Use your system's original value here. | core | float | |
Expand Down
42 changes: 0 additions & 42 deletions code/go/ecs/user.go

This file was deleted.

26 changes: 15 additions & 11 deletions fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,11 @@
description: >
Date/time when the event originated.

For log events this is the date/time when the event was generated, and
not when it was read.
This is the date/time extracted from the event, typically representing
when the event was generated by the source.

If the event source has no original timestamp, this value is typically
populated by the first time the event was received by the pipeline.

Required field for all events.

Expand Down Expand Up @@ -558,16 +561,17 @@
level: core
type: date
description: >
event.created contains the date when the event was created.
event.created contains the date/time when the event was first read by an
agent, or by your pipeline.

This field is distinct from @timestamp in that @timestamp typically contain
the time extracted from the original event.

This timestamp is distinct from @timestamp in that @timestamp contains
the processed timestamp. For logs these two timestamps can be different
as the timestamp in the log line and when the event is read for example
by Filebeat are not identical. `@timestamp` must contain the timestamp
extracted from the log line, event.created when the log line is read.
The same could apply to package capturing where @timestamp contains the
timestamp extracted from the network package and event.created when the
event was created.
In most situations, these two timestamps will be slightly different.
The difference can be used to calculate the delay between your source
generating an event, and the time when your agent first processed it.
This can be used to monitor your agent's or pipeline's ability to
keep up with your event source.

In case the two timestamps are identical, @timestamp should be used.

Expand Down
4 changes: 2 additions & 2 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"description": "The base set contains all fields which are on the top level. These fields are common across all types of events.\n",
"fields": {
"@timestamp": {
"description": "Date/time when the event originated.\nFor log events this is the date/time when the event was generated, and not when it was read.\nRequired field for all events.",
"description": "Date/time when the event originated.\nThis is the date/time extracted from the event, typically representing when the event was generated by the source.\nIf the event source has no original timestamp, this value is typically populated by the first time the event was received by the pipeline.\nRequired field for all events.",
"example": "2016-05-23T08:05:34.853Z",
"footnote": "",
"group": 1,
Expand Down Expand Up @@ -495,7 +495,7 @@
"type": "keyword"
},
"event.created": {
"description": "event.created contains the date when the event was created.\nThis timestamp is distinct from @timestamp in that @timestamp contains the processed timestamp. For logs these two timestamps can be different as the timestamp in the log line and when the event is read for example by Filebeat are not identical. `@timestamp` must contain the timestamp extracted from the log line, event.created when the log line is read. The same could apply to package capturing where @timestamp contains the timestamp extracted from the network package and event.created when the event was created.\nIn case the two timestamps are identical, @timestamp should be used.",
"description": "event.created contains the date/time when the event was first read by an agent, or by your pipeline.\nThis field is distinct from @timestamp in that @timestamp typically contain the time extracted from the original event.\nIn most situations, these two timestamps will be slightly different. The difference can be used to calculate the delay between your source generating an event, and the time when your agent first processed it. This can be used to monitor your agent's or pipeline's ability to keep up with your event source.\nIn case the two timestamps are identical, @timestamp should be used.",
"example": "",
"footnote": "",
"group": 2,
Expand Down
7 changes: 5 additions & 2 deletions schemas/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@
description: >
Date/time when the event originated.

For log events this is the date/time when the event was generated, and
not when it was read.
This is the date/time extracted from the event, typically representing
when the event was generated by the source.

If the event source has no original timestamp, this value is typically
populated by the first time the event was received by the pipeline.

Required field for all events.

Expand Down
21 changes: 11 additions & 10 deletions schemas/event.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,17 @@
level: core
type: date
description: >
event.created contains the date when the event was created.

This timestamp is distinct from @timestamp in that @timestamp contains
the processed timestamp. For logs these two timestamps can be different
as the timestamp in the log line and when the event is read for example
by Filebeat are not identical. `@timestamp` must contain the timestamp
extracted from the log line, event.created when the log line is read.
The same could apply to package capturing where @timestamp contains the
timestamp extracted from the network package and event.created when the
event was created.
event.created contains the date/time when the event was first read by an
agent, or by your pipeline.

This field is distinct from @timestamp in that @timestamp typically contain
the time extracted from the original event.

In most situations, these two timestamps will be slightly different.
The difference can be used to calculate the delay between your source
generating an event, and the time when your agent first processed it.
This can be used to monitor your agent's or pipeline's ability to
keep up with your event source.

In case the two timestamps are identical, @timestamp should be used.

Expand Down