You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original log : "upstream_response_time":"0.103,0.203"
Completed using lua
my_lua_transform:
inputs:
- my_transform
type: lua
version: "2"
hooks:
process: |-
function (event, emit)
local upstream_response_time = event.log.message.upstream_response_time
if type(upstream_response_time) == "string" then
if string.find(upstream_response_time, ",") then
local result = 0
for i in string.gmatch(upstream_response_time, '([^,]+)') do
result = result + tonumber(i)
end
upstream_response_time = result
else
upstream_response_time = tonumber(upstream_response_time)
end
end
event.log.message.upstream_response_time = upstream_response_time
emit(event)
end
How to implement it using vrl ?
eventually need to be achieved
"upstream_response_time":"0.103,0.203" => "upstream_response_time":0.306
This discussion was converted from issue #19746 on January 30, 2024 14:59.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Original log : "upstream_response_time":"0.103,0.203"
Completed using lua
How to implement it using vrl ?
eventually need to be achieved
"upstream_response_time":"0.103,0.203" => "upstream_response_time":0.306
Beta Was this translation helpful? Give feedback.
All reactions