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

allow outputting resulting config file when merging multiple ones #3243

Closed
nellicus opened this issue May 14, 2015 · 13 comments
Closed

allow outputting resulting config file when merging multiple ones #3243

nellicus opened this issue May 14, 2015 · 13 comments

Comments

@nellicus
Copy link

./bin/logstash --show-config -f /my_config_files_dir 
//don't start just show resulting config
input{
//all merged inputs
}
filter{
//all merged filters
}
output{
//all merged outputs
}
@jsvd
Copy link
Member

jsvd commented May 14, 2015

We already have the -t flag to check the validity of the config file, I think it would be interesting to implement your suggestion as a verbose flag for -t, such as:

% bin/logstash -v -t -f config
input {
  stdin { codec => json }
}
output {
  elasticsearch { }
}

 {:level=>:info}
Using version 0.1.x input plugin 'stdin'. This plugin isn't well supported by the community and likely has no maintainer. {:level=>:info}
Using version 0.1.x codec plugin 'json'. This plugin isn't well supported by the community and likely has no maintainer. {:level=>:info}
Using version 0.1.x output plugin 'elasticsearch'. This plugin isn't well supported by the community and likely has no maintainer. {:level=>:info}
Using version 0.1.x codec plugin 'plain'. This plugin isn't well supported by the community and likely has no maintainer. {:level=>:info}
Configuration OK
% bin/logstash -t -f config
Configuration OK

@nellicus
Copy link
Author

ideally show which config file is contributing to each part of the merged config

@gmoskovicz
Copy link
Contributor

+1 on this!

@jordansissel
Copy link
Contributor

I think this should be pretty simple to do. I'll see about making it happen in the next release.

Can you confirm what kind of output you want? Something like a comment-annotated form of what files are providing what sections of the config file?

@colinsurprenant
Copy link
Contributor

+1 on a -v verbose option in conjunction of -t
+1 on comment annotated file reference for section

@jordansissel
Copy link
Contributor

ooooh I like that, adding --verbose to --config-test would make it output an annotated, concatenated config file?

@jordansissel
Copy link
Contributor

@nellicus @gmoskovicz Can you comment and let us know if the proposed interface (--config-test --verbose) works for you as a way to view the full config (w/ annotation)?

@robin13
Copy link
Contributor

robin13 commented Oct 8, 2015

+1

@gmoskovicz
Copy link
Contributor

@jordansissel works for me, but also, perhaps i was thinking something more like --print-config, but that could only be an alias for the --config-test --verbose right?

@nellicus
Copy link
Author

nellicus commented Oct 8, 2015

@jordansissel I'm with @colinsurprenant

+1 on a -v verbose option in conjunction of -t
+1 on comment annotated file reference for section

@suyograo suyograo assigned purbon and untergeek and unassigned purbon Oct 15, 2015
untergeek added a commit to untergeek/logstash that referenced this issue Nov 12, 2015
This only works when the `--debug` flag is also enabled.

fixes elastic#3243
untergeek added a commit to untergeek/logstash that referenced this issue Nov 12, 2015
This only works when the `--debug` flag is also enabled.

fixes elastic#3243

Changes to log formatting per request

Change :file to :config_file

:file gets overridden by `logstash/agent.rb`, so a different symbol
is necessary.  Changing to `:config_file`
untergeek added a commit that referenced this issue Nov 12, 2015
This only works when the `--debug` flag is also enabled.

fixes #3243

Changes to log formatting per request

Change :file to :config_file

:file gets overridden by `logstash/agent.rb`, so a different symbol
is necessary.  Changing to `:config_file`

Fixes #4182
@untergeek
Copy link
Member

This is resolved. In 2.1, combining --debug with --configtest will result in output like this: https://gist.github.com/untergeek/e31bedbe5b34f21d1cba

@gmoskovicz
Copy link
Contributor

This looks great!!

@jakommo
Copy link

jakommo commented Nov 13, 2015

nice 👍

suyograo added a commit to suyograo/logstash that referenced this issue Nov 16, 2015
We added new --debug option in elastic#3243, adding it to CLI flags
suyograo added a commit that referenced this issue Nov 16, 2015
We added new --debug option in #3243, adding it to CLI flags

Fixes #4199
suyograo added a commit that referenced this issue Nov 16, 2015
We added new --debug option in #3243, adding it to CLI flags

Fixes #4199
suyograo added a commit that referenced this issue Nov 16, 2015
We added new --debug option in #3243, adding it to CLI flags

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

Successfully merging a pull request may close this issue.

10 participants