I have renamed the field in the filebeat so that it would not use a field which is already mapped in the template. I have output-ed in stdout which works fine but the elasticsearch output is still not working. Elasticsearch is up and running since other beats like metricbeat is working fine with it. I have no idea why some of the parse output goes into elasticsearch and others won't since they all come from the same servers and in the stdout they look valid json format with no errors. For example:
{
"services" => "jetty",
"offset" => 45560500,
"message" => "[GC (Allocation Failure) 1010314K->688618K(1039872K), 0.0265723 secs]",
"tags" => [
[0] "jetty",
[1] "beats_input_codec_plain_applied"
],
"input" => {
"type" => "log"
},
"current_heap_size" => "1039872",
"@timestamp" => 2018-11-22T02:12:48.907Z,
"beat" => {
"name" => "vps66968.redcapcloud.com",
"version" => "6.5.0",
"hostname" => "vps66968.redcapcloud.com"
},
"used_start" => "1010314",
"used_after_gc" => "688618",
"gc_time" => "0.0265723",
"prospector" => {
"type" => "log"
},
"@environment" => "RCC-RCDEV",
"source" => "/home/jetty/logs/2018-11-21-16-28-jetty.log",
"meta" => {
"cloud" => {
"machine_type" => "vps-ovhssd-3",
"availability_zone" => "nova",
"instance_id" => "i-00147482",
"instance_name" => "vps66968",
"provider" => "openstack"
}
},
"@version" => "1",
"system" => {
"jetty" => {
"method" => "GC",
"severity" => "FINEST",
"data" => "[GC (Allocation Failure) 1010314K->688618K(1039872K), 0.0265723 secs]"
}
}
}
as working output which got into elasticsearch and:
{
"services" => "jetty",
"offset" => 45560358,
"message" => "Nov 21, 2018 9:12:47 PM com.candorgrc.core.webservice.rest.exceptionmapper.ExceptionsMapper toResponse\nSEVERE: \njava.lang.ClassCastException\n",
"tags" => [
[0] "jetty",
[1] "beats_input_codec_plain_applied"
],
"input" => {
"type" => "log"
},
"@timestamp" => 2018-11-21T21:12:47.000Z,
"beat" => {
"name" => "vps66968.redcapcloud.com",
"version" => "6.5.0",
"hostname" => "vps66968.redcapcloud.com"
},
"log" => {
"flags" => [
[0] "multiline"
]
},
"prospector" => {
"type" => "log"
},
"@environment" => "RCC-RCDEV",
"source" => "/home/jetty/logs/2018-11-21-16-28-jetty.log",
"meta" => {
"cloud" => {
"machine_type" => "vps-ovhssd-3",
"availability_zone" => "nova",
"instance_id" => "i-00147482",
"instance_name" => "vps66968",
"provider" => "openstack"
}
},
"@version" => "1",
"system" => {
"jetty" => {
"class" => "com.candorgrc.core.webservice.rest.exceptionmapper.ExceptionsMapper",
"method" => "toResponse",
"severity" => "SEVERE",
"data" => "\njava.lang.ClassCastException\n"
}
}
}
This is as failed result(not got into elasticsearch for some reason which I cannot find).
Any idea what can be the difference between the two outputs of the same file and same filebeat parsed by the same logstash.