We are using Elatic Cloud to collect logs from a Kubernetes cluster using fleet-managed Elastic Agents.
When enabling the Kubernetes integration in a policy, the Agents automatically pick up container logs. That is really useful as that means all the logs from our apps flow into Elastic.
However, when searching I noticed I do not get any matches on individual words in the message field. Looking at the index template: logs-kubernetes.container_logs, it has no mapping for the message field. The result is that the message field is mapped as "keyword" instead of "match_only_text".
Looking at the template from another integration (logs-system.system), that one includes the following in it's template:
"message": {
"type": "match_only_text"
}
Question: is the message field omitted from the Kubernetes integration intentionally?
If not, would it make sense to add that?
Or would it be an idea to add the 'data-streams-mappings' managaged component templates as a component in the managed logs-kubernetes.container_logs template? That component template includes a nice dynamic template that matches the message field and makes it match_only_text.
{
"dynamic_templates": [
...
{
"match_message": {
"mapping": {
"type": "match_only_text"
},
"match_mapping_type": "string",
"match": "message"
}
},
...