Repository navigation
Record every day of an event batch in IOC.days_seen. Closes #1814 - #1840
regulartim merged 1 commit into
Conversation
…r-Project#1814 iocs_from_hits now collects the distinct days of all hit timestamps and _merge_iocs merges them into the stored days_seen. Before, only the date of the latest event was recorded, so batches that span several days (or late uploads) lost days.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
Hi @regulartim . Missed the AI Policy note before raising this PR so it has llm usage. Will keep it in mind from next time. |
|
Hey @Akshats-git !
That's fair, I appreciate your honesty! :) |
regulartim
left a comment
There was a problem hiding this comment.
Nice and correct fix, thanks for your work! :) I'll merge once CI is green.
Description
An Event Collector batch can cover several days, but only the date of the latest event was added to
IOC.days_seen. The other days were lost.This PR fixes that in two places:
iocs_from_hitsnow puts the distinct days of all hit timestamps on the new IOC.IocProcessor._merge_iocsmerges those days into the storeddays_seen(sorted, no duplicates)._update_days_seenstays as the last step. This also covers late uploads, where older events arrive after newer ones. T-Pot is not affected: its windows never span two days, so it still records one day.No migration is needed.
Related issues
Closes #1814
AI disclosure
Used Claude to help with the code and the tests. I reviewed all of it and ran the full test suite myself.
Type of change
Checklist
Formalities
<feature name>. Closes #999develop.develop.Docs and tests
min_days_seenfilter, which does not change.)Ruff) gave 0 errors. If you have correctly installed pre-commit, it does these checks and adjustments on your behalf.GUI changes
Not applicable, no GUI changes.