Skip to content

Commit

Permalink
proofpoint_tap: fix interval end clamping (#11596)
Browse files Browse the repository at this point in the history
The logic was previously incorrectly stretching all end points to now.
Fix this by inverting the clamp condition.

I do not see a way to test the full set of pagination conditions now
that this has been fixed; elastic-package does not provide a way to set
a testing time, which would be required to test this since the only
communication between the agent and the endpoint is via time ranges.
Since stream is stateless, we cannot know what we should expect the next
request to be. So just do a single request test, leaving the
configuration of stream the same on the basis that at some point in the
future we may figure out a way to test this.
  • Loading branch information
efd6 authored Oct 31, 2024
1 parent 8a249bc commit 9aca512
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 17 deletions.
5 changes: 5 additions & 0 deletions packages/proofpoint_tap/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# newer versions go on top
- version: "1.24.3"
changes:
- description: Fix time interval clamp logic.
type: bugfix
link: https://github.com/elastic/integrations/pull/11596
- version: "1.24.2"
changes:
- description: Ensure that query endpoints have been published to the stored cursor state.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ data_stream:
vars:
preserve_original_event: true
assert:
hit_count: 2
hit_count: 1
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ request.transforms:
[[- $end = .Add $hour -]]
[[- end -]]
[[- with $end -]]
[[- if .Before now -]]
[[- if .After now -]]
[[- $end = now -]]
[[- end -]]
[[- end -]]
Expand All @@ -53,7 +53,7 @@ request.transforms:
[[- $end = .Add $hour -]]
[[- end -]]
[[- with $end -]]
[[- if .Before now -]]
[[- if .After now -]]
[[- $end = now -]]
[[- end -]]
[[- end -]]
Expand All @@ -76,7 +76,7 @@ response.pagination:
[[- $end = .Add $hour -]]
[[- end -]]
[[- with $end -]]
[[- if .Before now -]]
[[- if .After now -]]
[[- $end = now -]]
[[- end -]]
[[- end -]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ data_stream:
vars:
preserve_original_event: true
assert:
hit_count: 2
hit_count: 1
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ request.transforms:
[[- $end = .Add $hour -]]
[[- end -]]
[[- with $end -]]
[[- if .Before now -]]
[[- if .After now -]]
[[- $end = now -]]
[[- end -]]
[[- end -]]
Expand All @@ -53,7 +53,7 @@ request.transforms:
[[- $end = .Add $hour -]]
[[- end -]]
[[- with $end -]]
[[- if .Before now -]]
[[- if .After now -]]
[[- $end = now -]]
[[- end -]]
[[- end -]]
Expand All @@ -76,7 +76,7 @@ response.pagination:
[[- $end = .Add $hour -]]
[[- end -]]
[[- with $end -]]
[[- if .Before now -]]
[[- if .After now -]]
[[- $end = now -]]
[[- end -]]
[[- end -]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ data_stream:
vars:
preserve_original_event: true
assert:
hit_count: 2
hit_count: 1
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ request.transforms:
[[- $end = .Add $hour -]]
[[- end -]]
[[- with $end -]]
[[- if .Before now -]]
[[- if .After now -]]
[[- $end = now -]]
[[- end -]]
[[- end -]]
Expand All @@ -53,7 +53,7 @@ request.transforms:
[[- $end = .Add $hour -]]
[[- end -]]
[[- with $end -]]
[[- if .Before now -]]
[[- if .After now -]]
[[- $end = now -]]
[[- end -]]
[[- end -]]
Expand All @@ -76,7 +76,7 @@ response.pagination:
[[- $end = .Add $hour -]]
[[- end -]]
[[- with $end -]]
[[- if .Before now -]]
[[- if .After now -]]
[[- $end = now -]]
[[- end -]]
[[- end -]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ data_stream:
vars:
preserve_original_event: true
assert:
hit_count: 2
hit_count: 1
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ request.transforms:
[[- $end = .Add $hour -]]
[[- end -]]
[[- with $end -]]
[[- if .Before now -]]
[[- if .After now -]]
[[- $end = now -]]
[[- end -]]
[[- end -]]
Expand All @@ -53,7 +53,7 @@ request.transforms:
[[- $end = .Add $hour -]]
[[- end -]]
[[- with $end -]]
[[- if .Before now -]]
[[- if .After now -]]
[[- $end = now -]]
[[- end -]]
[[- end -]]
Expand All @@ -76,7 +76,7 @@ response.pagination:
[[- $end = .Add $hour -]]
[[- end -]]
[[- with $end -]]
[[- if .Before now -]]
[[- if .After now -]]
[[- $end = now -]]
[[- end -]]
[[- end -]]
Expand Down
2 changes: 1 addition & 1 deletion packages/proofpoint_tap/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
format_version: "3.0.3"
name: proofpoint_tap
title: Proofpoint TAP
version: "1.24.2"
version: "1.24.3"
description: Collect logs from Proofpoint TAP with Elastic Agent.
type: integration
categories:
Expand Down

0 comments on commit 9aca512

Please sign in to comment.