我将serilog.sinks.elasticsearch包与serilog一起使用,配置如下:
loggerConfiguration.WriteTo.Elasticsearch(new ElasticsearchSinkOptions(new Uri("http://localhost:9200"))
{
NumberOfReplicas = 0,
IndexFormat = "logs-{0:yyyy.MM.dd}",
MinimumLogEventLevel = LogEventLevel.Information,
AutoRegisterTemplate = true,
AutoRegisterTemplateVersion = AutoRegisterTemplateVersion.ESv6
})
创建索引时,它包含1个副本,但我需要0
{
"logs-2020.12.25":{
"settings":{
"index":{
"routing":{
"allocation":{
"include":{
"_tier_preference":"data_content"
}
}
},
"number_of_shards":"1",
"provided_name":"logs-2020.12.25",
"creation_date":"1608898386163",
"number_of_replicas":"1",
"uuid":"WvFFt8OIRAeQgLJGtTbV4Q",
"version":{
"created":"7100199"
}
}
}
}
}
我做错什么了?
暂无答案!
目前还没有任何答案,快来回答吧!