JSON parse failure

 Error parsing json {:source=>"message", :raw=>"Error running job", :exception=>#<LogStash::Json::ParserError: Unrecognized token 'Error': was expecting ('true', 'false' or 'null')
 at [Source: (byte[])"Error running job"; line: 1, column: 7]>}
{
     "extractCount" => -1,
             "host" => "127.0.0.1",
    "jobHistoryUrl" => "api",
           "status" => "ERROR",
          "dagName" => "name",
        "startDate" => "2024-03-19T22:37:20+00:00",
     "createdFiles" => [],
          "headers" => {
           "request_path" => "/",
        "http_user_agent" => "Java/17.0.10",
              "http_host" => "127.0.0.1:8081",
         "content_length" => "623",
            "http_accept" => "text/plain, application/json, application/*+json, */*",
           "http_version" => "HTTP/1.1",
             "connection" => "keep-alive",
           "content_type" => "text/plain;charset=ISO-8859-1",
         "request_method" => "POST"
    },
           "errors" => [
        [0] "file_sensor: Failed"
    ],
             "tags" => [
        [0] "_jsonparsefailure"
    ],
          "jobName" => "data",
    "workspaceName" => "work",
    "hdfsSavePaths" => [
        [0] "path"
    ],
          "appCode" => "weq",
          "message" => "Error running job",
         "@version" => "1",
       "@timestamp" => 2024-03-19T22:51:17.164Z
}
[2024-03-19T18:51:54,744][WARN ][logstash.filters.json    ][main][b9914b91c5592ef6b19792acc52eedc9fc5809c550a4a267cc0a43452969fc79] Error parsing json {:source=>"message", :raw=>"Error running job", :exception=>#<LogStash::Json::ParserError: Unrecognized token 'Error': was expecting ('true', 'false' or 'null')
 at [Source: (byte[])"Error running job"; line: 1, column: 7]>}

You are trying to parse that as though it were JSON, but it is not.

1 Like

Thanks Badger, it resolved the issue

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.