Pretty easy to do - note that this works only with text files. There's a set of callbacks that works with binary files but they use a "void" type which has no Lua equivalent and so while you can successfully transfer the binary file, there's no way in Lua to interact with that result:
local mypds = pds.create()
local address = "/domain/hub/robot"
local filename = "hub.log"
pds.putString ( mypds, "directory", "/opt/nimsoft/hub")
pds.putString ( mypds, "file", filename )
pds.putInt ( mypds, "buffer_size", 10240000 )
output1,return_status1 = nimbus.request ( address .. "/controller", "text_file_get", mypds)
pds.delete(mypds)
destfile = "c:\\temp\\" .. filename
file = io.open(destfile , "w")
if file then
file:write(output1["file_content"], "\n")
file:close()
else
print("Open of " .. destfile .. " file for write failed.")
end