elastic / elasticsearch

Free and Open Source, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
1.28k stars 24.86k forks source link

Dangling space at end of message strings can cause issues for monitoring and parsing of output #117067

Open vford-elastic opened 22 hours ago

vford-elastic commented 22 hours ago

Elasticsearch Version

8.16.0

Installed Plugins

No response

Java Version

bundled

OS Version

Linux

Problem Description

Dangling space at end of message strings can cause issues for monitoring and parsing of logs. Users want to parse output using their tools and periodically they are finding messages with an unnecessary trailing space which can break some user parsers.

Steps to Reproduce

Examples of the messages with trailing extra space on last line of message.

https://github.com/elastic/elasticsearch/blob/main/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStore.java#L477

                "Grants the minimum privileges required to view machine learning configuration, status, and work with results. "
                    + "This role grants monitor_ml cluster privileges, read access to the .ml-notifications and .ml-anomalies* indices "
                    + "(which store machine learning results), and write access to .ml-annotations* indices. "
                    + "Machine learning users also need index privileges for source and destination indices "
                    + "and roles that grant access to Kibana. "

https://github.com/elastic/elasticsearch/blob/main/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStore.java#L582

"Grants monitor_data_frame_transforms cluster privileges, which enable you to use transforms. "

Most of the messages do not have a training space, for example the following doesn't have a trailing space:

https://github.com/elastic/elasticsearch/blob/main/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStore.java#L218

"Grants the minimum privileges required for any user of X-Pack monitoring other than those required to use Kibana. "

Logs (if relevant)

No response

elasticsearchmachine commented 7 hours ago

Pinging @elastic/es-security (Team:Security)