[Oisf-users] Lua output question.... flowint

Victor Julien lists at inliniac.net
Sun Apr 19 16:54:00 UTC 2020


On 19-04-2020 18:46, Edward Fjellskål wrote:
> 
> According to the docs, one should be able to use all the functions in
> eater lua rules or lua output. But I cant seem to get ScFlowintGet to
> work. Just errors here:
> 
> [110340] 17/4/2020 -- 08:21:24 - (output-lua.c:289) <Info>
> (LuaPacketLogger) -- failed to run script:
> /etc/suricata/lua-output//test.lua:19: attempt to call global
> 'ScFlowintGet' (a nil value)
> 
> Script is as follows:
> 
> -- START
> function init(args)
>     local needs = {}
>     needs["type"] = "flow"
>     needs["type"] = "packet"
>     needs["flowint"] = {"test"}
>     return needs
> end
> 
> function setup (args)
>   SCLogInfo("TEST setup")
> end
> 
> function deinit (args)
>   SCLogInfo("TEST deinit")
> end
> 
> function log(args)
>     --ipver, srcip, dstip, proto, sp, dp = SCFlowTuple()
>     a = ScFlowintGet(0) -- Fails here!
>     if a then
>         ScFlowintSet(0, a + 1)
>     else
>         ScFlowintSet(0, 1)
>     end
>     SCLogInfo("TEST log")
> end
> -- END
> 
> Is this supposed to work?

Looks like it's only registered for the detection lua support, not for
output.

-- 
---------------------------------------------
Victor Julien
http://www.inliniac.net/
PGP: http://www.inliniac.net/victorjulien.asc
---------------------------------------------



More information about the Oisf-users mailing list