diff --git a/userspace/engine/formats.cpp b/userspace/engine/formats.cpp index d03801b4..ae7571e7 100644 --- a/userspace/engine/formats.cpp +++ b/userspace/engine/formats.cpp @@ -269,8 +269,8 @@ int falco_formats::format_event (lua_State *ls) int falco_formats::resolve_tokens(lua_State *ls) { - if (!lua_isstring(ls, -1) || - !lua_isstring(ls, -2)) { + if (!lua_isuserdata(ls, 1) || + !lua_isstring(ls, 2)) { lua_pushstring(ls, "Invalid arguments passed to resolve_tokens()"); lua_error(ls); } diff --git a/userspace/engine/formats.h b/userspace/engine/formats.h index 955737ac..01677a63 100644 --- a/userspace/engine/formats.h +++ b/userspace/engine/formats.h @@ -53,6 +53,7 @@ class falco_formats // formatted_string = falco.format_event(evt, formatter) static int format_event(lua_State *ls); + // resolve_tokens = falco.resolve_tokens(evt, formatter) static int resolve_tokens(lua_State *ls); static sinsp* s_inspector;