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

Is there an alternative to env. variables object substitution? #19272

Closed
orhantoy opened this issue Jun 18, 2020 · 4 comments
Closed

Is there an alternative to env. variables object substitution? #19272

orhantoy opened this issue Jun 18, 2020 · 4 comments
Labels
Team:Services (Deprecated) Label for the former Integrations-Services team

Comments

@orhantoy
Copy link

As of version 7.7 the ability to substitute objects into the config via env. variables were removed. We're currently relying on that ability in Enterprise Search, for instance to set custom ES headers:

output.elasticsearch:
  # ...
  hosts: ["${ELASTICSEARCH_HOST}"]
  # ...
  headers: ${ELASTICSEARCH_HEADERS}

elastic/go-ucfg#139 is the PR that removed support for this, I think.

Is there an alternative to this other than setting a command line argument like

-E output.elasticsearch.headers='{ "X-Custom-Header": "..." }'

?

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jun 18, 2020
@blakerouse
Copy link
Contributor

Have you confirmed this doesn't work?

That change did not prevent the replacement from environment variables it removed the ability for double substitution. A variable that relied on another variable.

@orhantoy
Copy link
Author

Just tried with a fresh copy of Filebeat 7.7.1 and it exited with an error:

$ ELASTICSEARCH_HEADERS='{"X-Custom-Header":"..."}' ./filebeat -e -v
[...]
2020-06-18T16:13:31.558+0200    INFO    instance/beat.go:411    filebeat stopped.
2020-06-18T16:13:31.558+0200    ERROR   instance/beat.go:932    Exiting: error initializing publisher: required 'object', but found 'string' in field 'output.elasticsearch.headers' (source:'filebeat.yml')
Exiting: error initializing publisher: required 'object', but found 'string' in field 'output.elasticsearch.headers' (source:'filebeat.yml')

The same command works on 7.6.

@andresrc andresrc added the Team:Services (Deprecated) Label for the former Integrations-Services team label Jun 22, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations-services (Team:Services)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jun 22, 2020
@acrewdson
Copy link

acrewdson commented Jul 20, 2020

Can confirm this is a problem in 7.8 too – affects both the headers and ssl config fields. I think this might be related to the changes here:

The module was accepting configuration as JSON strings for some parameters (http_headers, http_request_body, pagination, rate_limit, ssl) which is inconsistent with how other parts of Beats are configured so I removed this. Now these options expect regular YAML objects for values. None of these options are required to use the module so the impact to users should be minimal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Services (Deprecated) Label for the former Integrations-Services team
Projects
None yet
Development

No branches or pull requests

5 participants