-
Notifications
You must be signed in to change notification settings - Fork 522
[Akamai] Use 'offset' value as cursor #5827
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Akamai] Use 'offset' value as cursor #5827
Conversation
The Akamai SIEM API returns an 'offset' value that encodes the storage time of the last returned event. Use offset as the cursor value when making API requests. This assumes that the API response always includes an offset. And that the response has total == 0 when there is no more data available. The version is marked as beta because it has not been tested against the real Akamai service. Relates: #5826
|
Pinging @elastic/security-external-integrations (Team:Security-External Integrations) |
🌐 Coverage report
|
| categories: [security, cdn_security] | ||
| conditions: | ||
| kibana.version: "^8.5.0" | ||
| kibana.version: "^8.4.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dropped this back down to allow users on 8.4.0 to test this. The http request tracer feature requires 8.5.0, so it won't take effect if you enable it under 8.4.0 (the config option is ignored by the older input).
| value: "[[.cursor.last_execution_datetime]]" | ||
| default: '[[ (now (parseDuration "-{{initial_interval}}")).Unix ]]' | ||
| value: >- | ||
| [[ if not (index .cursor "last_offset") ]][[ (now (parseDuration "-24h")).Unix ]][[ end ]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see we are removing default: '[[ (now (parseDuration "-{{initial_interval}}")).Unix ]]', which makes this field in the manifest remain unused. Would we want to provide a condition such that if {{initial_interval}} is not specified then use [[ if not (index .cursor "last_offset") ]][[ (now (parseDuration "-24h")).Unix ]][[ end ]] otherwise use [[ (now (parseDuration "-{{initial_interval}}")).Unix ]] ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant to keep the {{initial_interval}}. I will put that back.
I was developing in Filebeat so I needed to get rid of the variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take another look.
|
@andrewkroh Only one query here otherwise looks LGTM, similar to what I was thinking . |
ShourieG
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Package akamai - 2.6.1-beta containing this change is available at https://epr.elastic.co/search?package=akamai |
|
My customer did not have the ability to flip a toggle for beta integrations (version 8.4.3). I was able to install it via running this in Kibana > Dev tools, just passing along (not sure if force is needed) |
What does this PR do?
The Akamai SIEM API returns an 'offset' value that encodes the storage time of the last returned event. Use offset as the cursor value when making API requests.
This assumes that the API response always includes an offset. And that the response has total == 0 when there is no more data available.
The version is marked as beta because it has not been tested against the real Akamai service.
Relates: #5826
Checklist
changelog.ymlfile.Related issues
Screenshots
This is a beta release. So users will need to select the version explicitly to test it.
Logs / Testing
These are the raw request / responses from testing with the mock API.
This was the contents of the Filebeat registry at the end of the test. You can see that
offset2is persisted.