Merge pull request #82 from SwannCroiset/apache-decoder
Add Apache access log decoder
diff --git a/heka/_service.sls b/heka/_service.sls
index d098575..f509f45 100644
--- a/heka/_service.sls
+++ b/heka/_service.sls
@@ -70,6 +70,7 @@
service.running:
- enable: True
- watch:
+ - file: /usr/share/lma_collector
- file: /usr/share/lma_collector/*
- file: /etc/{{ service_name }}/*
{%- else %}
diff --git a/heka/files/lua/decoders/notification.lua b/heka/files/lua/decoders/notification.lua
index d4073d9..5b1195d 100644
--- a/heka/files/lua/decoders/notification.lua
+++ b/heka/files/lua/decoders/notification.lua
@@ -112,7 +112,16 @@
local data = read_message("Payload")
local ok, notif = pcall(cjson.decode, data)
if not ok then
- return -1
+ return -1, string.format("Failed to parse notification: %s: '%s'", notif, string.sub(data or 'N/A', 1, 64))
+ end
+
+ local oslo_version = notif['oslo.version']
+ if oslo_version then
+ -- messagingv2 notifications
+ ok, notif = pcall(cjson.decode, notif['oslo.message'])
+ if not ok then
+ return -1, string.format("Failed to parse v%s notification: %s: '%s'", oslo_version, notif, string.sub(data or 'N/A', 1, 64))
+ end
end
if include_full_notification then