-
Notifications
You must be signed in to change notification settings - Fork 24.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
Write deprecation logs to a data stream #61484
Write deprecation logs to a data stream #61484
Conversation
Pinging @elastic/es-core-infra (:Core/Infra/Logging) |
9125b65
to
126f0ca
Compare
.../src/main/java/org/elasticsearch/xpack/deprecation/logging/DeprecationIndexingComponent.java
Outdated
Show resolved
Hide resolved
@elasticmachine run elasticsearch-ci/packaging-sample-windows |
.../src/main/java/org/elasticsearch/xpack/deprecation/logging/DeprecationIndexingComponent.java
Show resolved
Hide resolved
...n/src/main/java/org/elasticsearch/xpack/deprecation/logging/DeprecationIndexingAppender.java
Show resolved
Hide resolved
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.
looking good. a couple of comments and a PR to this PR pugnascotia#3 (to ensure using the latest testing plugins)
update gradle config for new testing plugins
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.
tested locally and worked great! LGTM
.field("data_stream.type", "logs") | ||
.field("data_stream.datatype", "deprecation") | ||
.field("data_stream.namespace", "elasticsearch") | ||
.field("ecs.version", ECS_VERSION) |
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.
@jakelandis how do these look to you?
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
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,
we would need to update beats test samples (with new fields). I can help with this.
Backport of elastic#61484. Closes elastic#46106. Implement a new log4j appender for deprecation logging, in order to write logs to a dedicated data stream. This is controlled by a new setting, `cluster.deprecation_indexing.enabled`.
return new ESLogMessage(messagePattern, args) | ||
.field("data_stream.type", "logs") | ||
.field("data_stream.datatype", "deprecation") |
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.
@pugnascotia This should be data_stream.dataset
to be aligned with the indexing strategy.
I would also propose to keep the namespace as default
and use deprecation.elasticsearch
as the dataset name. Only important thing is that the dataset does not contain a -
.
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.
@ruflin so would we have the following, then?
.field("data_stream.dataset", "default")
.field("data_stream.namespace", "deprecation.elasticsearch")
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.
No, the other way around:
.field("data_stream.dataset", "deprecation.elasticsearch")
.field("data_stream.namespace", "default")
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.
Thanks, I'll get that changed 👍
Closes #46106. Implement a new log4j appender for deprecation logging, in order to write logs to a dedicated data stream. This is controlled by a new setting,
cluster.deprecation_indexing.enabled
.Depends on #61474.
Test by running
./gradlew run
and then: