From d35971e1bc36725008571893e17f6d582f064f6d Mon Sep 17 00:00:00 2001 From: Leonardo Di Donato Date: Tue, 17 Sep 2019 21:49:12 +0000 Subject: [PATCH] update(userspace/engine): resolve token Signed-off-by: Leonardo Di Donato --- userspace/engine/formats.cpp | 4 ++-- userspace/engine/formats.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) 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;