-
Notifications
You must be signed in to change notification settings - Fork 4.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
[WIP]: 34125 output name issue #34143
Conversation
- when cleaning the project it ignore 'permission denied' errors - remove broken make call
❕ Build Aborted
Expand to view the summary
Build stats
Test stats 🧪
Test errorsExpand to view the tests failures> Show only the first 10 test failures
|
//All module configs need to be loaded to enable all the filesets | ||
//contained in the modules. The default glob just loads the enabled | ||
//ones. Switching the glob pattern from *.yml to * achieves this. | ||
// All module configs need to be loaded to enable all the filesets |
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.
FYI we explicitly disable modules (and filesets) when running under agent: https://github.com/elastic/elastic-agent/blob/7f7faf365aeb303c6e4bb557f3f4b7f4de4025e7/specs/filebeat.spec.yml#L41
This functionality is replaced with integrations.
@@ -161,7 +160,8 @@ func newBeater(b *beat.Beat, plugins PluginFactory, rawConfig *conf.C) (beat.Bea | |||
// setupPipelineLoaderCallback sets the callback function for loading pipelines during setup. | |||
func (fb *Filebeat) setupPipelineLoaderCallback(b *beat.Beat) error { | |||
if b.Config.Output.Name() != "elasticsearch" { | |||
logp.Warn(pipelinesWarning) | |||
logp.Info(fmt.Sprintf(pipelinesWarning, b.Config.Output.Name())) |
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.
Ingest pipelines (that run on Elasticsearch) are handled by integration packages for agent. For standalone Filebeat it can load them itself, but the agent doesn't use the functionality.
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.
https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest.html#pipelines-for-fleet-elastic-agent for how this works under agent.
This entire section should be getting bypassed.
@@ -84,7 +84,7 @@ type Beat struct { | |||
// BeatConfig struct contains the basic configuration of every beat | |||
type BeatConfig struct { | |||
// output/publishing related configurations | |||
Output config.Namespace `config:"output"` | |||
Output config.Namespace `config:"outputs"` // this seems to be the issue. But right now it seems that somehow it works when loading the config, but later on Output is empty again |
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.
This was also the source of the problem in elastic/elastic-agent#1860 (comment)
The Beats assume they are reading a complete configuration file at startup to populate that. This is not true for the V2 agent. There is no output configured at startup.
In V1 we actually did read the reference Filebeat configuration at startup, and this worked by coincidence because the default output is Elasticsearch.
Ideally what we do in V2 is correct, don't assume an output until the agent configures it. This avoids problems where the Beat loads something from the reference config that conflicts with what the agent sent it, or problems where the user notices the Beats are reaching out to localhost:9200 at startup when a Logstash output is configured.
The problem is the Beats were written assuming they could read a valid config file at startup, so this is causing some weird problems in code that assumes this is populated when it isn't necessarily.
The original issue for this change was #31901
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.
This is where a blank default configuration is created:
beats/libbeat/cfgfile/cfgfile.go
Line 166 in d8204a2
c = config.NewConfig() |
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.
If the problem is that the ingest pipeline setup is being skipped, that should not actually be the cause of this problem. See https://github.com/elastic/beats/pull/34143/files#r1059158293
old, it was fixed on another PR |
See #34125 (comment) for context
What does this PR do?
Why is it important?
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Author's Checklist
How to test this PR locally
Related issues
Use cases
Screenshots
Logs
-->