Skip to content

Commit 3fa6e39

Browse files
committed
o365: tolerate missing cursor elements when advancing
WIP This should never happen, but there is not yet enough information to determine the cause. It may be that we want to raise a health status update in situations like this. My guess is that there was an error, the cursor was damaged and we end up not having parts of the cursor. The question is "How?"
1 parent 3edaa92 commit 3fa6e39

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

packages/o365/changelog.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# newer versions go on top
2+
- version: "2.26.2"
3+
changes:
4+
- description: Tolerate missing cursor elements when advancing.
5+
type: bugfix
6+
link: https://github.com/elastic/integrations/pull/
27
- version: "2.26.1"
38
changes:
49
- description: Ensure that cursors are not updated to times in the future.

packages/o365/data_stream/audit/agent/stream/cel.yml.hbs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,9 @@ program: |-
456456
(
457457
// Ensure that we bring the current type up to the current time,
458458
// even if we did not get any content for the query period.
459-
timestamp(state.cursor.last_for[state.work.curr_type.to_lower()]) < now - duration("1h") &&
460-
!state.work.todo_type.exists(t, t == state.work.curr_type)
459+
has(state.?work.curr_type) && state.?cursor.last_for.optMap(l,
460+
timestamp(l[state.work.curr_type.to_lower()]) < now - duration("1h")
461+
).orValue(false) && !state.work.todo_type.exists(t, t == state.work.curr_type)
461462
) ?
462463
state.with(
463464
{

packages/o365/manifest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: o365
22
title: Microsoft Office 365
3-
version: "2.26.1"
3+
version: "2.26.2"
44
description: Collect logs from Microsoft Office 365 with Elastic Agent.
55
type: integration
66
format_version: "3.2.3"

0 commit comments

Comments
 (0)