Changeset

5317:0091b7de2763

mod_audit: Allow caller to specify time of the event
author Matthew Wild <mwild1@gmail.com>
date Fri, 07 Apr 2023 12:00:06 +0100
parents 5316:4fc3277a914d
children 5318:c5ecfb06afde
files mod_audit/mod_audit.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_audit/mod_audit.lua	Fri Apr 07 11:38:46 2023 +0200
+++ b/mod_audit/mod_audit.lua	Fri Apr 07 12:00:06 2023 +0100
@@ -111,7 +111,7 @@
 		end
 	end
 
-	local id, err = stores[host]:append(nil, nil, stanza, time_now(), user_key);
+	local id, err = stores[host]:append(nil, nil, stanza, extra and extra.timestamp or time_now(), user_key);
 	if err then
 		module:log("error", "failed to persist audit event: %s", err);
 		return