Skip to content

Commit

Permalink
i18n: alias logstash.runner.configuration.* under logstash.agent.conf…
Browse files Browse the repository at this point in the history
…iguration (#13244) (#13842)

A number of plugins reach into Logstash's i18n translations to "helpfully"
communicate certain configuration errors, but rely on translations that were
moved in 00a99c1 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 8bec0e6)
  • Loading branch information
yaauie authored Mar 18, 2022
1 parent c37e045 commit bebd064
Showing 1 changed file with 26 additions and 19 deletions.
45 changes: 26 additions & 19 deletions logstash-core/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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: >-
Expand All @@ -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}`
Please only set `%{canonical_name}`

0 comments on commit bebd064

Please sign in to comment.