Skip to content

[elastic_agent]: hard-coded default namespace in several packaged rules #17311

Closed

Description

@JohnLyman

Integration Name

Elastic Agent [elastic_agent]

Dataset Name

alerting rule templates

Integration Version

2.7.0

Agent Version

9.2.4

Agent Output Type

logstash

Elasticsearch Version

9.2.4

OS Version and Architecture

amazon linux 2

Software/API Version

No response

Error Message

rule execution failure: .es-query:fleet-default-elastic_agent-elastic-agent-output-errors: '[Elastic Agent] Output errors' - verification_exception Root causes: verification_exception: Found 1 problem line 1:1: Unknown index [metrics-elastic_agent.*beat-default]

Event Original

No response

What did you do?

Nothing was changed by me with the packaged rules. I'm using them as-is.

What did you see?

Several packaged rules have the namespace hard-coded to default, which (I think) is causing the error posted above.

Pipelines with hard-coded namespace:

What did you expect to see?

The packaged rules should not assume that the namespace is default. Worse yet, I tried to change the namespace in my integration policy to default so the rules would "just work", but the elastic_agent integration doesn't seem to honor this and always uses the namespace of the parent agent policy.

Anything else?

No response

Activity

  1. changed the title [-][Integration Name]: Brief description of the issue[/-] [+][elastic_agent]: hard-coded `default` namespace in several packaged rules[/+] on Feb 9, 2026
  2. JohnLyman commented on Feb 9, 2026

    @JohnLyman
    Author

    This bug is even worse for users that are using both the default namespace and other custom namespaces because they will have incomplete coverage for the rules. For example, they could have one agent in the default namespace with no output errors, but many other agents using a custom namespace that are having output errors. They would never get alerted on the agents using a custom namespace and assume all agents are OK.

  3. elasticmachine commented on Feb 9, 2026

    @elasticmachine

    Pinging @elastic/elastic-agent (Team:Elastic-Agent)

  4. pierrehilbert commented on Feb 10, 2026

    @pierrehilbert
    Contributor

    @MichelLosier Could you please take a look here?

  5. MichelLosier commented on Feb 11, 2026

    @MichelLosier
    Contributor

    Thanks for reporting this, the hardcoding of -default namespace in those queries is a mistake. I'll try and incorporate that fix in the following PR I have open #17237

    Worse yet, I tried to change the namespace in my integration policy to default so the rules would "just work", but the elastic_agent integration doesn't seem to honor this and always uses the namespace of the parent agent policy.

    That looks to be unexpected, and as I understand the integration policy should only inherit namespace from the agent policy if its undefined on the package policy. I'll look into trying to reproduce this

  6. JohnLyman commented on Feb 12, 2026

    @JohnLyman
    Author

    That looks to be unexpected, and as I understand the integration policy should only inherit namespace from the agent policy if its undefined on the package policy. I'll look into trying to reproduce this

    That was my understanding as well. I set the package policy to use default, but it always seemed to use the default namespace from the agent policy.

    I was thinking maybe there is some special handling for the elastic agent integration because of this messaging when you create an agent policy:
    Image

    I'll be interested to see if you can reproduce it.

  7. MichelLosier commented on Feb 13, 2026

    @MichelLosier
    Contributor

    Hi @JohnLyman I was able to reproduce this, and as the messaging in the screenshot suggests there, the elastic agent integration does have some special handling that is behind this behavior. Some background:

    When you select those boxes to collect agent logs and metrics, although this functionality depends on the elastic_agent package being installed, we don't actually create an integration policy for it. It's a bit unlike other integrations in that these options just turn on some settings directly on the agent. So this functionality is actually not dependent on an integration policy for the elastic_agent being present. In fact, if you did have an agent policy with agent logs and metrics turned off and added the integration policy, it would have no effect in turning this functionality on.

    It seems being able to create an integration policy for the elastic agent is a bit misleading.

    That said though aside from working around the bug with the alert rules mentioned above, I'm curious to know if you have use cases for being able to define a namespace, or output for elastic agent logs and metrics that is separate from what is defined at the agent policy.

  8. JohnLyman commented on Feb 13, 2026

    @JohnLyman
    Author

    the elastic agent integration does have some special handling that is behind this behavior

    Good to know it wasn't my mistake / misunderstanding :)

    Does that mean the elastic agent integration policy doesn't even need to be assigned to an agent policy? Right now, I have it assigned to my Fleet Server agent policies, but I'm guessing that it can be removed.

    I'm curious to know if you have use cases for being able to define a namespace, or output for elastic agent logs and metrics that is separate from what is defined at the agent policy.

    No, I was just trying to work around the bug with alert rules.

  9. MichelLosier commented on Feb 13, 2026

    @MichelLosier
    Contributor

    Does that mean the elastic agent integration policy doesn't even need to be assigned to an agent policy? Right now, I have it assigned to my Fleet Server agent policies, but I'm guessing that it can be removed.

    Yes that should be fine to do, just be sure to keep the package installed since it provides the index templates, dashboards and rules that support it.

  10. MichelLosier commented on Feb 18, 2026

    @MichelLosier
    Contributor

    Resolved in: #17237

  11. self-assigned this
    on Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    ⌂ 换网址