fluent-plugin-record-modifier icon indicating copy to clipboard operation
fluent-plugin-record-modifier copied to clipboard

Support multiline ruby code

Open vimalk78 opened this issue 3 years ago • 1 comments

Is it possible to support multiline code?

  <filter **>      
    @type record_modifier      
    <record>      
      somekey  ${if !record['field1'].nil?;       
                           record['field1'];       
                 elsif record['field2'] != "";       
                    record['field2'];       
                 else       
                    record['somekey'];       
                 end;}      
    </record>      
  </filter> 

Currently i get error in fluentd (1.7.2)

2021-05-21 11:59:16 +0000 [error]: /usr/local/share/gems/gems/fluent-plugin-record-modifier-2.1.0/lib/fluent/plugin/filter_record_modifier.rb:175: unterminated string meets end of file  
            end  
               ^ 
               ^ error_class=SyntaxError error="/usr/local/share/gems/gems/fluent-plugin-record-modifier-2.1.0/lib/fluent/plugin/filter_record_modifier.rb:175: unterminated string meets end of file\n            end\n               ^\n/usr/local/share/gems/gems/fluent-plugin-record-modifier-2.1.0/lib/fluent/plugin/filter_record_modifier.rb:175: syntax error, unexpected end-of-input, expecting keyword_end\n            end\n               ^"

vimalk78 avatar May 21 '21 12:05 vimalk78

Hi @repeatedly , any comments? If y ou guide me, i can also send a PR

vimalk78 avatar May 25 '21 11:05 vimalk78