[Trendmicro Vision One] - Fixed cursor & pagination logic for "detections" data stream - #12916
Conversation
|
TODO - test this with a live account |
🚀 Benchmarks reportTo see the full report comment with |
|
Pinging @elastic/security-service-integrations (Team:Security-Service Integrations) |
efd6
left a comment
There was a problem hiding this comment.
This seems reasonable, but needs some commentary clean ups.
| # If last pagination cycle was finished successfully | ||
| # we move the startDate pointer forward | ||
| # else we reprocess the last interval from the beginning. | ||
| # If none of the values are in the cursor it means is a fresh start |
There was a problem hiding this comment.
| # If none of the values are in the cursor it means is a fresh start | |
| # If none of the values are in the cursor it means it is a fresh start |
| - set: | ||
| target: url.params.startDateTime | ||
| value: '[[formatDate ((parseDate .cursor.last_update_at).Add (parseDuration "-{{additional_look_back}}"))]]' | ||
| # If last pagination cycle was finished successfully |
There was a problem hiding this comment.
| # If last pagination cycle was finished successfully | |
| # If the last pagination cycle was completed successfully |
| value: '[[formatDate ((parseDate .cursor.last_update_at).Add (parseDuration "-{{additional_look_back}}"))]]' | ||
| # If last pagination cycle was finished successfully | ||
| # we move the startDate pointer forward | ||
| # else we reprocess the last interval from the beginning. |
There was a problem hiding this comment.
| # else we reprocess the last interval from the beginning. | |
| # otherwise we reprocess the last interval from the beginning. |
| # and we pick the default value. | ||
| value: >- | ||
| [[- if eq .cursor.pagination_finished "true" -]] | ||
| # look-back time should only be applied for fresh pagination intervals |
There was a problem hiding this comment.
If you want to include comments in the Go template, you will need to use the template comment syntax.
| # look-back time should only be applied for fresh pagination intervals | |
| [[- /* look-back time should only be applied for fresh pagination intervals */ -]] |
What is the precise definition of "fresh" here? I can see two possible interpretations; one matches the behaviour here (not started but after one that has completed), the other doesn't (never started). The immediately obvious interpretation is the second one, so I think this needs to be clearer.
There was a problem hiding this comment.
By fresh pagination cycle I meant a completely new pagination cycle that occurs on every new interval not between pages during a particular interval, I'll make it a bit clearer
|
@efd6, addressed all the comments |
| # newer versions go on top | ||
| - version: "1.25.2" | ||
| changes: | ||
| - description: Added pagination and cursor fix to mirror the logic for a similar google_workspace scenario in pull - https://github.com/elastic/beats/pull/34274. |
There was a problem hiding this comment.
| - description: Added pagination and cursor fix to mirror the logic for a similar google_workspace scenario in pull - https://github.com/elastic/beats/pull/34274. | |
| - description: Fixed pagination and cursor handling. |
(users who want to know about pull requests will know how to find them, presenting them to other people is not really helpful, so instead of putting it here, put it in the commit message or just rely on the discussion in this PR — sorry, I missed this on the first round)
|
cc: @narph @jamiehynds, planning on merging this soon but just as a fyi, this will be a breaking change for the detection data stream as the existing state will be lost due to a complete overhaul of the cursor logic. Should we give any other warnings for our customers before merging ? |
@ShourieG lets not merge this till we discuss the impact on our users/customers |
|
@ShourieG what's the actual user impact? They upgrade the integration, we lose the state and they end up re-ingesting detections? Any ideas as to timeframe - will the last day, week, month worth of detections be re-ingested after upgrading the integration? If we don't implement this, we run the risk of incorrectly dropping data? |
|
@jamiehynds, So if we implement this, the detections data stream will lose all existing state, the reingestion process will depend on the customers configuration as to how far they want to look back. If the customer does not change any configs and let things stay the way they are, the ingestion would start with the default startDateTime value which is calculated on the basis of (now - initial_interval) where initial_interval is user configured. If we don't implement this, we would end up in a similar state with what happened with google_workspace a couple of years back when the integration was dropping quite a bit of data due to how the api returned the responses. Basically we would get users complaining of data inconsistency which can vary from a small amount to quite large amounts on a case by case basis. |
|
@ShourieG while not ideal, I think implementing this change now is the less of two evils. Most users will likely prefer to deal with some reingestion than run the risk of dropping data due to current cursor logic. Plus, our default is 24h initial interval, and it's 'just' detections, so don't expect it do be a vast amount of data. We just need to make it clear in the changelog description that there's a breaking change included in this update and be clear on the impact (reingestion) |
💚 Build Succeeded
History
cc @ShourieG |
|
|
Package trend_micro_vision_one - 2.0.0 containing this change is available at https://epr.elastic.co/package/trend_micro_vision_one/2.0.0/ |
…logic for "detections" data stream (#12916) * added pagination and cursor fix to mirror the logic for a similar scenario in pull #34274 * updated changelog & manifest * updated changelog * updated look back calculation logic * updated comments * addressed Dan's suggestions * updated changelog * updated changelog with appropriate breaking-change type * Update changelog with breaking change details
…logic for "detections" data stream (#12916) * added pagination and cursor fix to mirror the logic for a similar scenario in pull #34274 * updated changelog & manifest * updated changelog * updated look back calculation logic * updated comments * addressed Dan's suggestions * updated changelog * updated changelog with appropriate breaking-change type * Update changelog with breaking change details
…logic for "detections" data stream (#12916) * added pagination and cursor fix to mirror the logic for a similar scenario in pull #34274 * updated changelog & manifest * updated changelog * updated look back calculation logic * updated comments * addressed Dan's suggestions * updated changelog * updated changelog with appropriate breaking-change type * Update changelog with breaking change details
…logic for "detections" data stream (#12916) * added pagination and cursor fix to mirror the logic for a similar scenario in pull #34274 * updated changelog & manifest * updated changelog * updated look back calculation logic * updated comments * addressed Dan's suggestions * updated changelog * updated changelog with appropriate breaking-change type * Update changelog with breaking change details




Type of change
Proposed commit message
Fixed cursor & pagination logic for "detections" data stream to mirror a similar logic in implemented for a google_workspace fix.
Please refer to this issue to see the details.
NOTE
This will be a breaking change for the detections data stream as cursor values are completely changed, so existing state will get affected.
Checklist
changelog.ymlfile.Author's Checklist
How to test this PR locally
Related issues
Screenshots