Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/mongodb/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
fluentd中的JSON解析错误,抛出不总是匹配的模式_Json_Fluent_Fluentd - Fatal编程技术网

fluentd中的JSON解析错误,抛出不总是匹配的模式

fluentd中的JSON解析错误,抛出不总是匹配的模式,json,fluent,fluentd,Json,Fluent,Fluentd,我正在尝试向我的fluentd中添加一个新源来解析JSON文件。JSON文件如下所示 { "local": { "cmd_|-start_cmd_2_|-echo 'Starting to run second time'_|-run": { "comment": "Command \"echo 'Starting to run second time'\" run", "name":

我正在尝试向我的fluentd中添加一个新源来解析JSON文件。JSON文件如下所示

    {
        "local": {
            "cmd_|-start_cmd_2_|-echo 'Starting to run second time'_|-run": {
                "comment": "Command \"echo 'Starting to run second time'\" run",
                "name": "echo 'Starting to run second time'",
                "result": true,
                "duration": 11.144,
                "__sls__": "test",
                "changes": {
                    "pid": 26010,
                    "retcode": 0,
                    "stderr": "",
                    "stdout": "Starting to run second time"
                },
                "__id__": "start_cmd_2"
            },
        }
    }
这是salt堆栈执行的JSON输出。我已经添加了这个来源

    <source>
      @type tail
      tag salt-new
      path /var/log/salt_new.json
      pos_file /tmp/fluentd/new.pos
      <parse>
        @type json
      </parse>
      refresh_interval 10s
    </source>
我不想使用正则表达式解析,我正在尝试让JSON解析器插件工作

任何建议都会非常有用。谢谢

    2020-03-19 18:05:13 +0000 [info]: #0 following tail of /var/log/salt_new.json
    2020-03-19 18:05:13 +0000 [warn]: #0 pattern not matched: "{"
    2020-03-19 18:05:13 +0000 [warn]: #0 pattern not matched: "    \"local\": {"
    2020-03-19 18:05:13 +0000 [warn]: #0 pattern not matched: "        \"cmd_|-start_cmd_2_|-echo 'Starting to run second time'_|-run\": {"
    .
    .