[prisma_cloud] Update the Cursor in the Data Collection of Alert and Audit Data Stream and HTTP Timeout Default Values #8580
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Type of change
What does this PR do?
1. Change the default value of HTTP Client Timeout from 30s to 60s
For the larger dataset, Prisma API is taking a longer wait time to send the response that is greater than
30shence update the default value of timeout to60sfor all the data streams.2. Update the Cursor Logic of the Alert and Audit Data Stream
There was a bug in the cursor implementation, earlier it was storing the value
(now - lastUpdated.max)which resulted in the wrong subsequent requests call. Hence updated the cursor implementation tonow() - cursorat the time of request call.Also, use
getMinutes()instead ofgetHours()to get a more precise time as the Prisma API filter supports the minimum time unit as a minute.3. Add fingerprint to the Audit Data Stream.
As the
getMinutes()returns the floor value results in some data dropping hence added+1explicity to the requests and added fingerprint to remove the duplicated values due to adding the extra minutes.The fields added in the fingerprint suggested here
4. Minor Bugfix in Alert Pipeline
Due to a typing mistake, the wrong field was used in the alert pipeline fingerprint processors hence corrected that. Changed it from
json._idtojson.id.Checklist
changelog.ymlfile.All changes
How to test this PR locally
Clone integrations repo.
Install the elastic package locally.
Start the elastic stack using the elastic package.
Move to integrations/packages/prisma_cloud directory.
Run the following command to run tests.
elastic-package test -vRelated issues
Automated Test
prisma_test_file.txt