Hi there
We're using Filebeat 6.4.2 to scrape our logs from Kubernetes (with Docker) and are shipping our logs directly to Elastic Cloud, running 6.5.0. I loaded a custom index template into Elasticsearch to add a .raw
field to our logs, as follows (this is a copy-paste from Serilog's Elasticsearch sink):
GET /_template/serilog-template
{
"serilog-template" : {
"order" : 0,
"index_patterns" : [
"filebeat-*"
],
"settings" : {
"index" : {
"refresh_interval" : "5s"
}
},
"mappings" : {
"_default_" : {
"dynamic_templates" : [
{
"numerics_in_fields" : {
"path_match" : """fields\.[\d+]$""",
"match_pattern" : "regex",
"mapping" : {
"type" : "text",
"index" : true,
"norms" : false
}
}
},
{
"string_fields" : {
"match" : "*",
"match_mapping_type" : "string",
"mapping" : {
"type" : "text",
"index" : true,
"norms" : false,
"fields" : {
"raw" : {
"type" : "keyword",
"index" : true,
"ignore_above" : 256
}
}
}
}
}
],
"properties" : {
"message" : {
"type" : "text",
"index" : "true"
},
"exceptions" : {
"type" : "nested",
"properties" : {
"Depth" : {
"type" : "integer"
},
"RemoteStackIndex" : {
"type" : "integer"
},
"HResult" : {
"type" : "integer"
},
"StackTraceString" : {
"type" : "text",
"index" : "true"
},
"RemoteStackTraceString" : {
"type" : "text",
"index" : "true"
},
"ExceptionMessage" : {
"type" : "object",
"properties" : {
"MemberType" : {
"type" : "integer"
}
}
}
}
}
}
}
},
"aliases" : { }
}
}
In addition to this template, Filebeat has also installed its default template, which specifies "order": 1
. I understand from the docs that in this scenario the custom template will be applied before the Filebeat template.
However, I do not see any of the .raw
fields in my index mapping, or in the posted data. It seems almost as though the index pattern is being ignored entirely?
We also have the same template applied to a custom index to which we submit log events directly (i.e., without Filebeat in the picture), and this does include .raw
fields in the index pattern and in the data, so my best guess is that the interplay with Filebeat is causing us problems here.