fluent-bit icon indicating copy to clipboard operation
fluent-bit copied to clipboard

Use Lua filter unexpected symbol near '''

Open MagicChen996 opened this issue 4 years ago • 1 comments

this is my lua filter content function log_split(tag,timestamp,record) log = record["log"] new_log = log:gsub('\u001b%[%d+;%d+;%d+;%d+;%d+m','') :gsub('\u001b%[%d+;%d+;%d+;%d+m','') :gsub('\u001b%[%d+;%d+;%d+m','') :gsub('\u001b%[%d+;%d+m','') :gsub('\u001b%[%d+m','') record["log"] = new_log return 2,timestamp,record end when i try /opt/td-agent-bit/bin/td-agent-bit -c /etc/td-agent-bit/td-agent-bit-lua.conf it return a error
[error] [luajit] error loading script: /etc/td-agent-bit/ansi_filter.lua:3: unexpected symbol near ''' before this time , i have tried run lua in my idea, it's success image

this is my conf [INPUT] name tail path /root/output/test.log parser docker # Read interval (sec) Default: 1 [FILTER] Name lua Match * script /etc/td-agent-bit/ansi_filter.lua call log_split [OUTPUT] name file match * path /root/output Format plain

MagicChen996 avatar Dec 28 '21 04:12 MagicChen996

Hi, Have you resolved this issue yet? I searched and try a lots but still can figure this out, please share your solution. Thanks in advance, K.

kimvu3010 avatar Oct 11 '22 10:10 kimvu3010