Hi,
I'm attempting to get my cloudfront logs into a local elasticsearch cluster (7.8.0) and am having a bit of trouble.
The template I'm attempting to import is from here
https://aws.amazon.com/premiumsupport/knowledge-center/cloudfront-logs-elasticsearch/
#cloudfront.template.json
{
"template": "cloudfront-logs-*",
"mappings": {
"logs": {
"_source": {
"enabled": false
},
"_all": {
"enabled": false
},
"dynamic_templates": [
{
"string_fields": {
"mapping": {
"index": "not_analyzed",
"type": "string"
},
"match_mapping_type": "string",
"match": "*"
}
}
],
"properties": {
"geoip": {
"dynamic": true,
"properties": {
"ip": {
"type": "ip"
},
"location": {
"type": "geo_point"
},
"latitude": {
"type": "float"
},
"longitude": {
"type": "float"
}
}
}
}
}
}
}
so I've created an index:
curl -XPUT "http://elasticsearch:9200/cloudfront-logs"
and attempting to add the template:
curl -XPUT "http://elasticsearch:9200/_template/cloudfront-logs/" -H "Content-Type: application/json" -d "@cloudfront.template.json" | jq .
gives me the following
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "Root mapping definition has unsupported parameters: [logs : {_source={enabled=false}, dynamic_templates=[{string_fields={mapping={index=not_analyzed, type=string}, match_mapping_type=string, match=*}}], _all={enabled=false}, properties={geoip={dynamic=true, properties={ip={type=ip}, latitude={type=float}, location={type=geo_point}, longitude={type=float}}}}}]"
}
],
"type": "mapper_parsing_exception",
"reason": "Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters: [logs : {_source={enabled=false}, dynamic_templates=[{string_fields={mapping={index=not_analyzed, type=string}, match_mapping_type=string, match=*}}], _all={enabled=false}, properties={geoip={dynamic=true, properties={ip={type=ip}, latitude={type=float}, location={type=geo_point}, longitude={type=float}}}}}]",
"caused_by": {
"type": "mapper_parsing_exception",
"reason": "Root mapping definition has unsupported parameters: [logs : {_source={enabled=false}, dynamic_templates=[{string_fields={mapping={index=not_analyzed, type=string}, match_mapping_type=string, match=*}}], _all={enabled=false}, properties={geoip={dynamic=true, properties={ip={type=ip}, latitude={type=float}, location={type=geo_point}, longitude={type=float}}}}}]"
}
},
"status": 400
}
Which I'm guessing is something in the template it doesn't like.
Can anyone please tell me what it is?..
Most of my elastic experience has been with maintaining the indexes for bitbucket (since v5 with ES2.4), so I've got the basics. Now I'm attempting to get all the systems logging into the cluster via logstash.
Thanks,
Sean