Convert resource timestamps to RFC3339 format for ES
Change-Id: Iffe442c6f855f30fb7bbbe9c39399a0bfd35db11
This commit is contained in:
parent
a8f15cdc6d
commit
5494211a42
|
@ -14,8 +14,6 @@
|
|||
|
||||
local cjson = cjson
|
||||
local string = string
|
||||
local table = table
|
||||
local math = math
|
||||
local setmetatable = setmetatable
|
||||
local ipairs = ipairs
|
||||
local pairs = pairs
|
||||
|
@ -31,7 +29,6 @@ function normalize_uuid(uuid)
|
|||
return patt.Uuid:match(uuid)
|
||||
end
|
||||
|
||||
local metadata_fields = {}
|
||||
|
||||
local ResourcesDecoder = {}
|
||||
ResourcesDecoder.__index = ResourcesDecoder
|
||||
|
@ -70,8 +67,18 @@ local resource_msg = {
|
|||
function add_resource_to_payload(sample, payload)
|
||||
local counter_name, _ = string.gsub(sample.counter_name, "%.", "\\")
|
||||
|
||||
local metadata = sample.resource_metadata
|
||||
if type(metadata) == 'table' then
|
||||
for name, value in ipairs(metadata) do
|
||||
local transform = transform_functions[name]
|
||||
if transform ~= nil then
|
||||
metadata[name] = transform(value)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local resource_data = {
|
||||
timestamp = sample.timestamp,
|
||||
timestamp = utils.format_datetime(sample.timestamp),
|
||||
resource_id = sample.resource_id,
|
||||
source = sample.source or "",
|
||||
metadata = sample.resource_metadata,
|
||||
|
|
Loading…
Reference in New Issue