We have a custom index mapping applied. The field data type for the pertinent field is float. All of the documents indexed for as far back as I can search show a data type of “float” for that field. The index rotated per 1 hour. Now, searches that cross the rotation threshold into the prior index (which worked fine until it was rotated out) and attempt to aggregate data for trending return an error that “type “keyword” is not valid for an aggregation” or “exception [type=aggregation_execution_exception, reason=merging/reducing the aggregations failed when computing the aggregation [agg-1] because the field you gave in the aggregation query existed as two different types in two different indices].”
If I search only within the timeframe of the new index everything works fine. If I search in any timeframe in the previous index, it returns this aggregation error. The messages themselves show the correct field data type as does the custom index mapping on that index.
We look at these graphs every day to monitor trends. Something about the index rotation has manifested this issue. Has anyone else run into this?
This problem same like this thread:
We checked and in a specific one index set there was no index on the field aggregation with other types, we completely deleted all indexes and even recreated index set it anew.
There are others index sets in the elasticsearch cluster that contain this field, but the search and aggregation is performed only in one changed index set
Graylog Graylog 4.2.1+5442e44 + Elasticsearh “version”: {
“number”: “7.10.2”,
“build_flavor”: “oss”,
“build_type”: “rpm”
}
We have applied custom mappings in various ways:
http://domain:9200/_template/l7filter-mapping?pretty
{
"template" : "l7filter_*",
"mappings": {
"properties": {
"BC": {
"type": "long"
},
"BE": {
"type": "keyword"
},
"BS": {
"type": "keyword"
},
"BT": {
"type": "long"
},
"CC": {
"type": "long"
},
"CH": {
"type": "keyword"
},
"DA": {
"type": "keyword"
},
"DM": {
"type": "keyword"
},
"DP": {
"type": "keyword"
},
"GI": {
"type": "keyword"
},
"HC": {
"type": "long"
},
"ID": {
"type": "keyword"
},
"IDT": {
"type": "keyword"
},
"ITD": {
"type": "keyword"
},
"PID": {
"type": "keyword"
},
"RA": {
"type": "keyword"
},
"RDNS": {
"type": "keyword"
},
"REC": {
"type": "keyword"
},
"RH": {
"type": "keyword"
},
"RID": {
"type": "keyword"
},
"RL": {
"type": "long"
},
"RQ": {
"type": "keyword"
},
"RR": {
"type": "keyword"
},
"RS": {
"type": "keyword"
},
"RT": {
"type": "float"
},
"SID": {
"type": "keyword"
},
"SR": {
"type": "keyword"
},
"T": {
"type": "keyword"
},
"UA": {
"type": "keyword"
},
"V": {
"type": "long"
}
}
}
}
AND
http://domain:9200/_template/l7filter-mapping?pretty
{
"template" : "l7filter_*",
"mappings": {
"dynamic_templates": [
{
"l7filter": {
"match_mapping_type": "string",
"match": "RT",
"mapping": {
"type": "float"
}
}
}
]
}
}
AND
http://domain:9200/_template/l7filter-mapping?pretty
{
"template" : "l7filter_*",
"mappings": {
"numeric_detection": true
}
}
Each method works correctly and does exactly the custom mapping that we need in all indices:
We checked this with a query in each index.(In the example below, we changed one field “RT” and tried to do aggregation on it.)
http://domain:9200/l7filter_33/_mapping/
{
"l7filter_33": {
"mappings": {
"dynamic_templates": [
{
"internal_fields": {
"match": "gl2_*",
"match_mapping_type": "string",
"mapping": {
"type": "keyword"
}
}
},
{
"store_generic": {
"match_mapping_type": "string",
"mapping": {
"type": "keyword"
}
}
}
],
"properties": {
"BC": {
"type": "keyword"
},
"BE": {
"type": "keyword"
},
"BS": {
"type": "keyword"
},
"BT": {
"type": "keyword"
},
"CC": {
"type": "long"
},
"CH": {
"type": "keyword"
},
"DA": {
"type": "keyword"
},
"DM": {
"type": "keyword"
},
"DP": {
"type": "keyword"
},
"GI": {
"type": "keyword"
},
"HC": {
"type": "keyword"
},
"ID": {
"type": "keyword"
},
"IDT": {
"type": "keyword"
},
"ITD": {
"type": "keyword"
},
"PID": {
"type": "keyword"
},
"RA": {
"type": "keyword"
},
"RD": {
"type": "keyword"
},
"RDNS": {
"type": "keyword"
},
"REC": {
"type": "keyword"
},
"RH": {
"type": "keyword"
},
"RID": {
"type": "keyword"
},
"RL": {
"type": "keyword"
},
"RQ": {
"type": "keyword"
},
"RR": {
"type": "keyword"
},
"RS": {
"type": "keyword"
},
"RT": {
"type": "float"
},
"SID": {
"type": "keyword"
},
"SR": {
"type": "keyword"
},
"T": {
"type": "keyword"
},
"UA": {
"type": "keyword"
},
"V": {
"type": "long"
},
"full_message": {
"type": "text",
"analyzer": "standard"
},
"gl2_accounted_message_size": {
"type": "long"
},
"gl2_message_id": {
"type": "keyword"
},
"gl2_processing_timestamp": {
"type": "date",
"format": "uuuu-MM-dd HH:mm:ss.SSS"
},
"gl2_receive_timestamp": {
"type": "date",
"format": "uuuu-MM-dd HH:mm:ss.SSS"
},
"gl2_remote_ip": {
"type": "keyword"
},
"gl2_remote_port": {
"type": "long"
},
"gl2_source_input": {
"type": "keyword"
},
"gl2_source_node": {
"type": "keyword"
},
"message": {
"type": "text",
"analyzer": "standard"
},
"source": {
"type": "text",
"analyzer": "analyzer_keyword",
"fielddata": true
},
"streams": {
"type": "keyword"
},
"timestamp": {
"type": "date",
"format": "uuuu-MM-dd HH:mm:ss.SSS"
}
}
}
}
}