You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[elastic_agent]: hard-coded default namespace in several packaged rules #17311
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.
changed the title [-][Integration Name]: Brief description of the issue[/-][+][elastic_agent]: hard-coded `default` namespace in several packaged rules[/+]on Feb 9, 2026
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.
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
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:
I'll be interested to see if you can reproduce it.
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.
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.
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.
Activity
[-][Integration Name]: Brief description of the issue[/-][+][elastic_agent]: hard-coded `default` namespace in several packaged rules[/+]JohnLyman commentedon Feb 9, 2026
This bug is even worse for users that are using both the
defaultnamespace and other custom namespaces because they will have incomplete coverage for the rules. For example, they could have one agent in thedefaultnamespace 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.elasticmachine commentedon Feb 9, 2026
Pinging @elastic/elastic-agent (Team:Elastic-Agent)
pierrehilbert commentedon Feb 10, 2026
@MichelLosier Could you please take a look here?
MichelLosier commentedon Feb 11, 2026
Thanks for reporting this, the hardcoding of
-defaultnamespace in those queries is a mistake. I'll try and incorporate that fix in the following PR I have open #17237That 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
JohnLyman commentedon Feb 12, 2026
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:

I'll be interested to see if you can reproduce it.
MichelLosier commentedon Feb 13, 2026
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.
JohnLyman commentedon Feb 13, 2026
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.
No, I was just trying to work around the bug with alert rules.
MichelLosier commentedon Feb 13, 2026
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.
MichelLosier commentedon Feb 18, 2026
Resolved in: #17237