Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

The ES7 template registration throw an exception #547

Open
6 tasks
lee-vic opened this issue Jun 16, 2023 · 1 comment
Open
6 tasks

The ES7 template registration throw an exception #547

lee-vic opened this issue Jun 16, 2023 · 1 comment

Comments

@lee-vic
Copy link

lee-vic commented Jun 16, 2023

Does this issue relate to a new feature or an existing bug?

  • [*] Bug
  • New Feature

What version of Serilog.Sinks.Elasticsearch is affected? Please list the related NuGet package.

Using the examples in the source code repository, Switch to tag v9.0.2

What is the target framework and operating system? See target frameworks & net standard matrix.

  • [*] netCore7.0
  • netCore 2.0
  • netCore 1.0
  • 4.7
  • 4.6.x
  • 4.5.x

Using the examples in the source code repository, the ES server version is 7.11.2. The template cannot be registered successfully. If RegisterTemplateFailure is set to FailSink, an exception is thrown.

PUT http://192.168.0.245:9200/_template/serilog-events-template?include_type_name=true HTTP/1.1
Host: 192.168.0.245:9200
Accept: application/json
User-Agent: elasticsearch-net/7.17.5+34f1b0b42ae4e0227fb1ad9ebeb7ae3406a998ec (Microsoft Windows 10.0.19045; .NET 6.0.12; Elasticsearch.Net)
x-elastic-client-meta: es=7.17.5,net=6.0.12,t=7.17.5,a=0,so=6.0.12
Content-Type: application/json
Content-Length: 869

{"index_patterns":["logstash-"],"settings":{"index.refresh_interval":"5s","number_of_shards":"2","number_of_replicas":"1"},"mappings":{"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":{}}
HTTP/1.1 400 Bad Request
Warning: 299 Elasticsearch-7.11.2-3e5a16cfec50876d20ea77b075070932c6464c7d "[types removal] Specifying include_type_name in put index template requests is deprecated. The parameter will be removed in the next major version."
content-type: application/json; charset=UTF-8
content-length: 361

{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Malformed [mappings] section for type [dynamic_templates], should include an inner object describing the mapping"}],"type":"illegal_argument_exception","reason":"Malformed [mappings] section for type [dynamic_templates], should include an inner object describing the mapping"},"status":400}

@mivano
Copy link
Contributor

mivano commented Jun 16, 2023

Thanks for the report. It looks like the release took a wrong turn. I m creating package 9.0.3 in the meantime.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants