Skip to content

Instantly share code, notes, and snippets.

diff --git a/share/lua/intf/cli.lua b/share/lua/intf/cli.lua
index a6ea382..ee5edb4 100644
--- a/share/lua/intf/cli.lua
+++ b/share/lua/intf/cli.lua
@@ -1,3 +1,41 @@
+-- function from http://www.lua.org/gems/vardump.lua, improved
+function vardump(value, depth, key)
+ local linePrefix = ""
+ local spaces = ""
+

Current WIP in lua_sandbox_extensions:

  • systemd socket activation support in input/udp #55
  • luaposix (needed for fsync, non-blocking file read, chown/chmod, ...) #37 #53
  • a rsylog like output #38
  • wall output #44
  • TZ support in syslog_file output. not easy:
  • os.date() uses the TZ environment variable.
  • but posix.setenv() is not thread-safe
  • alternatively, we can set TZ on the hindsight side, and use ''os.date("!%b %d %H:%M:%S", ts)'' (! means UTC, see http://lua-users.org/wiki/OsLibraryTutorial). Proposed as [lua_sandbox#163](https://github.com/mozilla-services/lua_sandbox/p
@sathieu
sathieu / heka1825.diff
Created May 11, 2016 14:36
Trying to catch the error...
--- a/pipeline/plugin_runners.go
+++ b/pipeline/plugin_runners.go
@@ -449,7 +449,11 @@ func (ir *iRunner) getDeliverFunc(token string) (DeliverFunc, DecoderRunner, Dec
// No synchronous decode means create a DecoderRunner and drop packs on
// its inChan.
if !ir.syncDecode {
- dr, _ := ir.pConfig.DecoderRunner(decoderName, fullName)
+ dr, ok := ir.pConfig.DecoderRunner(decoderName, fullName)
+ if !ok {
+ ir.LogError(fmt.Errorf("Unable to launch decoder '%s'", decoderName))
@sathieu
sathieu / mod_security.lua
Last active January 7, 2016 12:43
Parse mod_security logs
-- This Source Code Form is subject to the terms of the Mozilla Public
-- License, v. 2.0. If a copy of the MPL was not distributed with this
-- file, You can obtain one at http://mozilla.org/MPL/2.0/.
--[[
Parses the Apache mod_security logs.
See https://github.com/SpiderLabs/ModSecurity/wiki/ModSecurity-2-Data-Formats#Audit_Log
Config:
@sathieu
sathieu / flexible_syslog.lua
Last active June 13, 2016 13:47
Heka decoder for various Cisco and NetApp products
-- This Source Code Form is subject to the terms of the Mozilla Public
-- License, v. 2.0. If a copy of the MPL was not distributed with this
-- file, You can obtain one at http://mozilla.org/MPL/2.0/.
-- Copyright 2015 Mathieu Parent <math.parent@gmail.com>
--[[
Parses the syslog logs from vendor not respecting Syslog RFCs.
Config: