Skip to content

[Feat.] JMTE string truncation supportΒ #57

@mindsolve

Description

@mindsolve

Is your feature request related to a problem? Please describe.
Regarding the "Message too long" problems, it was asked in the past whether truncation of the message would be possible. This was denied, because the logic for correctly truncating a string with html formatting was too complex to implement.

Describe the solution you'd like
I would like to propose a string truncation function, to be usable as JMTE "function" to be able to truncate/shorten known "pure strings" from e.g. variables. There would be no need for any kind of special logic involved, just the relatively simple logic of shortening a string to a specified maximum amount of characters.

Describe alternatives you've considered
Alternate solutions were discussed in the issues regarding "message too long", but not chosen. Also, no other types of string modification are possible from either the plugin nor graylog itself. The only "solution" would be to shorten all log messages before alerting using pipelines (or similar) - but that is just not feasible.

Additional context
While the message_too_long variable is really helpful, allowing to at least send alerts with the meta data (like host, stream and so forth), it is often impossible to determine without the actual log message/line whether it is something that needs to be fixed immediately and what component it affects.
I would like to be able to at least show a log snippet when alerting with the full message is impossible.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions