-
Notifications
You must be signed in to change notification settings - Fork 48
Add support for logging.event_data in beatreceivers
#326
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
Conversation
|
I don't see anything out of place, it's just missing a test for |
logging.event_data in beatreceivers
logp/core.go
Outdated
|
|
||
| // ConfigureEventLoggingOTel takes a list log messages expected to contain sensitive data | ||
| // and ensures they are logged using typed logger | ||
| func ConfigureEventLoggingOTel(typedMsg []string, core zapcore.Core) (*Logger, error) { |
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.
typedMsg is a log message snippet that we expect to contain sensitive information
typedMsg should be passed as failed to index document; input may contain sensitive data to log failed docs from ES exporter to -event.log file.
[Ref] https://github.com/open-telemetry/opentelemetry-collector-contrib//blob/main/exporter/elasticsearchexporter/bulkindexer.go#L384
|
@khushijain21 Could you please explain why a logger package in a library should concern itself with Otel or event logging filtering ? Those are concepts that are specific to the related applications (elastic-agent in this case) so I feel that we are giving the library additional responsibilities that do not belong in a generic logging package |
|
@pchila We are only extending that functionality to include certain "log message snippets". If these log message exists - we log them using The |
💚 Build Succeeded
History
|
| defaultCore: core, | ||
| typedCore: core, |
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.
Wouldn't this print all the messages for this logger to core? defaultCore and typedCore are same.
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.
Think of this as a core on top of an existing typeLoggerCore. The core passed to this method takes care of re-routing the logs correctly. All this does is add additional fields if a message exists.
The assumption of this method is that the output is already defined. The description also explains that
What does this PR do?
This PR adds support for
logging.event_datafor beatreceivers running from EA. The idea is that all documents containing sensitive information should be logged to separate-event.logfile.Beats' adds a field called
log.type:eventto log messages containing sensitive information Ref andtypedLoggerCore looks for the presence of this key-value pair. If exists, it logs to
-event.logfile.Documents rejected by ES-exporter also fall in this category. We add a new field called
messageontypedLogger. If a log entry contains this message, it is "also" logged usingtypedLogger.Why is it important?
Checklist
Related issues