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

Add '-E' CLI flag #1986

Merged
merged 1 commit into from
Jul 12, 2016
Merged

Add '-E' CLI flag #1986

merged 1 commit into from
Jul 12, 2016

Conversation

urso
Copy link

@urso urso commented Jul 7, 2016

Add '-D' CLI flag for overwriting single config options via CLI. For example:

-D output.console.pretty=true enables console output with pretty printing
enabled.

@urso urso force-pushed the enh/config-overwrites branch from f00735b to fb47d8b Compare July 7, 2016 13:06
@urso
Copy link
Author

urso commented Jul 7, 2016

blocked by #1985

@urso
Copy link
Author

urso commented Jul 7, 2016

config values overwritten from command line are remembered by config system. e.g. error message from new system test:

error unpacking config data: required 'object', but found 'string' in field 'output.console' (source:'command line flag')

@tsg
Copy link
Contributor

tsg commented Jul 8, 2016

Niiiiiice!

I'm not sure about the best flag to use for this. Elasticsearch replaced -D with -E so they don't get confused with the JVM options. I guess -E is from elasticsearch so that doesn't work. Perhaps -C would be an option from "config". In any case, it's hard to be consistent here :(.

@elastic/beats any other ideas?

@urso
Copy link
Author

urso commented Jul 8, 2016

One of:

- D = define
- E = environment
- C = config
- S = set

Don't like -C, as it might get mistaken for -c by accident.

@urso urso force-pushed the enh/config-overwrites branch from fb47d8b to b7ef617 Compare July 8, 2016 10:04
@tsg
Copy link
Contributor

tsg commented Jul 8, 2016

Then I'm +1 for -E to be consistent with Elasticsearch. We can pretend it's E for "environment" :)

@urso urso force-pushed the enh/config-overwrites branch 2 times, most recently from f5d1cb8 to 9d35188 Compare July 8, 2016 13:56
@urso urso changed the title Add '-D' CLI flag Add '-E' CLI flag Jul 8, 2016
@urso urso force-pushed the enh/config-overwrites branch from 9d35188 to b6ee0e4 Compare July 8, 2016 16:48
@tsg
Copy link
Contributor

tsg commented Jul 8, 2016

@urso there's a test failure.

@urso urso force-pushed the enh/config-overwrites branch from b6ee0e4 to 7f49b63 Compare July 9, 2016 16:08
@urso urso removed the blocked label Jul 9, 2016
console={"pretty": "false"}
)

exit_code = self.run_beat(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test would be a little bit nicer if you would run it first with the correct one to see if it works and then with the failing one ...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what exactly would you look for? Just relying on exit_code doesn't tell me if configuration was overwritten correctly.

Would love to introduce another test showing -E did apply config correctly. Maybe introduce some special config setting for printing a custom message (like mockbeat.echo) ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but it would confirm that the config you set worked without the -E flag.

@ruflin
Copy link
Contributor

ruflin commented Jul 11, 2016

LGTM. Left a minor comment.

@urso urso force-pushed the enh/config-overwrites branch 2 times, most recently from 9df8bb1 to 65c69a2 Compare July 12, 2016 10:07
@ruflin
Copy link
Contributor

ruflin commented Jul 12, 2016

LGTM. Waiting for green.

Add '-E' CLI flag for overwriting single config options via CLI. For example:

`-E output.console.pretty: true` enabled console output with pretty printing
enabled.
@urso urso force-pushed the enh/config-overwrites branch from 65c69a2 to 448f913 Compare July 12, 2016 10:09
@ruflin ruflin merged commit 5d6083d into elastic:master Jul 12, 2016
@urso urso deleted the enh/config-overwrites branch February 19, 2019 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants