Hi Guys
I'm trying to configure the new version logstash (7.x)
Everything is working as prefect, logstash is running and I can see my logs on kibana . BUT the mapping/parsing elasticsearch isn't working
Following, the config of the new logstash :
My config file : logstash.conf
(This works fine but the template part isn't well configured I guess).
input {
kafka {
topics => ["nifi-xxx-fab","nifi-yyy-fab"]
client_id => "logstash-FAB"
group_id => "Logs-FAB"
bootstrap_servers => '10.200.175.xxx:15011,10.200.175.xxx:15012,10.200.xxx.152:15013'
consumer_threads => 3
}
}
filter {
if [type] == "weblogic-xxx" {
date {
match => [ "date", "MMM d, yyyy, H:mm:ss,SSS a" ]
}
}
}
output {
elasticsearch {
hosts => ["elastixxxx:xxxx", "elastixxxx:xxxx", "elastixxxx:xxxx"]
index => "logstash-%{+YYYY.MM.dd}"
**template => "/usr/share/logstash/pipeline/elasticsearch-template.json"**
template_overwrite => "true"
}
}
my elasticsearch-template.json looks like this :
{
"index_patterns" : "logstash-*",
"settings" : {
"index" : {
"refresh_interval" : "5s"
}
},
"mappings" : {
"dynamic_templates" : [
{
"message_field" : {
"match" : "message",
"match_mapping_type" : "string",
"mapping" : {
"type" : "string"
}
}
},
{
"string_fields" : {
"match_mapping_type" : "string",
"mapping" : {
"type" : "string",
"fields" : {
"raw" : {
"type": "string",
"ignore_above" : 256
}
}
}
}
}
]
}
}
My config of the docker logstash .yml
logstash:
image: docker-virtual.artefact-repo.pole-emploi.intra/logstash/logstash:7.0.1
ports:
- "xxxx:xxxx"
- "xxxx:xxxx"
volumes:
- /nas/donapp/docke/_fsb/swmxor10/oxxx/logstash/config/logstash.yml:/usr/share/logstash/config/logstash.yml
- /nas/donapp/docke/_fsb/swmxor10/oixxx/logstash/pipeline/logstash.conf:/usr/share/logstash/pipeline/logstash.conf
- /nas/donapp/docke/_fsb/swmxor10/oi071/logstash/pipeline/elasticsearch-template.json:/usr/share/logstash/pipeline/elasticsearch-template.json
So when I deploy logstash. I got the following erreur :
message=>"Expected one of #, input, filter, output at line 1,
and without the template thing, it works so I am pretty sure that the error come from the configuration of my elasticsearch-template
my old config of the template is as follow ( and this was working so fine)
{
"template" : "logstash-*",
"settings" : {
"index.refresh_interval" : "5s"
},
"mappings" : {
"_default_" : {
"_all" : {"enabled" : true, "omit_norms" : true},
"dynamic_templates" : [ {
"message_field" : {
"match" : "message",
"match_mapping_type" : "string",
"mapping" : {
"type" : "string", "index" : "analyzed", "omit_norms" : true
}
}
}, {
"string_fields" : {
"match" : "*",
"match_mapping_type" : "string",
"mapping" : {
"type" : "string", "index" : "analyzed", "omit_norms" : true,
"fields" : {
"raw" : {"type": "string", "index" : "not_analyzed", "ignore_above" : 256}
}
}
}
} ],
"properties" : {
"@version": { "type": "string", "index": "not_analyzed" },
"geoip" : {
"type" : "object",
"dynamic": true,
"properties" : {
"location" : { "type" : "geo_point" }
}
}
}
}
}
}
Thank you guys for your help.
Regards