3

I have an elasticsearch server and an app writing to it through Serilog + Elasticsearch sink. It worked fine, but suddenly I'm getting The remote server returned an error: (404) Not Found. I'm getting two of these for http://{ip}:{port}/_template/serilog-events-template - and then two of The remote server returned an error: (400) Bad Request. for same response URI.

I'm getting it when creating the logger:

_perfElasticLogger = new LoggerConfiguration().WriteTo.Elasticsearch(new ElasticsearchSinkOptions(new Uri(elasticUrl))
{
    AutoRegisterTemplate = true,
    LevelSwitch = LevelSwitch,
    IndexFormat = elasticIndex.ToLower() + "-perf-{0:yyyy.MM.dd}",
    ModifyConnectionSettings = ModifyConnectionSettings,
    ConnectionTimeout = new TimeSpan(0, 0, 1)
}).CreateLogger();

Server itself works fine - if I go with browser to the {ip}:{port} it works. Also I can go to http://{ip}:{port}/_template/serilog-events-template (I have no idea what that is, though) and I do get a page with {} and not 404 or 400...

Any clue on what's the problem , or how I can move forward debugging it?

Maverick Meerkat
  • 5,737
  • 3
  • 47
  • 66

0 Answers0