Skip to content
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

datastream: add basic OS logging #82

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

jrcastro2
Copy link

@jrcastro2 jrcastro2 commented Feb 18, 2025

@jrcastro2 jrcastro2 force-pushed the add-datastream-logging branch 3 times, most recently from 76b7514 to 38e403e Compare March 4, 2025 10:12
* Introduced `LogManager` to handle structured logging via registered builders.
* Added `SearchBackend` to store logs in a search engine (OpenSearch/Elasticsearch).
* Implemented `LogEvent` for structured log representation.
* Enabled dynamic log builder registration via entry points.
* Integrated Celery task (`log_event_task`) to handle asynchronous log ingestion.
* Ensured template validation in the search engine before indexing logs.
* Configurable log types to support audit, job and others.
* closes CERNDocumentServer/cds-rdm#361

Co-authored-by: Saksham Arora <[email protected]>
@jrcastro2 jrcastro2 force-pushed the add-datastream-logging branch from 38e403e to dd5b5a3 Compare March 4, 2025 10:17
@jrcastro2 jrcastro2 force-pushed the add-datastream-logging branch from aa36d2b to 8f0e0e0 Compare March 4, 2025 15:40
@jrcastro2
Copy link
Author

Add the resource for the logs, to be checked

@@ -35,3 +35,9 @@ def search(cls, query):
"""Search logs."""
results = cls.backend_cls().search(query)
return cls.schema.dump(results, many=True)

@classmethod
def list(cls):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how is list different from search?

@@ -89,7 +89,7 @@ def search(self, query=None, size=10):
"operator": "and",
}
},
"sort": [{"timestamp": {"order": "desc"}}],
"sort": [{"@timestamp": {"order": "desc"}}],
Copy link
Contributor

@kpsherva kpsherva Mar 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this whole method should be in a log dedicated service class
this should probably not be in this module.
could work as a prototype now, but it should be moved in the next iteration to a service - also because we are missing the permissions completely here.
Probably even before finalising the frontend, otherwise you will end up patching a lot of things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Initial prototype for logs-audit
3 participants