Closed flotpg closed 2 years ago
I'll try to reproduce this with your settings. I suspect it has to do with the Resume setting, which I personally don't use in production. The reason is that I don't mind runs overlapping, because the 'skipKnownLogs' setting should prevent duplicates; so when runs overlap you can pick up anything that for whatever reason wasn't available before (maybe Microsoft was slow in updates the logs for example).
Unless you have a specific reason to use resume, could you try running with 'resume: False'? In the meantime I will see if there's a bug with it and try to fix it if so.
Awesome, that works perfectly. I didn't set resume:True intentionally. I just copied ConfigExamples/fullConfig.yaml ;) Thanks a lot and have a great day.
No worries. I can see that Resume is working as intended. The problem is that the intention was wrong in the first place.
Resume retrieves everything until the current time initially using hoursToCollect (e.g. last 24 hours) and sets the last run time to the current time. Let's say the current time is 10:00 AM. In my test I decided to run every 5 minutes. Between 10:00AM and 10:05AM logs are generated (users are doing things), but Microsoft has probably not published all the logs yet since they're not instantly available, so 0 logs are retrieved. The last run time is saved to 10:05, so all the logs between 10:00 and 10:05 are skipped permanently. This repeats over and over again, never retrieving anything.
Could you let me know if your CRON schedule was relatively short, at least shorter than multiple hours? That would confirm my suspicion.
The resume parameter may work but only if it's not scheduled too often. I'm going to think about removing this parameter, perhaps the intention behind it was misguided. I'm definitely going to disable it as a default parameter.
Thanks for creating the issue and letting me know.
My cron job runs every 15 minutes. Thanks for the detailed explanation!
This was the answere where I was looking for a long time.
Dear @ddbnl
I noticed that since the initial collection run, I don't get any new logs.
My settings:
last_run_times
{"Audit.General": "2022-05-03T07:39:11Z", "Audit.AzureActiveDirectory": "2022-05-03T07:39:11Z", "Audit.Exchange": "2022-05-03T07:39:11Z", "Audit.SharePoint": "2022-05-03T07:39:11Z", "DLP.All": "2022-05-03T07:39:11Z"}%
known_content is empty... normal?
known_logs has content but not up2date (nothing from today or yesterday for example)
Any hints how to debug this?
First thing I will try is backup known_* & last_run_times files, remove them and run again.
Finished. Total logs retrieved: 15074. Total logs with errors: 0. Run time: 0:00:14.717247. GraylogInterface reports: 15074 successfully sent, 0 errors
This works and I get new logs.