Understanding New Function System and VRL vs Lua

TLDR Joe asked about the new function system and its Lua support. Prabhat explained VRL, while also confirming Lua support will continue. Recommended VRL for Joe's use case.

Photo of Joe
Joe
Sun, 23 Apr 2023 10:53:38 UTC

How does the new function system work? when I paste in my old function which I deleted before the upgrade, it cuts it after saving so that only the last 10 lines are saved

Photo of Prabhat
Prabhat
Sun, 23 Apr 2023 11:02:34 UTC

Actually new functions are based on VRL - . Lua functions are still supported and can be enabled by setting ZO_LUA_FN_ENABLED=true

Photo of Joe
Joe
Sun, 23 Apr 2023 11:03:14 UTC

Oh I see, will lua support be removed in a future update? Should I look at migrating to VRL?

Photo of Prabhat
Prabhat
Sun, 23 Apr 2023 11:03:39 UTC

No, Lua support will not be removed.

Photo of Prabhat
Prabhat
Sun, 23 Apr 2023 11:03:54 UTC

For most of the users VRL will be a much easier option though

Photo of Prabhat
Prabhat
Sun, 23 Apr 2023 11:04:11 UTC

Lua is way more powerful than VRL.

Photo of Prabhat
Prabhat
Sun, 23 Apr 2023 11:04:39 UTC

However there are security consideration when running untrusted lua code due to which we are not enabling it by default

Photo of Prabhat
Prabhat
Sun, 23 Apr 2023 11:05:00 UTC

We will be writing docs about enabling it and people should enable it only in trusted environments

Photo of Prabhat
Prabhat
Sun, 23 Apr 2023 11:06:33 UTC

What are you using functions for?

Photo of Joe
Joe
Sun, 23 Apr 2023 11:07:21 UTC

Currently just using lua string matches to extract info from the "message" and put it in separate fields

Photo of Prabhat
Prabhat
Sun, 23 Apr 2023 11:07:51 UTC

VRL is much easier for this use case. Give it a shot.

Photo of Joe
Joe
Sun, 23 Apr 2023 11:08:02 UTC

Nice, I'll try it :slightly_smiling_face:

Photo of Joe
Joe
Sun, 23 Apr 2023 11:08:14 UTC

Thanks for the help