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

Edward Fjellskål edwardfjellskaal at gmail.com
Sun Apr 19 16:46:51 UTC 2020


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?


E
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openinfosecfoundation.org/pipermail/oisf-users/attachments/20200419/3e16a1c1/attachment.html>


More information about the Oisf-users mailing list