balabit/syslog-ng-incubator — pull request #25 by algernon (2014-02-23 14:55:42+00:00)
Title: lua: Add support for setting global variables

This adds a global() option to the lua destination, where one can list
name-value pairs, which will be injected into the lua state upon
startup, shortly after the script is loaded. Currently, it supports only
strings and 32-bit integers. This fixes #23.

An usage example is included in the elasticsearch example.

It (ab)uses value-pairs to collect the global options. It would likely be better to use a GTree or hashtable instead, as we do not need the whole value-pairs infrastructure. But once the interface is agreed upon, we can easily change the code behind it.

(Previous PR was auto-closed, when I deleted the 3.5/master branch)