Skip to content
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

Add event.ingested as the ingest timestamp #582

Merged
merged 6 commits into from
Nov 19, 2019
Merged
Show file tree
Hide file tree
Changes from 5 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.next.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Thanks, you're awesome :-) -->

### Added

* Add `event.ingested` as the ingest timestamp. #582

### Improvements

### Deprecated
Expand Down
9 changes: 9 additions & 0 deletions code/go/ecs/event.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 16 additions & 1 deletion docs/field-details.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,7 @@ In case the two timestamps are identical, @timestamp should be used.

type: date


example: `2016-05-23 08:05:34.857000`

| core

Expand Down Expand Up @@ -1226,6 +1226,21 @@ example: `8a4f500d`

// ===============================================================

| event.ingested
| Timestamp when an event arrived in the central data store.

This is different from `@timestamp`, which is when the event originally occurred. It's also different from `event.created`, which is meant to capture the first time an agent saw the event.

In normal conditions, assuming no tampering, the timestamps should chronologically look like this: `@timestamp` < `event.created` < `event.ingested`.

type: date

example: `2016-05-23 08:05:35.101000`

| core

// ===============================================================

| event.kind
| The kind of the event.

Expand Down
13 changes: 13 additions & 0 deletions generated/beats/fields.ecs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,7 @@
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.'
example: 2016-05-23 08:05:34.857000
- name: dataset
level: core
type: keyword
Expand Down Expand Up @@ -987,6 +988,18 @@
ignore_above: 1024
description: Unique ID to describe the event.
example: 8a4f500d
- name: ingested
level: core
type: date
description: 'Timestamp when an event arrived in the central data store.

This is different from `@timestamp`, which is when the event originally occurred. It''s
also different from `event.created`, which is meant to capture the first time
an agent saw the event.

In normal conditions, assuming no tampering, the timestamps should chronologically
look like this: `@timestamp` < `event.created` < `event.ingested`.'
example: 2016-05-23 08:05:35.101000
- name: kind
level: extended
type: keyword
Expand Down
3 changes: 2 additions & 1 deletion generated/csv/fields.csv
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,13 @@ error.type,keyword,extended,java.lang.NullPointerException,1.2.0-dev
event.action,keyword,core,user-password-change,1.2.0-dev
event.category,keyword,core,user-management,1.2.0-dev
event.code,keyword,extended,4648,1.2.0-dev
event.created,date,core,,1.2.0-dev
event.created,date,core,2016-05-23 08:05:34.857000,1.2.0-dev
event.dataset,keyword,core,apache.access,1.2.0-dev
event.duration,long,core,,1.2.0-dev
event.end,date,extended,,1.2.0-dev
event.hash,keyword,extended,123456789012345678901234567890ABCD,1.2.0-dev
event.id,keyword,core,8a4f500d,1.2.0-dev
event.ingested,date,core,2016-05-23 08:05:35.101000,1.2.0-dev
event.kind,keyword,extended,state,1.2.0-dev
event.module,keyword,core,apache,1.2.0-dev
event.original,keyword,core,Sep 19 08:26:10 host CEF:0&#124;Security&#124; threatmanager&#124;1.0&#124;100&#124; worm successfully stopped&#124;10&#124;src=10.0.0.1 dst=2.1.2.2spt=1232,1.2.0-dev
Expand Down
17 changes: 17 additions & 0 deletions generated/ecs/ecs_flat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1266,6 +1266,7 @@ event.created:
agent''s or pipeline''s ability to keep up with your event source.

In case the two timestamps are identical, @timestamp should be used.'
example: 2016-05-23 08:05:34.857000
flat_name: event.created
level: core
name: created
Expand Down Expand Up @@ -1335,6 +1336,22 @@ event.id:
order: 0
short: Unique ID to describe the event.
type: keyword
event.ingested:
description: 'Timestamp when an event arrived in the central data store.

This is different from `@timestamp`, which is when the event originally occurred. It''s
also different from `event.created`, which is meant to capture the first time
an agent saw the event.

In normal conditions, assuming no tampering, the timestamps should chronologically
look like this: `@timestamp` < `event.created` < `event.ingested`.'
example: 2016-05-23 08:05:35.101000
flat_name: event.ingested
level: core
name: ingested
order: 21
short: Timestamp when an event arrived in the central data store.
type: date
event.kind:
description: 'The kind of the event.

Expand Down
17 changes: 17 additions & 0 deletions generated/ecs/ecs_nested.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1477,6 +1477,7 @@ event:
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.'
example: 2016-05-23 08:05:34.857000
flat_name: event.created
level: core
name: created
Expand Down Expand Up @@ -1547,6 +1548,22 @@ event:
order: 0
short: Unique ID to describe the event.
type: keyword
ingested:
description: 'Timestamp when an event arrived in the central data store.

This is different from `@timestamp`, which is when the event originally occurred. It''s
also different from `event.created`, which is meant to capture the first time
an agent saw the event.

In normal conditions, assuming no tampering, the timestamps should chronologically
look like this: `@timestamp` < `event.created` < `event.ingested`.'
example: 2016-05-23 08:05:35.101000
flat_name: event.ingested
level: core
name: ingested
order: 21
short: Timestamp when an event arrived in the central data store.
type: date
kind:
description: 'The kind of the event.

Expand Down
3 changes: 3 additions & 0 deletions generated/elasticsearch/6/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,9 @@
"ignore_above": 1024,
"type": "keyword"
},
"ingested": {
"type": "date"
},
"kind": {
"ignore_above": 1024,
"type": "keyword"
Expand Down
3 changes: 3 additions & 0 deletions generated/elasticsearch/7/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,9 @@
"ignore_above": 1024,
"type": "keyword"
},
"ingested": {
"type": "date"
},
"kind": {
"ignore_above": 1024,
"type": "keyword"
Expand Down
3 changes: 3 additions & 0 deletions generated/legacy/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,9 @@
"ignore_above": 1024,
"type": "keyword"
},
"ingested": {
"type": "date"
},
"kind": {
"ignore_above": 1024,
"type": "keyword"
Expand Down
12 changes: 11 additions & 1 deletion schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@
},
"event.created": {
"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": "",
"example": "2016-05-23 08:05:34.857000",
"footnote": "",
"group": 2,
"level": "core",
Expand Down Expand Up @@ -882,6 +882,16 @@
"required": false,
"type": "keyword"
},
"event.ingested": {
"description": "Timestamp when an event arrived in the central data store.\nThis is different from `@timestamp`, which is when the event originally occurred. It's also different from `event.created`, which is meant to capture the first time an agent saw the event.\nIn normal conditions, assuming no tampering, the timestamps should chronologically look like this: `@timestamp` < `event.created` < `event.ingested`.",
"example": "2016-05-23 08:05:35.101000",
"footnote": "",
"group": 2,
"level": "core",
"name": "event.ingested",
"required": false,
"type": "date"
},
"event.kind": {
"description": "The kind of the event.\nThis gives information about what type of information the event contains, without being specific to the contents of the event. Examples are `event`, `state`, `alarm`. Warning: In future versions of ECS, we plan to provide a list of acceptable values for this field, please use with caution.",
"example": "state",
Expand Down
16 changes: 16 additions & 0 deletions schemas/event.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@
level: core
type: date
short: Time when the event was first read by an agent or by your pipeline.
example: 2016-05-23T08:05:34.857Z
description: >
event.created contains the date/time when the event was first read by an
agent, or by your pipeline.
Expand Down Expand Up @@ -276,3 +277,18 @@

This is mainly useful if you use more than one system that assigns
risk scores, and you want to see a normalized value across all systems.

- name: ingested
level: core
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extended?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to introduce it directly as core. From the feedback we've seen, this timestamp is considered more useful than event.created.

A few reasons why that is so:

  • It's another system's timestamp, which can help detect tampering of the clock on the monitored machine
  • It can also be used to detect slowdowns in the overall pipeline, assuming no tampering

PRs such as elastic/beats#14001 could also help populating it broadly and reliably, without having to revisit all modules or all beats.

If you have strong feelings and would really prefer to start by introducing as extended, I can go with that, in order to get this in quickly. But I think it would send the wrong message wrt to this timestamp's importance vs event.created.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll wait for your response on this, and would like to merge this tomorrow if possible

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM

type: date
short: Timestamp when an event arrived in the central data store.
example: 2016-05-23T08:05:35.101Z
description: >
Timestamp when an event arrived in the central data store.

This is different from `@timestamp`, which is when the event originally
occurred. It's also different from `event.created`, which is meant
to capture the first time an agent saw the event.

In normal conditions, assuming no tampering, the timestamps should
chronologically look like this: `@timestamp` < `event.created` < `event.ingested`.