doc: Document SCByteVarGet lua function

Add documentation for accessing results from byte_extract and byte_math
in lua match functions

Issue: 2871
pull/7713/head
Benjamin Wilkins 3 years ago committed by Victor Julien
parent 57ef80f5ec
commit 3b1b9a32fb

@ -1083,3 +1083,26 @@ Expose the log path.
filename = SCLogPath() .. "/" .. name
file = assert(io.open(filename, "a"))
end
SCByteVarGet
~~~~~~~~~~~~
Get the ByteVar at index given by the parameter. These variables are defined by
`byte_extract` or `byte_math` in Suricata rules. Only callable from match scripts.
::
function init(args)
local needs = {}
needs["bytevar"] = {"var1", "var2"}
return needs
end
Here we define a register that we will be using variables `var1` and `var2`.
The access to the Byte variables is done by index.
::
function match(args)
var1 = SCByteVarGet(0)
var2 = SCByteVarGet(1)

Loading…
Cancel
Save