-
Notifications
You must be signed in to change notification settings - Fork 441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Verify mapping problems after migrating to ecs@mappings #10848
Comments
Checking the first field, # packages/azure/data_stream/graphactivitylogs/fields/ecs.yml
- name: client.geo.location.lat
external: ecs
- name: client.geo.location.lon
external: ecs
- name: source.geo.location.lat
external: ecs
- name: source.geo.location.lon
external: ecs This leads to the following mapping: "client": {
"properties": {
"geo": {
"properties": {
"continent_name": {
"type": "keyword",
"ignore_above": 1024
},
"country_iso_code": {
"type": "keyword",
"ignore_above": 1024
},
"country_name": {
"type": "keyword",
"ignore_above": 1024
},
"location": {
"properties": {
"lat": {
"type": "geo_point"
},
"lon": {
"type": "geo_point"
}
}
}
}
},
"ip": {
"type": "ip"
}
}
} So Paradoxically, if I index the same document using a
{
".ds-logs-whatever-sdh5075-2024.08.22-000001": {
"mappings": {
"client.geo.location": {
"full_name": "client.geo.location",
"mapping": {
"location": {
"type": "geo_point"
}
}
}
}
}
} This seems a choice in the |
We're getting a While in most cases it is mapped as We have a sample document where we clearly see Beats / Elastic Agent can send |
Adding fieldless search as an undesired side-effect of switching to ecs@mappings on 8.13.x. |
Align `client|source.geo.location` fields to ECS mapping. Users reported mapping exceptions due to Elasticsearch mapping the `client|source.geo.location` fields as `object` instead of `geo_point`. See #10848 for more.
Add ECS mapping for the `host.os.version` field (`keyword` type). Users reported mapping exceptions due to `host.os.version` numeric values causing field mapping as `float` instead of `long`. See #10848 (comment) for more. Elasticsearch maps a field as a `float` if it has a numeric value. This happens even on stack versions 8.13+ because ecs@mappings does not perform type coercion. For example, Elasticsearch maps `7.9` as `float`, while it maps `"7.9" or "7.9 (Maipo)"` as `keyword`. By adding the `host.os.version` field to the file `fields/ecs.yml`, we ensure Elasticsearch uses the expected ECS field mapping as a `keyword` even when the value is a number. IMPORTANT: To fully resolve the issue, the input/integration owner should update it to emit the right value type to leverage ecs@mappings.
So this is why event.duration in azure.eventhub integration is mapped as keyword in 8.13.4.. This is a very unfortunate and concerning issue. ECS compliant mappings are so important. When would this issue get fixed? Or is it already fixed in 8.16? |
The problem is that the `ecs@mappings` component template (introduced in >=8.13.0) does not perform type coercion to long when the value was a string. In this specific integration scenario, the `event.severity` value was provided as a string. So the dynamic mapping never matched, which left `event.severity` with the default 'keyword' mapping type, which does not comply with ECS. This change adds back the static mapping for `event.severity` and modifies the grok pattern to perform conversion to long. Relates: #10848 --------- Co-authored-by: Andrew Kroh <andrew.kroh@elastic.co>
@willemdh, I'm sorry for the late response. This is a problem on the integration side; you mentioned the generic I created the GH issue #12400 so we can follow this problem there. |
After reviewing the issues tracked here, we addressed all problems, or they have dedicated tracking issues. Please feel free to reopen and mention me if you see something that needs attention. |
) Align `client|source.geo.location` fields to ECS mapping. Users reported mapping exceptions due to Elasticsearch mapping the `client|source.geo.location` fields as `object` instead of `geo_point`. See elastic#10848 for more.
Add ECS mapping for the `host.os.version` field (`keyword` type). Users reported mapping exceptions due to `host.os.version` numeric values causing field mapping as `float` instead of `long`. See elastic#10848 (comment) for more. Elasticsearch maps a field as a `float` if it has a numeric value. This happens even on stack versions 8.13+ because ecs@mappings does not perform type coercion. For example, Elasticsearch maps `7.9` as `float`, while it maps `"7.9" or "7.9 (Maipo)"` as `keyword`. By adding the `host.os.version` field to the file `fields/ecs.yml`, we ensure Elasticsearch uses the expected ECS field mapping as a `keyword` even when the value is a number. IMPORTANT: To fully resolve the issue, the input/integration owner should update it to emit the right value type to leverage ecs@mappings.
The problem is that the `ecs@mappings` component template (introduced in >=8.13.0) does not perform type coercion to long when the value was a string. In this specific integration scenario, the `event.severity` value was provided as a string. So the dynamic mapping never matched, which left `event.severity` with the default 'keyword' mapping type, which does not comply with ECS. This change adds back the static mapping for `event.severity` and modifies the grok pattern to perform conversion to long. Relates: elastic#10848 --------- Co-authored-by: Andrew Kroh <andrew.kroh@elastic.co>
The problem is that the `ecs@mappings` component template (introduced in >=8.13.0) does not perform type coercion to long when the value was a string. In this specific integration scenario, the `event.severity` value was provided as a string. So the dynamic mapping never matched, which left `event.severity` with the default 'keyword' mapping type, which does not comply with ECS. This change adds back the static mapping for `event.severity` and modifies the grok pattern to perform conversion to long. Relates: #10848 --------- Co-authored-by: Andrew Kroh <andrew.kroh@elastic.co>
) Align `client|source.geo.location` fields to ECS mapping. Users reported mapping exceptions due to Elasticsearch mapping the `client|source.geo.location` fields as `object` instead of `geo_point`. See elastic#10848 for more.
Add ECS mapping for the `host.os.version` field (`keyword` type). Users reported mapping exceptions due to `host.os.version` numeric values causing field mapping as `float` instead of `long`. See elastic#10848 (comment) for more. Elasticsearch maps a field as a `float` if it has a numeric value. This happens even on stack versions 8.13+ because ecs@mappings does not perform type coercion. For example, Elasticsearch maps `7.9` as `float`, while it maps `"7.9" or "7.9 (Maipo)"` as `keyword`. By adding the `host.os.version` field to the file `fields/ecs.yml`, we ensure Elasticsearch uses the expected ECS field mapping as a `keyword` even when the value is a number. IMPORTANT: To fully resolve the issue, the input/integration owner should update it to emit the right value type to leverage ecs@mappings.
The problem is that the `ecs@mappings` component template (introduced in >=8.13.0) does not perform type coercion to long when the value was a string. In this specific integration scenario, the `event.severity` value was provided as a string. So the dynamic mapping never matched, which left `event.severity` with the default 'keyword' mapping type, which does not comply with ECS. This change adds back the static mapping for `event.severity` and modifies the grok pattern to perform conversion to long. Relates: elastic#10848 --------- Co-authored-by: Andrew Kroh <andrew.kroh@elastic.co>
A few users reported mapping errors on a few integrations. We suspect these problems may be related to integrations that migrated to ecs@mappings with recent updates.
Here is the list of fields with mapping issues:
client.geo.location
geo_point
object
logs-azure.graphactivitylogs-*
source.geo.location
geo_point
object
logs-azure.graphactivitylogs-*
destination.port
long
keyword
logs-cisco_aironet.log-*
event.duration
long
keyword
logs-azure.activitylogs.log-*
dns.authorities
dns.id
long
keyword
logs-logstash.tpot-*
error.code
keyword
long
logs-system.security-*
keyword
https://www.elastic.co/guide/en/ecs/current/ecs-error.html#field-error-codeevent.severity
long
keyword
logs-cisco_aironet.log-*
{"event.severity": "4"}
; ECS expected type islong
https://www.elastic.co/guide/en/ecs/current/ecs-event.html#field-event-severityhttp.request.body
object
flattened
logs-apm.error-*
http.request.headers
flattened
object
logs-apm.error-*
http.response.headers
flattened
object
logs-apm.error-*
input
object
keyword
logs-logstash.tpot-*
log.offset
long
keyword
logs-microsoft_exchange_server.httpproxy-*
keyword
observer.ip
ip
keyword
logs-ti_abusech_latest.dest_malware-*
request
text
object
logs-logstash.tpot-*
response
text
object
logs-logstash.tpot-*
session
sip.uri
status
keyword
long
logs-logstash.tpot-*
threat.indicator.first_seen
date
keyword
logs-ti_abusech.malware-*
threat.indicator.last_seen
date
keyword
logs-ti_abusech.malwarebazaar-*
timestamp
user_agent
object
keyword
logs-cisco_asa.log-*
object
is the expected mapping foruser_agent
; see https://www.elastic.co/guide/en/ecs/current/ecs-user_agent.htmlRoot Causes
fields/ecs.yml
filedate_detection: false
cause a few fields to not be mapped asdate
date_detection: true
or update ecs@mappingsindex.query.default_field
, so they are not available in fieldless searchfields/ecs.yml
for 8.13.x users can restore fieldless searches. Users on > 8.14.x are not affected sinceindex.query.default_field
is*
ecs@mappings+type-coercion
The ecs@mappings component template does not perform type coercion, so if the value is a string, ES maps it as a
keyword
.Here is an example, if I perform the following requests using the Dev Tools:
I get the following result:
ecs@mappings+date_detection:false
When date_detection is disabled, the following fields aren’t mapped correctly:
integration-mapping-problem
We probably need to change mappings in the integration to something similar (like most other integrations do):
Or remove these mappings and only use ecs@mappings.
integration-update
Mapping changed due to integration updates.
The text was updated successfully, but these errors were encountered: