-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Move O365audit input to v2 input API #19719
Conversation
Pinging @elastic/integrations (Team:Integrations) |
Pinging @elastic/siem (Team:SIEM) |
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
Tested with my o365 account. Works perfect, resumes execution at the time of the last processed event and correctly skips the already ACKed lines.
Thanks for updating this!
Here's the debug logs for the test. First run, fetch events starting from a week ago, until a blob of events is found (
Second run, Also the previous
|
(cherry picked from commit 03bedd7)
What does this PR do?
Move o365audit input to use the v2 input API.
The change treats the tuple 'tenantID' and 'contentType' as the stream identifier. The cursor input package starts one go-routine per stream, ensuring that no two inputs can collect events for the same stream.
Not yet documented (not sure if we should): the cursor input manager adds a
id
setting to each input it manages. The ID settings can be configured manualy and will become part of the stream ID in the statestore. This allows users to configure 2 inputs collecting from the same streams.(Needs docs): The cursor input manager runs a go-routine in the background deleting old states no input or pending event (to be ACKed by outputs) is active for. Each entry in the store has a TTL. And entry is to be removed if there is no active input, all events for the stream have been acked, and
lastUpdateTimestamp + TTL < now
. The TTL is configured viaclean_timeout
. The defaultclean_timeout
is 30 minutes.The default clean_timeout can be configured by setting 'DefaultCleanTimeout' in the InputManager in the
Plugin
function.When the beat is restarted the cleanup will not delete entries yet. Instead the reference time for old entries is set to 'beatStartTimestamp'. After restart old entries that don't get picked up are deleted after
beatStartTimestamp + TTL < now
.Why is it important?
This enables the input to store the read positions in the statestore between restarts.
Checklist
- [ ] I have commented my code, particularly in hard-to-understand areas- [ ] I have added tests that prove my fix is effective or that my feature worksCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Author's Checklist
How to test this PR locally
@adriansr can you add details about required manual testing please?
Related issues