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

[Feat.] JMTE string truncation support #57

Open
mindsolve opened this issue Aug 3, 2023 · 1 comment
Open

[Feat.] JMTE string truncation support #57

mindsolve opened this issue Aug 3, 2023 · 1 comment

Comments

@mindsolve
Copy link

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.

@irgendwr
Copy link
Owner

irgendwr commented Aug 5, 2023

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.

That's a good suggestion and should be easy to implement.

I will likely not work on this, since I don't have the time and interest. If this is something that you need, you could try contributing it yourself.

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

No branches or pull requests

2 participants