feat: ecs event spec - #346
Conversation
|
💚 CLA has been signed |
|
This pull request does not have a backport label. Could you fix it @olegsu? 🙏
|
054ced0 to
96ef744
Compare
eyalkraft
left a comment
There was a problem hiding this comment.
Good job!
small changes required
|
|
||
| // Event According to https://www.elastic.co/guide/en/ecs/current/ecs-event.html | ||
| // event.ingested property is not part of this struct as the fleet server setting it | ||
| type Event struct { |
There was a problem hiding this comment.
Nice!
Please make sure we use beat's implementation if possible
There was a problem hiding this comment.
Great, I was looking this one
There was a problem hiding this comment.
@eyalkraft the ecs.Event like other ECS types is using only ecs custom struct type.
So the final document looks like this (with uppercase keys)
If you are familiar with the decoder of those ecs tags it would be great.
Otherwise, I suggest keeping the previous, custom sturct and to handle this later.

| @@ -84,7 +85,7 @@ func (d *Data) fetchIteration(ctx context.Context) { | |||
| start := time.Now() | |||
|
|
|||
| cycleId, _ := uuid.NewV4() | |||
There was a problem hiding this comment.
There are some cycleId leftovers
| ID: id.String(), | ||
| Kind: ecs.KindState, | ||
| Sequence: seq, | ||
| Outcome: ecs.OutcomeSuccess, |
There was a problem hiding this comment.
I now wonder If we should also send the failed evaluations as failed events...
I'll comment in the issue
There was a problem hiding this comment.
Sounds as a good KPI
| "github.com/stretchr/testify/assert" | ||
| ) | ||
|
|
||
| func TestOpaEvaluator_decode(t *testing.T) { |
| } | ||
|
|
||
| err = decoder.Decode(result) | ||
| opaResult.Metadata.CreatedAt = now() |
There was a problem hiding this comment.
Since it's only used once that could maybe be
| opaResult.Metadata.CreatedAt = now() | |
| opaResult.Metadata.CreatedAt = time.Now().UTC() |
There was a problem hiding this comment.
The reason for this was to have the ability to overwrite the value to a predictable one in the test
|
A quick update following #346 (comment) To support the The migration to To close, the |
080b0f3 to
2a2dddc
Compare
|
Thanks @olegsu! This PR looks great. |
cf6480f to
77c6934
Compare
gurevichdmitry
left a comment
There was a problem hiding this comment.
@olegsu, utils.py file approved. LGTM
|
This pull request is now in conflicts. Could you fix it? 🙏 |
https://www.elastic.co/guide/en/ecs/current/ecs-event.html Signed-off-by: Oleg Sucharevich <oleg.sucharevich@elastic.co>
Signed-off-by: Oleg Sucharevich <oleg.sucharevich@elastic.co>
Cloudbeat CI 🤖Allure Report: http://csp-allure-reports.s3.amazonaws.com/allure_reports/cloudbeat/prs/346/index.html |
Done @eyalkraft |
Related to https://github.com/elastic/security-team/issues/3782
