-
Notifications
You must be signed in to change notification settings - Fork 197
Serilog.Sinks.Elasticsearch and ElasticSearch 6.1 #140
Comments
Same problem here. Seems to be a problem with the index template. When trying to auto register the template, we get the following error:
From this post, it seems that string has been replace with the type text. When replacing all string types with text, I get the following error:
So it seems that the value analyzed and not_analyzed is not a valid boolean. Seems fair enough. Replacing all "index": "analyzed" with the value true, emits an error that the _all field is not supported anymore. Not using that one anyway, so deleting that section finally lets me create the template, with some warning though.
The full template I managed to create:
|
There are indeed some breaking changes. See also this issue #129 |
This PR fixes the string deprecation: #142 |
+1 |
PR merged |
* Replaced index='analyzed' with index='true' * #140 - fixed v6 template unit test
I am able to create new indices now with package "Serilog.Sinks.Elasticsearch 5.7.0". Thanks for that. However I see that if I want to send data into the indices which are already existing it is failing. These indices were created before the Elasticsearch cluster was upgraded to 6.1 from 5.2.x. As per the Elasticsearch, Elasticsearch 6.x can use indices created in Elasticsearch 5.x. |
An existing index has an already applied template and cannot be changed. You will need to create a new index with the new template and move data over if you want to apply the new mappings. |
@mivano I did a small experiment. <add key="serilog:write-to:Elasticsearch.indexFormat" value="log-HereThere-{0:yyyy.MM}" /> Index log-HereThere-2017.11 exists. Now if I replace it with <add key="serilog:write-to:Elasticsearch.indexFormat" value="log-HereThere-2018.02" /> It does not create a new index. packages.config as of now. <packages>
<package id="Elasticsearch.Net" version="6.0.0" targetFramework="net461" />
<package id="Serilog" version="2.6.0" targetFramework="net461" />
<package id="Serilog.Settings.AppSettings" version="2.1.0" targetFramework="net452" />
<package id="Serilog.Sinks.Elasticsearch" version="6.1.0" targetFramework="net461" />
<package id="Serilog.Sinks.File" version="4.0.0" targetFramework="net461" />
<package id="Serilog.Sinks.IdentifierFile" version="0.2.0" targetFramework="net452" />
<package id="Serilog.Sinks.Observable" version="2.0.1" targetFramework="net452" />
<package id="Serilog.Sinks.PeriodicBatching" version="2.1.1" targetFramework="net461" />
<package id="Serilog.Sinks.RollingFile" version="3.3.0" targetFramework="net461" />
</packages> |
Can you enable the selflog of Serilog and see if it raises something useful? |
This appears to be happening with all of the latest versions. Please see error below (from the SelfLog): No handler for type [string] declared on field [message]","caused_by":{"type":"mapper_parsing_exception","reason":"No handler for type [string] declared on field [message]"}} <?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Elasticsearch.Net" version="6.1.0" targetFramework="net47" />
<package id="Serilog" version="2.6.0" targetFramework="net47" />
<package id="Serilog.Enrichers.Environment" version="2.1.2" targetFramework="net452" />
<package id="Serilog.Enrichers.Process" version="2.0.1" targetFramework="net452" />
<package id="Serilog.Sinks.Async" version="1.2.0" targetFramework="net47" />
<package id="Serilog.Sinks.Console" version="3.1.1" targetFramework="net47" />
<package id="Serilog.Sinks.Elasticsearch" version="6.5.0" targetFramework="net47" />
<package id="Serilog.Sinks.File" version="4.0.0" targetFramework="net47" />
<package id="Serilog.Sinks.Literate" version="3.0.0" targetFramework="net47" />
<package id="Serilog.Sinks.PeriodicBatching" version="2.1.1" targetFramework="net47" />
<package id="Serilog.Sinks.RollingFile" version="3.3.0" targetFramework="net452" />
</packages> Elasticsearch version is 6.2.4. No index exists on the current ES cluster, and it cannot seem to create one. Below is how we're instantiating the sink: loggerConfig.WriteTo.Elasticsearch(new ElasticsearchSinkOptions(new Uri(elasticSearchUrl))
{
AutoRegisterTemplate = true,
AutoRegisterTemplateVersion = AutoRegisterTemplateVersion.ESv6,
IndexFormat = indexFormat,
EmitEventFailure = EmitEventFailureHandling.WriteToSelfLog
}); |
We appeared to have the same issue: I saw Using Elasticsearch version 6.2.3, Serilog version 2.6.0 and Serilog.Sinks.Elasticsearch version 6.5.0. Fixed it by specifying "ESv6" for "autoRegisterTemplateVersion" in the configuration. |
Old issue, cleaning up |
Does Serilog.Sinks.Elasticsearch supports ElasticSearch 6.1 yet? Any pre-release?
Ever since we upgraded the cluster to 6.1 we are seeing that the Serilog is not able to create indices on the cluster.
Here are the versions of file in use.
The text was updated successfully, but these errors were encountered: