Thanks for the response. When I change it to that I get the following error:
so filter:
filter {
json {
source => "message"
}
}
Error
[WARN ] 2021-08-08 11:39:16.919 [[main]>worker0] json - Error parsing json {:source=>"message", :raw=>"{", :exception=>#<LogStash::Json::ParserError: Unexpected end-of-input: expected close marker for Object (start marker at [Source: (byte[])"{"; line: 1, column: 1])
at [Source: (byte[])"{"; line: 1, column: 3]>}
[WARN ] 2021-08-08 11:39:16.920 [[main]>worker1] json - Error parsing json {:source=>"message", :raw=>" \"TEST\" : {", :exception=>#<LogStash::Json::ParserError: Unexpected character (':' (code 58)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
at [Source: (byte[])" "TEST" : {"; line: 1, column: 11]>}
[WARN ] 2021-08-08 11:39:16.923 [[main]>worker1] json - Error parsing json {:source=>"message", :raw=>" \"dataRec\" : {", :exception=>#<LogStash::Json::ParserError: Unexpected character (':' (code 58)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
at [Source: (byte[])" "dataRec" : {"; line: 1, column: 16]>}
[WARN ] 2021-08-08 11:39:16.924 [[main]>worker1] json - Error parsing json {:source=>"message", :raw=>" \"eventName\" : \"IN\",", :exception=>#<LogStash::Json::ParserError: Unexpected character (':' (code 58)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
at [Source: (byte[])" "eventName" : "IN","; line: 1, column: 20]>}
[WARN ] 2021-08-08 11:39:16.925 [[main]>worker1] json - Error parsing json {:source=>"message", :raw=>" \"date\" : \"210721\",", :exception=>#<LogStash::Json::ParserError: Unexpected character (':' (code 58)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
at [Source: (byte[])" "date" : "210721","; line: 1, column: 15]>}
[WARN ] 2021-08-08 11:39:16.926 [[main]>worker1] json - Error parsing json {:source=>"message", :raw=>" \"time\" : \"06:27:56\",", :exception=>#<LogStash::Json::ParserError: Unexpected character (':' (code 58)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
at [Source: (byte[])" "time" : "06:27:56","; line: 1, column: 15]>}
[WARN ] 2021-08-08 11:39:16.927 [[main]>worker1] json - Error parsing json {:source=>"message", :raw=>" \"accountID\" : \"TEST \",", :exception=>#<LogStash::Json::ParserError: Unexpected character (':' (code 58)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
at [Source: (byte[])" "accountID" : "TEST ","; line: 1, column: 20]>}
[WARN ] 2021-08-08 11:39:16.928 [[main]>worker1] json - Error parsing json {:source=>"message", :raw=>" \"department\" : \"TEST0001\",", :exception=>#<LogStash::Json::ParserError: Unexpected character (':' (code 58)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
at [Source: (byte[])" "department" : "TEST0001","; line: 1, column: 21]>}
[WARN ] 2021-08-08 11:39:16.929 [[main]>worker1] json - Error parsing json {:source=>"message", :raw=>" \"jobName\" : \"QRTSDHL4\",", :exception=>#<LogStash::Json::ParserError: Unexpected character (':' (code 58)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
at [Source: (byte[])" "jobName" : "QRTSDHL4","; line: 1, column: 18]>}
[WARN ] 2021-08-08 11:39:16.930 [[main]>worker1] json - Error parsing json {:source=>"message", :raw=>" \"terminalID\" : \"ABC21QJ2\",", :exception=>#<LogStash::Json::ParserError: Unexpected character (':' (code 58)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
at [Source: (byte[])" "terminalID" : "ABC21QJ2","; line: 1, column: 21]>}
[WARN ] 2021-08-08 11:39:16.931 [[main]>worker1] json - Error parsing json {:source=>"message", :raw=>" \"facilityName\" : \"TESTPREPROD\",", :exception=>#<LogStash::Json::ParserError: Unexpected character (':' (code 58)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
at [Source: (byte[])" "facilityName" : "TESTPREPROD","; line: 1, column: 23]>}
[WARN ] 2021-08-08 11:39:16.932 [[main]>worker1] json - Error parsing json {:source=>"message", :raw=>" \"returnCode\" : \"00\",", :exception=>#<LogStash::Json::ParserError: Unexpected character (':' (code 58)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
at [Source: (byte[])" "returnCode" : "00","; line: 1, column: 21]>}
[WARN ] 2021-08-08 11:39:16.933 [[main]>worker1] json - Error parsing json {:source=>"message", :raw=>" \"detailsReasonCode\" : \"TEST \",", :exception=>#<LogStash::Json::ParserError: Unexpected character (':' (code 58)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
at [Source: (byte[])" "detailsReasonCode" : "TEST ","; line: 1, column: 28]>}
[WARN ] 2021-08-08 11:39:16.934 [[main]>worker1] json - Error parsing json {:source=>"message", :raw=>" \"userName\" : \"1234567,LAST,FIRST (ABCDEF) \"", :exception=>#<LogStash::Json::ParserError: Unexpected character (':' (code 58)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
at [Source: (byte[])" "userName" : "1234567,LAST,FIRST (ABCDEF) ""; line: 1, column: 19]>}
[WARN ] 2021-08-08 11:39:16.937 [[main]>worker1] json - Error parsing json {:source=>"message", :raw=>" }", :exception=>#<LogStash::Json::ParserError: Unexpected close marker '}': expected ']' (for root starting at [Source: (byte[])" }"; line: 1, column: 0])
at [Source: (byte[])" }"; line: 1, column: 6]>}
[WARN ] 2021-08-08 11:39:16.954 [[main]>worker1] json - Error parsing json {:source=>"message", :raw=>" }", :exception=>#<LogStash::Json::ParserError: Unexpected close marker '}': expected ']' (for root starting at [Source: (byte[])" }"; line: 1, column: 0])
at [Source: (byte[])" }"; line: 1, column: 4]>}
[WARN ] 2021-08-08 11:39:16.957 [[main]>worker1] json - Error parsing json {:source=>"message", :raw=>"}", :exception=>#<LogStash::Json::ParserError: Unexpected close marker '}': expected ']' (for root starting at [Source: (byte[])"}"; line: 1, column: 0])
at [Source: (byte[])"}"; line: 1, column: 2]>}
[WARN ] 2021-08-08 11:39:16.959 [[main]>worker1] json - Parsed JSON object/hash requires a target configuration option {:source=>"message", :raw=>""}
{
"@timestamp" => 2021-08-08T15:39:16.596Z,
"tags" => [
[0] "_jsonparsefailure"
],
"@version" => "1",
"host" => "testhost.ca",
"path" => "/home/example/test2.log",
"message" => "{"
}
[INFO ] 2021-08-08 11:39:17.235 [[main]>worker0] file - Opening file {:path=>"/home/example/output.log"}
{
"@timestamp" => 2021-08-08T15:39:16.622Z,
"tags" => [
[0] "_jsonparsefailure"
],
"@version" => "1",
"host" => "testhost.ca",
"path" => "/home/example/test2.log",
"message" => " \"TEST\" : {"
}
{
"@timestamp" => 2021-08-08T15:39:16.623Z,
"tags" => [
[0] "_jsonparsefailure"
],
"@version" => "1",
"host" => "testhost.ca",
"path" => "/home/example/test2.log",
"message" => " \"dataRec\" : {"
}
{
"@timestamp" => 2021-08-08T15:39:16.623Z,
"tags" => [
[0] "_jsonparsefailure"
],
"@version" => "1",
"host" => "testhost.ca",
"path" => "/home/example/test2.log",
"message" => " \"eventName\" : \"IN\","
}
{
"@timestamp" => 2021-08-08T15:39:16.624Z,
"tags" => [
[0] "_jsonparsefailure"
],
"@version" => "1",
"host" => "testhost.ca",
"path" => "/home/example/test2.log",
"message" => " \"date\" : \"210721\","
}
{
"@timestamp" => 2021-08-08T15:39:16.624Z,
"tags" => [
[0] "_jsonparsefailure"
],
"@version" => "1",
"host" => "testhost.ca",
"path" => "/home/example/test2.log",
"message" => " \"time\" : \"06:27:56\","
}
{
"@timestamp" => 2021-08-08T15:39:16.624Z,
"tags" => [
[0] "_jsonparsefailure"
],
"@version" => "1",
"host" => "testhost.ca",
"path" => "/home/example/test2.log",
"message" => " \"accountID\" : \"TEST \","
}
{
"@timestamp" => 2021-08-08T15:39:16.625Z,
"tags" => [
[0] "_jsonparsefailure"
],
"@version" => "1",
"host" => "testhost.ca",
"path" => "/home/example/test2.log",
"message" => " \"department\" : \"TEST0001\","
}
{
"@timestamp" => 2021-08-08T15:39:16.625Z,
"tags" => [
[0] "_jsonparsefailure"
],
"@version" => "1",
"host" => "testhost.ca",
"path" => "/home/example/test2.log",
"message" => " \"jobName\" : \"QRTSDHL4\","
}
{
"@timestamp" => 2021-08-08T15:39:16.625Z,
"tags" => [
[0] "_jsonparsefailure"
],
"@version" => "1",
"host" => "testhost.ca",
"path" => "/home/example/test2.log",
"message" => " \"terminalID\" : \"ABC21QJ2\","
}
{
"@timestamp" => 2021-08-08T15:39:16.626Z,
"tags" => [
[0] "_jsonparsefailure"
],
"@version" => "1",
"host" => "testhost.ca",
"path" => "/home/example/test2.log",
"message" => " \"facilityName\" : \"TESTPREPROD\","
}