Uploaded image for project: 'Flume'
  1. Flume
  2. FLUME-3212

Flume does not ignore comment after property name value pair from config file

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.9.0
    • None
    • None
    • None

    Description

      Flume agent fails with FlumeException if configuration file contains comments after property value in same line (i.e. as follows)

      <property> = <value> #comment 
      

      i.e. config parameter value pair followed by comment

      This is because flume is not ignoring these comment.

      Example. 
      [root@cnode2 flume]# grep -i comment flume.conf
      a1.sources.r1.type = netcat # this is inline comment
      

      Produce below error in log

      org.apache.flume.FlumeException: Unable to load source type: netcat # this is inline comment, class: netcat # this is inline comment
      
      at org.apache.flume.source.DefaultSourceFactory.getClass(DefaultSourceFactory.java:68)
      
      at org.apache.flume.source.DefaultSourceFactory.create(DefaultSourceFactory.java:42)
      
      at org.apache.flume.node.AbstractConfigurationProvider.loadSources(AbstractConfigurationProvider.java:323)
      ...
      Caused by: java.lang.ClassNotFoundException: netcat # this is inline comment
      
      at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
      
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
      ...
      
      

       

      Ideally flume should ignore comment while parsing configuration file and agent should start successfully. Or config file parsing related error should be thrown.

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            imshubhangi Shubhangi Pardeshi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: