mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Add support for syslog format RFC 5424
This commit is contained in:
parent
6a4c6cf30c
commit
bd55990961
4 changed files with 36 additions and 8 deletions
|
|
@ -183,6 +183,22 @@ function format_utils.bitsToSize(bits)
|
|||
return(bitsToSizeMultiplier(bits, 1000))
|
||||
end
|
||||
|
||||
-- format an epoch using ISO 8601 format
|
||||
function format_utils.formatEpochISO8601(epoch)
|
||||
if epoch == nil then
|
||||
epoch = os.time()
|
||||
end
|
||||
|
||||
if epoch == 0 then
|
||||
return("")
|
||||
else
|
||||
local t = epoch + getFrontendTzSeconds()
|
||||
return os.date("!%Y-%m-%dT%TZ", t)
|
||||
end
|
||||
end
|
||||
|
||||
os.date("!%Y-%m-%dT%TZ",t)
|
||||
|
||||
-- format an epoch
|
||||
function format_utils.formatEpoch(epoch)
|
||||
if epoch == nil then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue