Generic Lua sandbox for dynamic data analysis
C Lua CMake C++
Latest commit 73c1d60 Nov 23, 2016 @trink trink committed on GitHub Merge pull request #167 from sathieu/flags
Inject CFLAGS/CXXFLAGS/CPPFLAGS from environment

Lua Sandbox Library


Sandboxes provide a dynamic and isolated execution environment for data parsing, transformation, and analysis. They allow access to data without jeopardizing the integrity or performance of the processing infrastructure. This broadens the audience that the data can be exposed to and facilitates new uses of the data (i.e. debugging, monitoring, dynamic provisioning, SLA analysis, intrusion detection, ad-hoc reporting, etc.)

The Lua sandbox is a library allowing customized control over the Lua execution environment including functionality like global data preservation/restoration on shutdown/startup, output collection in textual or binary formats and an array of parsers for various data types (Nginx, Apache, Syslog, MySQL and many RFC grammars)

These libraries and utilities have been mostly extracted from Hindsight. The goal was to decouple the Heka/Hindsight functionality from any particular infrastructure and make it embeddable into any tool or language.


  • small - memory requirements are as little as 8 KiB for a basic sandbox
  • fast - microsecond execution times
  • stateful - ability to resume where it left off after a restart/reboot
  • isolated - failures are contained and malfunctioning sandboxes are terminated. Containment is defined in terms of restriction to the operating system, file system, libraries, memory use, Lua instruction use, and output size.

Full Documentation



Optional (used for documentation)

CMake Build Instructions

git clone
cd lua_sandbox
mkdir release
cd release

cmake -DCMAKE_BUILD_TYPE=release ..

# Windows Visual Studio 2013
cmake -DCMAKE_BUILD_TYPE=release -G "NMake Makefiles" ..

cpack -G TGZ # (DEB|RPM|ZIP)