Skip to content

Commit

Permalink
switch added reflecting blog post
Browse files Browse the repository at this point in the history
  • Loading branch information
mp3monster committed Sep 23, 2024
1 parent 495327e commit a6fce82
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions extras/fluentbit/lua-multi-event/advanced.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,21 @@ function copy(obj)
end

function cb_advanced(tag, timestamp, record)
local deepCopy = true
-- flag to control whether or not to perform a deep copy
local code = 1
print("Lua script - ", tag, " ", timestamp, " record is a", type(record))
-- printDetails(record, "")
record1 = copy(record)
record2 = copy(record)

record1 = record
record2 = record
if (deepCopy) then
print("applying deep copy")
record1 = copy(record)
record2 = copy(record)
end

-- modify the records slightly so we can easily distinguish them
record2["BLAHH"] = "piiiinnnnnnnggggggggg"
record1["remoteuser"] = "another user"
newRecord = { record1, record2 }
Expand Down

0 comments on commit a6fce82

Please sign in to comment.