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

[Feature Request] Adding a custom string instead of ellipsis on vector truncate #438

Closed
Nirzak opened this issue Sep 3, 2023 · 4 comments · Fixed by #454
Closed

[Feature Request] Adding a custom string instead of ellipsis on vector truncate #438

Nirzak opened this issue Sep 3, 2023 · 4 comments · Fixed by #454
Labels
type: feature A value-adding code addition that introduce new functionality. vrl: stdlib Changes to the standard library

Comments

@Nirzak
Copy link

Nirzak commented Sep 3, 2023

A note for the community

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Use Cases

We want to make alerting for the events that have been truncated but an ellipsis is usually a more generic string to identify and any messages can have ellipsis on a log ingestion program if it's out of the viewing area of events. So if vector provides a feature so that we can add a custom string at the end of the truncated message. then we can set alerting based on that string. Making it through the truncate function would make it easier for us.

Attempted Solutions

No

Proposal

We can implement a function to add that custom string via vector truncate vrl function. just like the following

truncate("A long sentence.", limit: 11, custom_message: [event_truncated])

References

No response

Version

vector 0.30.0

@Nirzak Nirzak added the type: feature A value-adding code addition that introduce new functionality. label Sep 3, 2023
@StephenWakely StephenWakely transferred this issue from vectordotdev/vector Sep 7, 2023
@StephenWakely StephenWakely added the vrl: stdlib Changes to the standard library label Sep 7, 2023
@StephenWakely
Copy link
Contributor

It should be straightforward to make the ellipsis parameter of truncate take a boolean or a string representing the string to use.

@Nirzak
Copy link
Author

Nirzak commented Sep 7, 2023

It should be straightforward to make the ellipsis parameter of truncate take a boolean or a string representing the string to use.

Yea that’s what I was trying to mean. Thanks a lot!

@pront
Copy link
Member

pront commented Sep 15, 2023

Hi @Nirzak, this feature sounds reasonable. (deleted my previous suggestion since it would not work generally as Stephen pointed out to me)

@Nirzak
Copy link
Author

Nirzak commented Sep 22, 2023

Hi @Nirzak, this feature sounds reasonable. (deleted my previous suggestion since it would not work generally as Stephen pointed out to me)

Thanks a lot for creating a PR on this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature A value-adding code addition that introduce new functionality. vrl: stdlib Changes to the standard library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants