flume MOPHLINE拦截器拆分命令

nukf8bse  于 2021-06-04  发布在  Flume
关注(0)|答案(1)|浏览(455)

嗨,我正在尝试使用morphline inteceptor并将我的syslog转换为json作为开始我尝试使用split命令来分割我的字符串,但我得到如下错误:
“”由于在配置com.typesafe.config.configexception$wrongtype:/root/flume.17/conf/morph.conf:21时出错,源r1已被删除:无法将对象或列表与非对象或列表、configstring(“split”)和simpleconfigobject({“outputfields”:“substrings”、“inputfield”:“message”、“addemptystrings”:false、“isregex”:false连接起来,“trim”:true,“separator”:“})不兼容“”
我的行配置文件:

morphlines : [
{

# Name used to identify a morphline. E.g. used if there are multiple

# morphlines in a morphline config file

id : morphline1

# Import all morphline commands in these java packages and their

# subpackages. Other commands that may be present on the classpath are

# not visible to this morphline.

importCommands : ["org.kitesdk.**"]

commands : [
  {
    # Parse input attachment and emit a record for each input line              

readLine {
      charset : UTF-8
    }
  }

  ,split {
  inputField : message
  outputFields : "substrings"     
  separator : " "       
  isRegex : false     

  addEmptyStrings : false
  trim : true          }
       }
      }

   ]
  }
 ]

我该怎么办?我是新手

wyyhbhjk

wyyhbhjk1#

来自morhpline文档
outputfield—要向其中添加输出值的字段的名称,即单个字符串。例如:代币。outputfield或outputfields中的一个必须存在,但不能同时存在。
outputfields—要向其中添加输出值的字段的名称,即字符串列表。示例:[firstname,lastname,“,age]。列表中的空字符串表示在输出中忽略此列。outputfield或outputfields中的一个必须存在,但不能同时存在。
所以你应该说明 outputField : substrings 而不是 outputFields : "substrings" http://kitesdk.org/docs/1.1.0/morphlines/morphlines-reference-guide.html#split

相关问题