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

[Filebeat] setup check gives spurious ILM error #16336

Open
faec opened this issue Feb 14, 2020 · 17 comments
Open

[Filebeat] setup check gives spurious ILM error #16336

faec opened this issue Feb 14, 2020 · 17 comments
Labels
bug candidate Candidate to be added to the current iteration Filebeat Filebeat good first issue Indicates a good issue for first-time contributors Stalled Team:Integrations Label for the Integrations team [zube]: Ready

Comments

@faec
Copy link
Contributor

faec commented Feb 14, 2020

This gives the result 2020-02-14T12:45:57.733-0500 ERROR instance/beat.go:921 Exiting: Index management requested but the Elasticsearch output is not configured/enabled even though ILM is disabled.

This doesn't appear to trigger on a real Filebeat run (filebeat -e), only on setup.

This seems possibly related to #14589 but is still reproducible at head.

@faec faec added bug Filebeat Filebeat good first issue Indicates a good issue for first-time contributors Team:Beats labels Feb 14, 2020
@ma-hei
Copy link
Contributor

ma-hei commented Feb 21, 2020

Just getting started with this code base, but if this is a good first issue, I'd like to look into it.

@faec
Copy link
Contributor Author

faec commented Feb 21, 2020

@ma-hei It looks like no one's working on it yet so you're welcome to :-) I haven't looked into the specifics but a good place to start is probably Beat.Setup in libbeat/cmd/instance/beat.go

@ma-hei
Copy link
Contributor

ma-hei commented Feb 23, 2020

@faec This is what's happening here:
When running ./filebeat setup -e, then Beat.Setup will try to (a) load the index template in Elasticsearch and to (b) setup the Kibana dashboard (among other things). For both (a) and (b), filebeat needs to communicate with Elasticsearch.
Now in filebeat.yml, Filebeat can be configured to send output to Elasticsearch directly or to any other instance (for example Logstash). In Beat.Setup, the error is thrown if the output is configured to be any instance that is not Elasticsearch:
if outCfg.Name() != "elasticsearch" { return fmt.Errorf("Index management requested but the Elasticsearch output is not configured/enabled") }
The method should be changed here, in order to allow the setup to work when the output is not Elasticsearch.
The question is: when the output is not set to Elasticsearch, how should we allow the user to specify the Elasticsearch URL? In case the output is set to Elasticsearch, the Setup method gets this URL directly from the output.elasticsearch section in the config file (which is of course not present, if the output is for example logstash).
I can think of two ways of allowing the user to specify this URL:

  1. Allow the user to specify the elasticsearch URL in filebeat.yml (even if output is not sent to Elasticsearch directly)
  2. Add a parameter to filebeat setup that allows to specify the Elasticsearch URL (for example filebeat setup -e -elasticsearch.host=localhost:9200 or similar).

What is your opinion on this (Are you the right person for this question? If not, who should be consulted here?)?

@faec
Copy link
Contributor Author

faec commented Feb 25, 2020

Hmm -- to be honest, looking at this closer I'm no longer sure if it's a bug per se so much as a confusing error message / incomplete documentation.

Even if ILM is disabled, the other things this command does (like setup index templates) also require an Elasticsearch backend to make sense. I think some parts of the command can theoretically be run in isolation (e.g. --dashboards might only require Kibana?) but it doesn't seem like the primary use.

I'd like the connection to the Filebeat configuration to be clearer -- some parts of the documentation allude to running setup with ILM disabled, but I think it might mean disabled in the Elasticsearch configuration rather than Filebeat? But I think failing with an error here is probably correct, the error should just be more clear about what's being attempted and why it needs an Elasticsearch endpoint.

@ma-hei
Copy link
Contributor

ma-hei commented Feb 27, 2020

Right. Maybe it would make sense to explain that the output is configured for logstash instead. The setup command can be run successfully by temporarily disabling the logstash output and by passing in the Elasticsearch host, using the -E option. We could give the user this as a hint. So I suggest the error message:
This command attempts index management which requires an Elasticsearch host. In this case output is configured for Logstash. When output is not configured for Elasticsearch directly, this command can be run with the -E option in order to temporarily disable the configured output and provide the Elasticsearch host. Example: "filebeat setup -E output.logstash.enabled=false -E output.elasticsearch.hosts=["localhost:9200"]"
Feel free to modify this error message and I will create a PR.

@andresrc andresrc added Team:Integrations Label for the Integrations team and removed Team:Beats labels Mar 6, 2020
@jgelsey
Copy link

jgelsey commented Dec 23, 2020

Having just struggled with this error for the last 3 days, I feel it would be awesome to clarify the error message this way.

@RadoNko
Copy link

RadoNko commented Feb 9, 2021

Update: 9th February 2021 and still getting the very same bug/error message, cant move past filebeat setup -e step.

@pplanel
Copy link

pplanel commented Jun 11, 2021

Hi guys, do we have an update on this issue?

@arun7000
Copy link

arun7000 commented Jul 1, 2021

2021-07-01T21:15:13.254+0530 WARN beater/filebeat.go:178 Filebeat is unable to load the Ingest Node pipelines for the configured modules because the Elasticsearch output is not configured/enabled. If you have already loaded the Ingest Node pipelines or are using Logstash pipelines, you can ignore this warning.
2021-07-01T21:15:13.254+0530 ERROR instance/beat.go:989 Exiting: Index management requested but the Elasticsearch output is not configured/enabled
Exiting: Index management requested but the Elasticsearch output is not configured/enabled

same issue in version filebeat-7.13.2-windows-x86_64, windows 10 os

@Mekk
Copy link

Mekk commented Aug 24, 2021

Just use some other setting, please. Like management.elasticsearch or sth similar.

filebeat setup happens (and should happen) to be executed during upgrades or other admin operations, having to artificially reconfigure for the sake of this op is troublesome.

Of course in case management.elasticearch is not defined, and output.elasticsearch is, falling back is reasonable and natural. But setup with filebeat passing data to logstash isn't that rare…

@Mekk
Copy link

Mekk commented Aug 24, 2021

BTW: there already exists similar setting: monitoring.elasticsearch (setup where to put monitoring data, independent from output setup)

@botelastic
Copy link

botelastic bot commented Aug 24, 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 Aug 24, 2022
@SteffBauer
Copy link

I just came across the problem too. An update would be very helpful 👍🏼

@botelastic botelastic bot removed the Stalled label Aug 25, 2022
@Goetterfleisch1337
Copy link

:+1

@shaahrokh
Copy link

Do we have an update on this issue?

@Mekk
Copy link

Mekk commented Sep 15, 2023

Doesn't seem so. In case sb. decides to look at it, after additional look I still recommend my earlier suggestion:

  • introduce possibility to use separate config block like management.elasticsearch or (maybe better) setup.elasticsearch to configure how filebeat setup should access elasticsearch
  • (shortcut for simple configs) if this block is missing, try also output.elasticsearch (or merge settings, merging would be more consistent with monitoring)
  • patch the error message (so it suggests setup.elasticsearch)

Rationale for syntax and approach : this is exactly how similar problem for monitoring is solved (there is monitoring.elasticsearch block one can use to configure ES access for monitoring data, described here, possibly some code could also be reused).

PS Separate setup.elasticsearch may even make sense in elasticsearch output case („setup” account needs more elevated permissions).

@botelastic
Copy link

botelastic bot commented Sep 14, 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 Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug candidate Candidate to be added to the current iteration Filebeat Filebeat good first issue Indicates a good issue for first-time contributors Stalled Team:Integrations Label for the Integrations team [zube]: Ready
Projects
None yet
Development

No branches or pull requests