I have configured my logstash inputs as:
input {
stdin { }
gelf {
host => "0.0.0.0"
port => 12201
codec => multiline {
pattern => "^\s"
what => "previous"
}
}
udp {
codec => json
port => 5001
}
tcp {
port => 5000
codec => json
}
beats {
port => 5044
}
http {
port => 8000
type => "elb-healthcheck"
}
}
I can see that the plugin is loading in logs
[2018-10-17T15:32:31,548][DEBUG][logstash.codecs.multiline] config LogStash::Codecs::Multiline/@pattern = "^\\s"
[2018-10-17T15:32:31,549][DEBUG][logstash.codecs.multiline] config LogStash::Codecs::Multiline/@what = "previous"
[2018-10-17T15:32:31,549][DEBUG][logstash.codecs.multiline] config LogStash::Codecs::Multiline/@id = "7d130818-b874-458a-ae2b-95b4ed9b803e"
[2018-10-17T15:32:31,549][DEBUG][logstash.codecs.multiline] config LogStash::Codecs::Multiline/@enable_metric = true
[2018-10-17T15:32:31,549][DEBUG][logstash.codecs.multiline] config LogStash::Codecs::Multiline/@negate = false
[2018-10-17T15:32:31,550][DEBUG][logstash.codecs.multiline] config LogStash::Codecs::Multiline/@patterns_dir = []
[2018-10-17T15:32:31,550][DEBUG][logstash.codecs.multiline] config LogStash::Codecs::Multiline/@charset = "UTF-8"
[2018-10-17T15:32:31,550][DEBUG][logstash.codecs.multiline] config LogStash::Codecs::Multiline/@multiline_tag = "multiline"
[2018-10-17T15:32:31,551][DEBUG][logstash.codecs.multiline] config LogStash::Codecs::Multiline/@max_lines = 500
[2018-10-17T15:32:31,551][DEBUG][logstash.codecs.multiline] config LogStash::Codecs::Multiline/@max_bytes = 10485760
....
....
....
[2018-10-17T15:32:31,786][DEBUG][logstash.codecs.multiline] Grok loading patterns from file {:path=>"/opt/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-patterns-core-4.1.2/patterns/maven"}
[2018-10-17T15:32:31,786][DEBUG][logstash.codecs.multiline] Grok loading patterns from file {:path=>"/opt/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-patterns-core-4.1.2/patterns/squid"}
[2018-10-17T15:32:31,804][TRACE][logstash.codecs.multiline] Registered multiline plugin {:type=>nil, :config=>{"pattern"=>"^\\s", "what"=>"previous", "id"=>"7d130818-b874-458a-ae2b-95b4ed9b803e", "enable_metric"=>true, "negate"=>false, "patterns_dir"=>[], "charset"=>"UTF-8", "multiline_tag"=>"multiline", "max_lines"=>500, "max_bytes"=>10485760}}
But I am still not getting a multiline compression with java logs that follow this pattern. See logstash logs below:
[2018-10-17T15:34:20,357][DEBUG][logstash.pipeline ] output received {"event"=>{"version"=>"1.1", "message"=>"2018-10-17 19:34:20.170 INFO 1 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]", "container_name"=>"ecs-sand-accounting-gl-service-18-sand-accounting-gl-service-ea8dd4c1be9ad2a7dd01", "image_name"=>"038131160342.dkr.ecr.us-east-1.amazonaws.com/accounting-gl-service:efffa2b850182bea02e4b4a2b80c55818245ed98", "level"=>6, "container_id"=>"f4c7500a7920ba28e09c0050557c559cd53f424279db92c3e81b99218dc5918e", "tag"=>"sand-accounting-gl-service", "@version"=>"1", "created"=>"2018-10-17T19:33:51.747006428Z", "command"=>"java -jar accounting-gl-api.jar", "host"=>"ip-10-90-66-54", "@timestamp"=>2018-10-17T19:34:20.171Z, "image_id"=>"sha256:37659d83db2c18a0e51052036340456c41432e513b0f3463b0a4624af6a3455d", "source_host"=>"10.90.66.54"}}
[2018-10-17T15:34:20,357][DEBUG][logstash.pipeline ] output received {"event"=>{"version"=>"1.1", "container_name"=>"ecs-sand-multitenant-microservice-1-sand-multitenant-microservice-92e4f092d9eef8996200", "image_name"=>"038131160342.dkr.ecr.us-east-1.amazonaws.com/multitenant-microservice:12584d13310d3ff836ff4f37842d1556ea2a98a6", "level"=>6, "short_message"=>"", "container_id"=>"4c0be547f8a7724ccab95ab2f64cf09a6ab3f75ce5f93adedadba3119b45ac72", "tag"=>"sand-multitenant-microservice", "@version"=>"1", "created"=>"2018-10-17T19:30:10.123095574Z", "command"=>"java -jar multitenant-microservice.jar", "host"=>"ip-10-90-66-168", "@timestamp"=>2018-10-17T19:34:20.243Z, "image_id"=>"sha256:12f59bfb89234141d9b0b1e583489563c8644e63b145f0a266a9476a3ddb1f90", "source_host"=>"10.90.66.168"}}
[2018-10-17T15:34:20,358][DEBUG][logstash.pipeline ] output received {"event"=>{"version"=>"1.1", "message"=>" /\\\\ / ___'_ __ _ _(_)_ __ __ _ \\ \\ \\ \\", "container_name"=>"ecs-sand-multitenant-microservice-1-sand-multitenant-microservice-92e4f092d9eef8996200", "image_name"=>"038131160342.dkr.ecr.us-east-1.amazonaws.com/multitenant-microservice:12584d13310d3ff836ff4f37842d1556ea2a98a6", "level"=>6, "container_id"=>"4c0be547f8a7724ccab95ab2f64cf09a6ab3f75ce5f93adedadba3119b45ac72", "tag"=>"sand-multitenant-microservice", "@version"=>"1", "created"=>"2018-10-17T19:30:10.123095574Z", "command"=>"java -jar multitenant-microservice.jar", "host"=>"ip-10-90-66-168", "@timestamp"=>2018-10-17T19:34:20.244Z, "image_id"=>"sha256:12f59bfb89234141d9b0b1e583489563c8644e63b145f0a266a9476a3ddb1f90", "source_host"=>"10.90.66.168"}}
[2018-10-17T15:34:20,358][DEBUG][logstash.pipeline ] output received {"event"=>{"version"=>"1.1", "message"=>" \\\\/ ___)| |_)| | | | | || (_| | ) ) ) )", "container_name"=>"ecs-sand-multitenant-microservice-1-sand-multitenant-microservice-92e4f092d9eef8996200", "image_name"=>"038131160342.dkr.ecr.us-east-1.amazonaws.com/multitenant-microservice:12584d13310d3ff836ff4f37842d1556ea2a98a6", "level"=>6, "container_id"=>"4c0be547f8a7724ccab95ab2f64cf09a6ab3f75ce5f93adedadba3119b45ac72", "tag"=>"sand-multitenant-microservice", "@version"=>"1", "created"=>"2018-10-17T19:30:10.123095574Z", "command"=>"java -jar multitenant-microservice.jar", "host"=>"ip-10-90-66-168", "@timestamp"=>2018-10-17T19:34:20.246Z, "image_id"=>"sha256:12f59bfb89234141d9b0b1e583489563c8644e63b145f0a266a9476a3ddb1f90", "source_host"=>"10.90.66.168"}}
[2018-10-17T15:34:20,358][DEBUG][logstash.pipeline ] output received {"event"=>{"version"=>"1.1", "message"=>" =========|_|==============|___/=/_/_/_/", "container_name"=>"ecs-sand-multitenant-microservice-1-sand-multitenant-microservice-92e4f092d9eef8996200", "image_name"=>"038131160342.dkr.ecr.us-east-1.amazonaws.com/multitenant-microservice:12584d13310d3ff836ff4f37842d1556ea2a98a6", "level"=>6, "container_id"=>"4c0be547f8a7724ccab95ab2f64cf09a6ab3f75ce5f93adedadba3119b45ac72", "tag"=>"sand-multitenant-microservice", "@version"=>"1", "created"=>"2018-10-17T19:30:10.123095574Z", "command"=>"java -jar multitenant-microservice.jar", "host"=>"ip-10-90-66-168", "@timestamp"=>2018-10-17T19:34:20.246Z, "image_id"=>"sha256:12f59bfb89234141d9b0b1e583489563c8644e63b145f0a266a9476a3ddb1f90", "source_host"=>"10.90.66.168"}}
[2018-10-17T15:34:20,390][DEBUG][logstash.pipeline ] filter received {"event"=>{"version"=>"1.1", "message"=>"2018-10-17 19:34:20.130 INFO 1 --- [
I believe the above should be one INFO for the output.
Thanks for the help!!!!