0

嗨,我正在尝试使用 morphline inteceptor 并将我的系统日志转换为 JSON 以开始我尝试使用 split 命令来拆分我的字符串,但我收到如下错误:

"" 源 r1 已因配置过程中的错误而被删除 com.typesafe.config.ConfigException$WrongType: /root/flume.17/conf/morph.conf: 21: 无法将对象或列表与非对象或列表连接起来-list, 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          }
       }
      }

   ]
  }
 ]

我该怎么办?我是新手

4

1 回答 1

0

来自 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

于 2017-02-07T20:33:01.883 回答