【发布时间】:2019-11-03 03:39:19
【问题描述】:
我目前正在将我的日志从 Nlog 发送到 ElasticSearch。我每天都在创建索引,并将日志发送到该索引。 我想创建 Index Weekly,所以我想更改配置文件。
我在 NLog 配置文件中创建索引。
index = "logstash-${date:format=yyyy.MM.dd}"
我的 NLog 配置部分:
<target xsi:type="ElasticSearch"
index = "logstash-${date:format=yyyy.MM.dd}"
uri="http://localhost:9200"
includeAllProperties ="true">
</target>
我在一些论坛 (https://github.com/logstash-plugins/logstash-output-elasticsearch/issues/541#issuecomment-270923437) 中发现每周更改一次,我应该使用 xxxx.ww。
我试图像这样更改配置文件:
index = "logstash-${date:format=xxxx.ww}"
不幸的是,这是给我结果logstash-xxxx.ww,我期望结果logstash-2019.25
那么我怎样才能将每天更改为每周?
【问题讨论】:
标签: c# elasticsearch nlog