Skip to content

Commit 596fe16

Browse files
authored
[Akamai] - Added initial interval restrictions for api requests (elastic#15649)
Added initial interval restrictions for api requests and updated the default interval value, documentation accordingly.
1 parent 678ed33 commit 596fe16

File tree

5 files changed

+23
-6
lines changed

5 files changed

+23
-6
lines changed

packages/akamai/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.28.1"
3+
changes:
4+
- description: Fixed time duration handling in request parameters to conform to API guidelines.
5+
type: bugfix
6+
link: https://github.com/elastic/integrations/pull/15649
27
- version: "2.28.0"
38
changes:
49
- description: Update Kibana constraint to support 9.0.0.

packages/akamai/data_stream/siem/_dev/test/system/test-emulator-config.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ service: akamai-siem-emulator
33
vars: ~
44
data_stream:
55
vars:
6+
# initial_interval should get automatically capped to 12h by the agent logic.
7+
initial_interval: 24h
68
preserve_original_event: true
79
api_host: "http://akamai-siem-emulator:9903"
810
client_token: ct-f625f0b8-9c8f-44ce-8250-eaf17bc93051
@@ -12,5 +14,8 @@ data_stream:
1214
event_limit: 20
1315
enable_request_tracer: true
1416
assert:
15-
# 24 hours at 5 minutes between events.
16-
hit_count: 288 # = 24 * 60/5
17+
# 12 hours at 5 minutes between events.
18+
hit_count: 144 # = 12 * 60/5
19+
skip:
20+
reason: "The fleet health status changes to degraded when the HTTPJSON template's value evaluation comes up empty, which leads to system test failures but does not interrupt the data flow."
21+
link: https://github.com/elastic/beats/issues/45664

packages/akamai/data_stream/siem/agent/stream/httpjson.yml.hbs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,15 @@ request.tracer.maxbackups: 5
1818
request.transforms:
1919
- set:
2020
target: url.params.from
21+
# On the initial request (no cursor), this calculates the start time.
22+
# It takes the more recent of two values: the user-defined 'initial_interval'
23+
# or the API's maximum 12-hour look-back, preventing API errors.
2124
value: >-
22-
[[ if not (index .cursor "last_offset") ]][[ (now (parseDuration "-{{initial_interval}}")).Unix ]][[ end ]]
25+
[[- if not (index .cursor "last_offset") -]]
26+
[[- $initialTime := (now (parseDuration "-{{initial_interval}}")).Unix -]]
27+
[[- $maxLookbackTime := (now (parseDuration "-12h")).Unix -]]
28+
[[- max $maxLookbackTime $initialTime -]]
29+
[[- end -]]
2330
- set:
2431
target: url.params.to
2532
value: >-

packages/akamai/data_stream/siem/manifest.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ streams:
6767
multi: false
6868
required: true
6969
show_user: true
70-
default: 24h
71-
description: Initial interval to poll for events. Default is 24 hours. Supported units for this parameter are h/m/s.
70+
default: 12h
71+
description: Initial interval to poll for events. Default is the maximum allowed value of 12 hours. Supported units for this parameter are h/m/s.
7272
- name: event_limit
7373
type: integer
7474
multi: false

packages/akamai/manifest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: akamai
22
title: Akamai
3-
version: "2.28.0"
3+
version: "2.28.1"
44
description: Collect logs from Akamai with Elastic Agent.
55
type: integration
66
format_version: "3.0.2"

0 commit comments

Comments
 (0)