How to extract specified tcp payload with suricata lua scripting?


We now want to develop some lua scirpts to extract tcp traffic to format tcp log for saving,but we found it can not extract specified tcp payload info based on the flow relevant lua API, so we have to choose the packet relevant lua API, but the packet data is too large to impact on detection performance,so we didn’t think it was a practical way.

Is there any other way to extract the payload info of tcp flow using the lua module?
Is there any way to extract the specified steam payload info of one tcp flow we specify?