serilog-sinks-elasticsearch icon indicating copy to clipboard operation
serilog-sinks-elasticsearch copied to clipboard

Make propritary fields not indexed

Open tdsrhh opened this issue 4 years ago • 1 comments

Hi

I am trying to add some proprietary fields to the elastic serilog sink. But the fields should not be indexed. I have created a template to use for this. But still the dynamic fields added with an enritcher using logEvent.AddOrUpdateProperty makes the fields indexed. Is there any way I can get this proprietary fields into ES where they are not indexed ?

"mappings": { "default": { "dynamic_templates": [ { "string_fields": { "match": "*", "match_mapping_type": "string", "mapping": { "type": "text", "index": false, "norms": false, "fields": { "raw": { "type": "keyword", "index": false, "ignore_above": 256 } } } } } ], "properties": { "message": { "type": "text", "index": true }, "subject": { "type": "text", "index": true }, "logger": { "type": "text", "index": true }, } }

tdsrhh avatar Apr 20 '20 06:04 tdsrhh

Do check that the mapping is applied successfully and take into account that it will only use it on a new index. If that is all the case, then check with maybe Elastic how to apply the correct mapping. This might have been changed with the different versions of ES. But first, check if it is there and applied correctly.

mivano avatar Apr 30 '20 08:04 mivano