Skip to content

Commit b16e934

Browse files
[Atlassian JIRA and Atlassian Conflunce] Update Cursor Logic to Remove Duplicate Events (#13665)
After reviewing the Atlassian Jira[1] and Atlassian Confluence[2] API documentation, It has been noticed that the APIs return data on or after the specified start date. Currently, the date from the response body is getting saved into the cursor. Because of this, when the request is being made in the next interval, it includes data we've already fetched—leading to duplicate events being published to Elasticsearch. Hence, updated the cursor logic, added 1ms to it would fetch the data afterwards. This change has been tested on the data available in the test folder as well as using the mock server. [1]https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-audit-records/#api-rest-api-3-auditing-record-get [2]https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-audit/#api-wiki-rest-api-audit-get
1 parent ae9270b commit b16e934

File tree

6 files changed

+18
-8
lines changed

6 files changed

+18
-8
lines changed

packages/atlassian_confluence/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: "1.29.1"
3+
changes:
4+
- description: Update cursor logic to remove duplicate events.
5+
type: bugfix
6+
link: https://github.com/elastic/integrations/pull/13665
27
- version: "1.29.0"
38
changes:
49
- description: Improve error reporting.

packages/atlassian_confluence/data_stream/audit/agent/stream/httpjson.yml.hbs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ response.pagination:
6565
value: '{{limit}}'
6666
cursor:
6767
last_timestamp:
68-
value: '[[(toInt .first_event.creationDate)]]'
68+
value: '[[add (toInt .first_event.creationDate) 1]]'
6969

7070
fields_under_root: true
7171
fields:
@@ -110,7 +110,7 @@ response.pagination:
110110

111111
cursor:
112112
last_timestamp:
113-
value: '[[.first_event.timestamp]]'
113+
value: '[[formatDate (parseTimestampMilli (add (parseDate .first_event.timestamp).UnixMilli 1))]]'
114114
{{/if}}
115115

116116
tags:
@@ -128,4 +128,4 @@ publisher_pipeline.disable_host: true
128128
{{#if processors}}
129129
processors:
130130
{{processors}}
131-
{{/if}}
131+
{{/if}}

packages/atlassian_confluence/manifest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
format_version: "3.0.2"
22
name: atlassian_confluence
33
title: Atlassian Confluence
4-
version: "1.29.0"
4+
version: "1.29.1"
55
description: Collect logs from Atlassian Confluence with Elastic Agent.
66
type: integration
77
categories:

packages/atlassian_jira/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: "1.30.2"
3+
changes:
4+
- description: Update cursor logic to remove duplicate events.
5+
type: bugfix
6+
link: https://github.com/elastic/integrations/pull/13665
27
- version: "1.30.1"
38
changes:
49
- description: Handle multiple IP address.

packages/atlassian_jira/data_stream/audit/agent/stream/httpjson.yml.hbs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ response.pagination:
6262
value: '{{limit}}'
6363
cursor:
6464
last_timestamp:
65-
value: "[[.first_event.created]]"
65+
value: '[[formatDate (parseTimestampMilli (add (parseDate .first_event.created).UnixMilli 1))]]'
6666
{{else}}
6767
{{#unless username}}
6868
{{#unless password}}
@@ -91,7 +91,7 @@ response.pagination:
9191

9292
cursor:
9393
last_timestamp:
94-
value: "[[.first_event.timestamp]]"
94+
value: '[[formatDate (parseTimestampMilli (add (parseDate .first_event.timestamp).UnixMilli 1))]]'
9595
{{/if}}
9696

9797
tags:
@@ -116,4 +116,4 @@ fields:
116116
{{#if processors}}
117117
processors:
118118
{{processors}}
119-
{{/if}}
119+
{{/if}}

packages/atlassian_jira/manifest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
format_version: "3.0.2"
22
name: atlassian_jira
33
title: Atlassian Jira
4-
version: "1.30.1"
4+
version: "1.30.2"
55
description: Collect logs from Atlassian Jira with Elastic Agent.
66
type: integration
77
categories:

0 commit comments

Comments
 (0)