Skip to content

Commit 1289a1d

Browse files
committed
proofpoint_on_demand: add sinceTime cursor to message stream
Track the ts timestamp from each message event and pass it as the sinceTime query parameter on WebSocket reconnection. This allows the agent to resume from its last position rather than relying on the API's default replay behaviour, which only covers the most recent hour of data [1]. The ts values have microsecond resolution while the API documentation specifies millisecond resolution for sinceTime. We pass the microsecond value through unchanged because at least one other integration (logrhythm-proofpoint-on-demand [2]) does the same successfully. Only the message data stream is changed here. The mail and audit streams use the same API endpoint and likely support sinceTime too, but there is no direct evidence confirming that events are delivered in ascending ts order for those stream types. [1] https://docs.cyderes.cloud/files/proofpoint-on-demand-log-api-rev-c.pdf [2] https://github.com/jpsutton/logrhythm-proofpoint-on-demand
1 parent 9d43ae1 commit 1289a1d

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

packages/proofpoint_on_demand/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.9.0"
3+
changes:
4+
- description: Use sinceTime cursor for message data stream to resume from last position on reconnection.
5+
type: enhancement
6+
link: https://github.com/elastic/integrations/pull/17508
27
- version: "1.8.1"
38
changes:
49
- description: Remove duplicate security-solution-default tag references

packages/proofpoint_on_demand/data_stream/message/agent/stream/websocket.yml.hbs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
url: {{url}}/v1/stream?cid={{cluster_id}}&type=message
2+
url_program: |
3+
has(state.?cursor.last_timestamp) ?
4+
state.url+"&sinceTime="+state.cursor.last_timestamp
5+
:
6+
state.url
27
auth.bearer_token: {{access_token}}
38
redact:
49
fields: ~
510
program: |
611
bytes(state.response).decode_json().as(body,{
12+
"cursor": {
13+
"last_timestamp": body.ts,
14+
},
715
"events": {
816
"message": body.encode_json(),
917
}

packages/proofpoint_on_demand/manifest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
format_version: 3.1.4
22
name: proofpoint_on_demand
33
title: Proofpoint On Demand
4-
version: "1.8.1"
4+
version: "1.9.0"
55
description: Collect logs from Proofpoint On Demand with Elastic Agent.
66
type: integration
77
categories:

0 commit comments

Comments
 (0)