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

[Elastic Agent] Logs from Elastic-Agent and sub process do not have all fields mapped correctly #6545

Open
2 tasks
belimawr opened this issue Jun 9, 2023 · 9 comments
Labels
bug Something isn't working, use only for issues Integration:elastic_agent Elastic Agent Team:Elastic-Agent Label for the Agent team

Comments

@belimawr
Copy link
Contributor

belimawr commented Jun 9, 2023

Steps to Reproduce:

  1. Create a Cloud 8.8.1 deployment

  2. Create a policy with: monitoring enabled, system integration and Custom Logs

  3. Deploy Elastic-Agent

  4. Go to Kibana, expand some of the log entries from Elastic-Agent

  5. log.source and component.dataset do not have any mapping

    Screenshot

    elastic-agent-01

Tasks

Preview Give feedback
  1. Team:Elastic-Agent bug
@belimawr belimawr added bug Something isn't working, use only for issues Team:Elastic-Agent Label for the Agent team labels Jun 9, 2023
@cmacknz cmacknz transferred this issue from elastic/elastic-agent Jun 12, 2023
@cmacknz cmacknz changed the title Logs from Elastic-Agent and sub process do not have all fields mapped correctly [Elastic Agent] Logs from Elastic-Agent and sub process do not have all fields mapped correctly Jun 12, 2023
@cmacknz
Copy link
Member

cmacknz commented Jun 12, 2023

This can be fixed in the elastic_agent integration, we map a subset of the component fields today. Likely this was just forgotten because the agent itself is in a separate repository from this integration.

- name: component
type: group
description: Agent component that the log message is about, only available on Elastic Agent 8.6.0+
fields:
- name: id
type: wildcard
ignore_above: 1024
description: Component id
- name: type
type: keyword
ignore_above: 1024
description: The type of the component
- name: binary
type: keyword
ignore_above: 1024
description: The binary that exeuctes the component
example: filebeat
- name: state
type: keyword
ignore_above: 1024
description: Current component health
- name: old_state
type: keyword
ignore_above: 1024
description: Previous component health

@andrewkroh
Copy link
Member

andrewkroh commented Jun 12, 2023

We need to be careful about mapping log.source because there are a bunch of integrations are using log.source.address.

ECS should probably be updated to have a place for the log.source.* data. I mentioned this in elastic/beats#34371 (comment).

@cmacknz
Copy link
Member

cmacknz commented Jun 12, 2023

It might be simpler for agent to rename log.source to log.source.name or something so that log.source can stay an object with an official mapping for log.source.address. Agent doesn't map it and its only been around since 8.6.x.

@cmacknz
Copy link
Member

cmacknz commented Jun 13, 2023

I've created elastic/elastic-agent#2857 and marked it as blocking this issue.

@belimawr
Copy link
Contributor Author

It seems some of the "new" fields introduced in 8.6 are missing mapping in some indexes, which causes some very odd behaviours when filtering data. Here is an example of this odd behaviour: elastic/kibana#159371

And an example of indexes missing mapping for component.id:

GET logs-*/_mapping/field/component.id

# results in the following
{
  ".ds-logs-enterprise_search.api-default-2023.06.14-000001": {
    "mappings": {}
  },
  ".ds-logs-elastic_agent-default-2023.06.14-000001": {
    "mappings": {
      "component.id": {
        "full_name": "component.id",
        "mapping": {
          "id": {
            "type": "wildcard",
            "ignore_above": 1024
          }
        }
      }
    }
  },
  ".ds-logs-enterprise_search.audit-default-2023.06.14-000001": {
    "mappings": {}
  },
  ".ds-logs-elastic_agent.filebeat-default-2023.06.14-000001": {
    "mappings": {}
  },
  ".ds-logs-generic-default-2023.06.14-000001": {
    "mappings": {}
  },
  ".ds-logs-elastic_agent.metricbeat-default-2023.06.14-000001": {
    "mappings": {}
  }
}

@cmacknz
Copy link
Member

cmacknz commented Jun 15, 2023

We can fix all of the component field mappings without waiting for the log.source rename, they are separate problems. We just shouldn't map log.source until we rename it to avoid even more mapping conflicts than we already have.

@belimawr
Copy link
Contributor Author

I added a task list to the main description so we can better keep track of the fields needing mapping.

@botelastic
Copy link

botelastic bot commented Jun 18, 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 Jun 18, 2024
@agmic
Copy link
Contributor

agmic commented Aug 6, 2024

👍

@botelastic botelastic bot removed the Stalled label Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working, use only for issues Integration:elastic_agent Elastic Agent Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

No branches or pull requests

4 participants