Search code examples
.netelasticsearchloggingkibanaserilog

Serilog Elasticsearch logs not making it to the server (but buffering correctly)


I have an ELK stack locally hosted (v7.0) on a Windows IIS web server and the logs are not making it to the server. Server is running, I can reach the reserved URL and get back the generic json package saying Elasticsearch is running and I can log into Kibana just fine, there's just no logs to see.

I have a bufferBaseFilename set in the apps that are logging, and when I go to that location the logs are actually there, properly indexed and all. I'm wondering why it never gets synced back to the server? It seems like a connection issue, but all the network stuff checks out. I'm probably missing something simple. Any thoughts? Let me know if you need more information!


Solution

  • A frequent source for this error is a malformed (template) request that does not match your ES version (e.g. contains deprecated fields). You could try to

    • use a preview version of the nuget package
    • set DetectElasticsearchVersion to true
    • set RegisterTemplateFailure to IndexAnyway

    You can configure the sink like so:

    var loggerConfig = new LoggerConfiguration()
        .WriteTo.Elasticsearch(new ElasticsearchSinkOptions(new Uri(...) ){
            // ...
            DetectElasticsearchVersion = true,
            RegisterTemplateFailure = RegisterTemplateFailure.IndexAnyway
         });