-
Notifications
You must be signed in to change notification settings - Fork 197
HTTP 400 when sending log to ElasticSearch 8.0.0 #345
Comments
Thanks for reporting. I have not used this version yet. Do you have a proposal on how to tackle this? |
One way could possible be to specify the Elastic version in the configuration. That is easy to understand but make it mandatory would cause a breaking change. Making it optional and detect the version if not specified by calling Another option would be to have a default version and if possible configure the version in runtime? |
We do have an detection of the version, so we can use that? |
@Belorus would you mind try to set https://github.com/serilog/serilog-sinks-elasticsearch/blob/dev/CHANGES.md |
Silly me just updated our dev ELK stack to 8.0.0 without checking things would work. I see this is also tracked via #375 At the moment it looks like updating all our apps configuration via code will be needed: |
I also ran into this problem and I'm reliant on the config files. However, it isn't possible to set |
@digger73 I'm not running Elastic any longer but if I'm not wrong, it must be set through code since it's not possible to deliberately set it to |
@orjan I came to the same conclusion, that was looking for the solution of using both the app.config and configuration of the sink in the code, however I haven't gotten this to work. When using app.config the elasticsearch sink is registered as a restricted sink and the options set through code is registered as an elasticsearch sink. |
Versions:
.NET Core 3.1
Serilog 2.9.0
Serilog.Sinks.ElasticSearch 8.1.0
Change in ElasticSearch 8.0
https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html
Code that needs change:
If I set TypeName to null (so that it doesn't get into resulting JSON) - everything works like a charm on both 7.x and 8.x
https://github.com/serilog/serilog-sinks-elasticsearch/blob/f8bfaf86bc28a27b8259459baa9a75db7729e342/src/Serilog.Sinks.Elasticsearch/Sinks/ElasticSearch/ElasticsearchSinkState.cs#L75
Error screenshot:
The text was updated successfully, but these errors were encountered: