[integrations][trend_micro_vision_one] - Add configurable "additional look-back" time option to all data streams - #12382
Conversation
|
Pinging @elastic/security-service-integrations (Team:Security-Service Integrations) |
🚀 Benchmarks reportTo see the full report comment with |
chrisberkhout
left a comment
There was a problem hiding this comment.
For all endpoints:
I think for getting non-initial pages we should just use the nextLink and not add other parameters. This should avoid gaps.
The last page in a sequence will have an empty or partial page. If it doesn't return a nextLink value, we can reuse the current value after the interval. If there is some problem with that, we can use the most recent updatedDateTime seen in results.
We probably never need to set endDateTime. Or, if it's required by the API, it could be set to 1 minute before the current time, which may also help avoiding gaps.
It's not changed here, but I think it's a bug that we set orderBy=updatedDateTime asc and dateTimeTarget=createdDateTime. I think the server will do something like:
SELECT *
FROM data AS d
WHERE d.createdDateTime > '2024-01-01'
ORDER BY d.updatedDateTime ASCThis will not include items updated after our cursor time and may result in choosing the wrong cursor time in following requests.
@chrisberkhout We are already using next link for pagination, but it seems that sometimes the events come in late at the source end when the next page is called with a start/end time, and our pagination does not pick up those events within that time window. |
Currently when we use a Setting |
@chrisberkhout, If you look at the detections agent code, we are only using startDateTime on the initial request, then for all successive paginations we use the nextLink until pagination ends. This pagination link completely overrides the current url value to what was sent from the source, so highly unlikely this would be faulty. It is only in the successive interval when we use the value of endDateTime for the next start duration, and it seems to be the case that there's delay in populating the data at the source and because of this the pagination ends before all the data is actually fetched for that interval, so when the next one begins we are left with a gap in between these 2 intervals. This change was to address that gap, since we cant use a nextLink for the beginning of the 1st request in an interval. |
Sorry, I had this backwards. We do still set
That's right. I thought we would still get So that's fine.
Re-using the last The existing logic asks: what's new since my last request? We want to close the gap, but with a lookback we generate more duplicates than necessary. Why not just ask to continue from where we left off? In the |
|
@chrisberkhout, So there seems to be some api limitations here:
So the suggestion -
would only work if the data is sorted or if we migrate to CEL and sort by |
|
Hi, I also reported this problem and found that:
|
|
Thanks for the observations @cmarlettalivi! We do have some logic in the ingest pipeline to set an Hey @ShourieG, that's a really good point about the order for detections. I don't want to hold this up, so I'll share my final thoughts and if anything is unclear we can discuss, but otherwise feel free to go ahead with what you think is best. It sounds like detections may in fact be ordered by event time. We do have
Since we know we're missing data, I think the new default settings should avoid that. Setting a |
chrisberkhout
left a comment
There was a problem hiding this comment.
Happy to discuss further if helpful
Hi @cmarlettalivi, just wanted some more clarification on your 1st statement. You said that "The events returned by the API are sorted in decreasing order of time". That would mean that the latest event would be the 1st one in every request right ? Cause generally events are sorted in ascending order, so just confirming that this is indeed the case. |
|
@ShourieG |
|
Hi @chrisberkhout , |
|
@chrisberkhout, @cmarlettalivi, I'm closing this PR, new PR with the relevant changes are up: #12425 |
|
NOTE: The timestamp update did not completely solve the missing documents issue, it did reduce but still some are missing and trend micro confirmed that events are populated with a delay sometimes, to address this I'm reopening this PR and giving the customer the option to tweak a custom look-back period. |
💚 Build Succeeded
History
cc @ShourieG |
|
|
Package trend_micro_vision_one - 1.25.0 containing this change is available at https://epr.elastic.co/package/trend_micro_vision_one/1.25.0/ |
… look-back" time option to all data streams (#12382)
… look-back" time option to all data streams (elastic#12382)




Type of change
Proposed commit message
There was a scenario where users observed gaps in ingested data and on further investigation it was found that events fetched were skewed at beginning of the time interval which lead to the conclusion that the source api had some delay in populating the events in the response. With the introduction of this new additional look-back, users can configure it to a value that suits their scenario and avoid gaps in data. By default this is set to '0s' for the traditional behaviour.
NOTE:
Even though the issue was reported for the "detections" data stream, this PR adds this to all the data streams as a safety net to avoid future issues which might be similar, since we cannot say for sure that this issue won't occur for the rest.
Checklist
changelog.ymlfile.Author's Checklist
How to test this PR locally
Related issues
Screenshots