Browse Source

scripts: add scripts to override timestamp with float/integer timestamp (#1653)

Signed-off-by: Takahiro YAMASHITA <nokute78@gmail.com>
pull/2158/head
Takahiro Yamashita 1 year ago
committed by GitHub
parent
commit
1a11dc7ff9
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 23
      scripts/override_time.lua

23
scripts/override_time.lua

@ -0,0 +1,23 @@
--[[
This Lua script is to override timestamp with integer/float epoch time.
https://github.com/fluent/fluent-bit/issues/662
sample input is
[XXXXX.XXXXX, {"KEY_OF_TIMESTAMP"=>1530239065.807368, "data"=>"sample"}]
expected output is
[1530239065.807368040, {"KEY_OF_TIMESTAMP"=>1530239065.807368, "data"=>"sample"}]
sample configuration:
[FILTER]
Name lua
Match *.*
script override_time.lua
call override_time
]]
function override_time(tag, timestamp, record)
-- modify KEY_OF_TIMESTAMP properly.
return 1, record["KEY_OF_TIMESTAMP"], record
end
Loading…
Cancel
Save