I have followed the steps discussed in link Increase total fields limit via creation of index in logstash but not able to resolve it. Kindly find below few snippets of the configuration files.
output {
elasticsearch {
hosts => ["XX.XX.XX.XX:7001"]
index => "%{Service}_%{+YYYY_ww}"
manage_template => true
template => '/config/etc/logstash/templates/api_template.json'
template_name => 'api'
template_overwrite => true
}
}
Template json as follows:
{
"index_patterns" : "p_bs_api_abcd*",
"version" : 60001,
"settings" : {
"index.refresh_interval" : "5s",
"number_of_shards": 1,
"index.mapping.total_fields.limit": 2000
},
"mappings" : {
"dynamic_templates" : [ {
"message_field" : {
"path_match" : "message",
"match_mapping_type" : "string",
"mapping" : {
"type" : "text",
"norms" : false
}
}
}, {
"string_fields" : {
"match" : "*",
"match_mapping_type" : "string",
"mapping" : {
"type" : "text", "norms" : false,
"fields" : {
"keyword" : { "type": "keyword", "ignore_above": 256 }
}
}
}
} ],
"properties" : {
"@timestamp": { "type": "date"},
"@version": { "type": "keyword"},
"geoip" : {
"dynamic": true,
"properties" : {
"ip": { "type": "ip" },
"location" : { "type" : "geo_point" },
"latitude" : { "type" : "half_float" },
"longitude" : { "type" : "half_float" }
}
}
}
}
}
When I restart the logstash still I am able to see error as below.
[2020-06-03T07:08:17,196][INFO ][logstash.outputs.elasticsearch] Using mapping template from {:path=>"/mnt/storage/software/logstash-7.0.0/config/etc/logstash/templates/api_template.json"}
[2020-06-03T07:08:17,293][INFO ][logstash.outputs.elasticsearch] Attempting to install template {:manage_template=>{"index_patterns"=>"logstash-*", "version"=>60001, "settings"=>{"index.refresh_interval"=>"5s", "number_of_shards"=>1, "index.mapping.total_fields.limit"=>2000, "index.lifecycle.name"=>"logstash-policy", "index.lifecycle.rollover_alias"=>"logstash"}, "mappings"=>{"dynamic_templates"=>[{"message_field"=>{"path_match"=>"message", "match_mapping_type"=>"string", "mapping"=>{"type"=>"text", "norms"=>false}}}, {"string_fields"=>{"match"=>"*", "match_mapping_type"=>"string", "mapping"=>{"type"=>"text", "norms"=>false, "fields"=>{"keyword"=>{"type"=>"keyword", "ignore_above"=>256}}}}}], "properties"=>{"@timestamp"=>{"type"=>"date"}, "@version"=>{"type"=>"keyword"}, "geoip"=>{"dynamic"=>true, "properties"=>{"ip"=>{"type"=>"ip"}, "location"=>{"type"=>"geo_point"}, "latitude"=>{"type"=>"half_float"}, "longitude"=>{"type"=>"half_float"}}}}}}}
[2020-06-03T07:08:17,321][INFO ][logstash.outputs.elasticsearch] Installing elasticsearch template to _template/api
[2020-06-03T07:12:16,988][WARN ][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"p_bs_api_abcd_2020_23", :_type=>"_doc", :routing=>nil}, #LogStash::Event:0x4b6e8b56], :response=>{"index"=>{"_index"=>"p_bs_api_abcd_2020_23", "_type"=>"_doc", "_id"=>"GXjPeHIBIVr3QtguFT6g", "status"=>400, "error"=>{"type"=>"illegal_argument_exception", "reason"=>"Limit of total fields [1000] in index [p_bs_api_abcd_2020_23] has been exceeded"}}}}
@theuntergeek @Christian_Dahlqvist - Have looped you in since you guys have solved the issue in the thread I followed so kindly pointing out where I have went wrong.
Cheers,
Maadavan