From 0d3611e602c126a88d606a14792c9d6c7cfb05af Mon Sep 17 00:00:00 2001 From: Ry Biesemeyer Date: Fri, 4 Mar 2022 08:39:03 -0800 Subject: [PATCH] i18n: alias logstash.runner.configuration.* under logstash.agent.configuration (#13244) A number of plugins reach into Logstash's i18n translations to "helpfully" communicate certain configuration errors, but rely on translations that were moved in 00a99c19e512a6ec0089cf5996168cbc15470330 from logstash.agent to logstash.runner. Since then, it is possible to hit obtuse error messages about failing to load a translation instead of the intended helpful message: ~~~ translation missing: en.logstash.agent.configuration.invalid_plugin_register ~~~ By moving the `logstash.agent` definition to _after_ the `logstash.runner` definition, we can use YAML tooling to name the `logstash.runner.configuration` node and then merge its contents into `logstash.agent.configuration`. This effectively allows us to keep a single definition of those translations while making them available at both addresses. Co-authored-by: kaisecheng <69120390+kaisecheng@users.noreply.github.com> (cherry picked from commit 8bec0e658a4c3ccc94a2c15680a47a893ef30cee) --- logstash-core/locales/en.yml | 45 +++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/logstash-core/locales/en.yml b/logstash-core/locales/en.yml index 4bbae030cfc..fb728f87570 100644 --- a/logstash-core/locales/en.yml +++ b/logstash-core/locales/en.yml @@ -61,23 +61,6 @@ en: 0-1-x: >- Using version 0.1.x %{type} plugin '%{name}'. This plugin isn't well supported by the community and likely has no maintainer. - agent: - sighup: >- - SIGHUP received. - sigint: >- - SIGINT received. Shutting down. - sigterm: >- - SIGTERM received. Shutting down. - slow_shutdown: |- - Received shutdown signal, but pipeline is still waiting for in-flight events - to be processed. Sending another ^C will force quit Logstash, but this may cause - data loss. - forced_sigint: >- - SIGINT received. Terminating immediately.. - non_reloadable_config_reload: >- - Unable to reload configuration because it does not support dynamic reloading - non_reloadable_config_register: |- - Logstash is not able to start since configuration auto reloading was enabled but the configuration contains plugins that don't support it. Quitting... web_api: cant_bind_to_port: |- Logstash tried to bind to port %{port}, but the port is already in use. You can specify a new port by launching logstash with the --api.http.port option." @@ -158,7 +141,9 @@ en: configtest-flag-information: |- You may be interested in the '--configtest' flag which you can use to validate logstash's configuration before you choose to restart a running system. - configuration: + # YAML named reference to the logstash.runner.configuration + # so we can later alias it from logstash.agent.configuration + configuration: &runner_configuration obsolete: >- The setting `%{name}` in plugin `%{plugin}` is obsolete and is no longer available. %{extra} If you have any questions about this, you @@ -414,6 +399,27 @@ en: Running Logstash with the bundled JDK is recommended. The bundled JDK has been verified to work with each specific version of Logstash, and generally provides best performance and reliability. If you have compelling reasons for using your own JDK (organizational-specific compliance requirements, for example), you can configure LS_JAVA_HOME to use that version instead. + agent: + sighup: >- + SIGHUP received. + sigint: >- + SIGINT received. Shutting down. + sigterm: >- + SIGTERM received. Shutting down. + slow_shutdown: |- + Received shutdown signal, but pipeline is still waiting for in-flight events + to be processed. Sending another ^C will force quit Logstash, but this may cause + data loss. + forced_sigint: >- + SIGINT received. Terminating immediately.. + non_reloadable_config_reload: >- + Unable to reload configuration because it does not support dynamic reloading + non_reloadable_config_register: |- + Logstash is not able to start since configuration auto reloading was enabled but the configuration contains plugins that don't support it. Quitting... + # LEGACY: many plugins refer to logstash.agent.configuration.* + # so we alias the canonical logstash.runner.configuration.* + configuration: + <<: *runner_configuration settings: deprecation: set: >- @@ -424,4 +430,5 @@ en: Code should be updated to query `%{canonical_name}` instead ambiguous: >- Both `%{canonical_name}` and its deprecated alias `%{deprecated_alias}` have been set. - Please only set `%{canonical_name}` \ No newline at end of file + Please only set `%{canonical_name}` +