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

Don't override user-supplied data_stream fields #24683

Closed
felixbarny opened this issue Mar 22, 2021 · 9 comments
Closed

Don't override user-supplied data_stream fields #24683

felixbarny opened this issue Mar 22, 2021 · 9 comments
Labels
7.14 Candidate bug Stalled Team:Elastic-Agent Label for the Agent team Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

Comments

@felixbarny
Copy link
Member

felixbarny commented Mar 22, 2021

While adding support for data_stream.dataset and data_stream.namespace fields for ECS loggers (elastic/ecs-logging#38). I noticed that Filebeat overrides the fields with the static value from the integration policy rather than using the fields from the log events. That happens even though the input setting json.override_keys is set to true.

I do think we'd want users to define the dataset in their ECS logging configuration for several reasons:

  • We don't want users having to create a dedicated log configuration per application. Ideally, they'd be able to set up the logging for all their applications with just one integration. For example, by providing several log file paths pointing to ECS log files of different applications.
  • We already make event.dataset configurable which is used for the log anomaly ML job. Couldn't we use that to set the data_stream.dataset? No, we can't: The event.dataset and data_stream.dataset fields should always have the same values. However, the data_stream.dataset imposes more restrictions on the allowed characters (as it ends up as a part of the index name). Thus, we can't use the values of event.dataset for data_stream.dataset.
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Mar 22, 2021
@ruflin ruflin added the Team:Elastic-Agent Label for the Agent team label Mar 23, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/agent (Team:Agent)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Mar 23, 2021
@ph
Copy link
Contributor

ph commented Mar 23, 2021

this is a good catch, I think we all the add_fields processor but we don't have any conditional to check if the values is present do nothing.

@botelastic
Copy link

botelastic bot commented Apr 30, 2022

Hi!
We just realized that we haven't looked into this issue in a while. We're sorry!

We're labeling this issue as Stale to make it hit our filters and make sure we get back to it as soon as possible. In the meantime, it'd be extremely helpful if you could take a look at it as well and confirm its relevance. A simple comment with a nice emoji will be enough :+1.
Thank you for your contribution!

@botelastic botelastic bot added the Stalled label Apr 30, 2022
@ruflin ruflin added the Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team label May 2, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@botelastic botelastic bot removed the Stalled label May 2, 2022
@botelastic
Copy link

botelastic bot commented May 2, 2023

Hi!
We just realized that we haven't looked into this issue in a while. We're sorry!

We're labeling this issue as Stale to make it hit our filters and make sure we get back to it as soon as possible. In the meantime, it'd be extremely helpful if you could take a look at it as well and confirm its relevance. A simple comment with a nice emoji will be enough :+1.
Thank you for your contribution!

@botelastic botelastic bot added the Stalled label May 2, 2023
@felixbarny
Copy link
Member Author

@botelastic botelastic bot removed the Stalled label May 3, 2023
@ruflin
Copy link
Member

ruflin commented May 3, 2023

It doesn't directly, but it can solve it. The problem today is that an add_field processor is used to set this field. Having it configured as a config option by Elastic Agent for Beats would mean the field would not be set directly and then in the output it can only be set, if it doesn't already exist.

We could take this to the next level that Filebeat already sends the data based on the field to the correct data stream? All the features for this already exist in Filebeat, see index settings here: https://www.elastic.co/guide/en/beats/filebeat/current/elasticsearch-output.html#index-option-es

@felixbarny
Copy link
Member Author

in the output it can only be set, if it doesn't already exist.
sends the data based on the field to the correct data stream

++ to both of these statements

@botelastic
Copy link

botelastic bot commented May 2, 2024

Hi!
We just realized that we haven't looked into this issue in a while. We're sorry!

We're labeling this issue as Stale to make it hit our filters and make sure we get back to it as soon as possible. In the meantime, it'd be extremely helpful if you could take a look at it as well and confirm its relevance. A simple comment with a nice emoji will be enough :+1.
Thank you for your contribution!

@botelastic botelastic bot added the Stalled label May 2, 2024
@botelastic botelastic bot closed this as completed Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
7.14 Candidate bug Stalled Team:Elastic-Agent Label for the Agent team Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

No branches or pull requests

4 participants