nifi-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Burgess <>
Subject Re: Lua usage in ExecuteScript Processor
Date Wed, 20 Apr 2016 19:11:03 GMT

I know very little about Lua, so I haven't tried making a Lua version of my
JSON-to-JSON scripts/blogs (, but here's something
that works to get you started. The following Luaj script creates a flow
file, writes to it, adds an attribute, then transfers it to success.
Hopefully you can use your Lua scripts inline by calling their functions
and such from the OutputStreamCallback proxy (the process method below). If
you get something working and would like to share, I would very much
appreciate it!

local writecb =
luajava.createProxy("", {
process = function(outputStream)
outputStream:write("This is flow file content from Lua")
flowFile = session:create()
flowFile = session:putAttribute(flowFile, "lua.attrib", "Hello from Lua!")
flowFile = session:write(flowFile, writecb)
session:transfer(flowFile, REL_SUCCESS)


On Tue, Apr 19, 2016 at 1:15 PM, Madhukar Thota <>

> Friends,
> Can anyone share an sample example on how to use Lua in ExecuteScript
> Processor? We have bunch of lua scripts which we would like to use for data
> processing.
> Any help is appreciated.
> Thanks
> Madhu

View raw message