rfcs/2023-02-08-7496-vrl-return.md
Add return expression to the Vector Remap Language.
return can optionally take an expression as an argument and the result of that expression will be returned.drop.break.return expressions inside closures.return expression causes the VRL program to terminate, keeping any modifications made to the event.return expression must be always followed by another expression, whose value will be used as the emitted event.abort keyword when drop_on_abort is set to false. The only difference is that the returned value will be taken from the provided expression and not from original input.drop_on_abort will have no effect on return calls and configuration such as drop_on_return will not be added.return is already a reserved word so it can be used without introducing a breaking change.return keyword will be given a semantic meaning that will have to be supported going forward.Incremental steps to execute this change. These will be converted to issues after the RFC is approved:
drop keyword for explicit drop as an alternative to pre-configured abort for full control over passing the events to output unchanged, passing them changed, or routing them to the dropped output.return to closures.