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

Adding extra_validation_options for configuration validation #265

Merged
merged 1 commit into from Jul 28, 2020

Conversation

symonius7
Copy link
Contributor

Allows for extra options to be passed to the filebeat test config command. This allows support of keystore variables as passwords by passing a --path.data allowing the validation command to find the filebeat keystore and potentially other validation options.

@lukebigum
Copy link

A little bit more info. On some versions of Linux, this is what the validation command expands to, and causes an error if using passwords from environment variables:

[root@host ~]# /usr/share/filebeat/bin/filebeat test config -c /etc/filebeat/filebeat.yml
Exiting: error initializing publisher: missing field accessing 'output.elasticsearch.password' (source:'/etc/filebeat/filebeat.yml')

To fix it, we need to give the path to where the filebeat keystore is located:

[root@host ~]# /usr/share/filebeat/bin/filebeat test config -c /etc/filebeat/filebeat.yml --path.data /var/lib/filebeat/
Config OK

This is because /usr/bin/filebeat is actually a shell script that adds certain default options, whereas this module executes the filebeat binary directly.

@pcfens
Copy link
Owner

pcfens commented Jul 28, 2020

Thanks for a complete MR with tests and docs. Using the full /usr/share/filebeat... path came out of older versions before /usr/bin/filebeat was a thing. Now that we don't support those versions anymore we might be able to change that to /usr/bin/filebeat with a little bit of testing.

I'm happy to merge as is, but wanted to check in case it helps with other potential headaches.

@lukebigum
Copy link

lukebigum commented Jul 28, 2020

Yeah TBH I found the /usr/bin/filebeat thing after I ran my colleague through doing it this way ;-) We could change the path, but this module has a lot of supported OS of which we only run CentOS... I'm not best placed to go figure out if that path exists on all distros. Will anything in Travis catch that?

@pcfens
Copy link
Owner

pcfens commented Jul 28, 2020

Oh ok - I'll go ahead and merge this then since we know it won't break things too widely. I'll try and cut a new release soon too.

@pcfens pcfens merged commit c5a68a5 into pcfens:master Jul 28, 2020
@symonius7
Copy link
Contributor Author

symonius7 commented Jul 29, 2020 via email

@pcfens
Copy link
Owner

pcfens commented Aug 12, 2020

I just pushed v4.7.0 to the forge. This is the only change in the release, so hopefully that makes deployment a little bit easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants