Skip to content

Support multiline ruby code #59

@vimalk78

Description

@vimalk78

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               ^"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions