简体   繁体   English

在Elasticsearch中删除旧日志来自Logstash

[英]Deleting old logs in elasticsearch came from logstash

I wanted to delete the old logs in elastic search which came from the logstash. 我想删除弹性搜索中来自logstash的旧日志。

I have read regarding the curator which can be used for removing this. 我已阅读有关可用于删除此内容的策展人的信息。

But it always points that it will remove old indices which is older than so many days. 但是它总是指出它将删除比许多天都旧的旧索引。 Will it actually remove my indices if I execute it ? 如果执行它,它实际上会删除我的索引吗? or just old logs in that particular index. 或只是旧日志记录该特定索引。

I have custom index like a, b , c etc. I dont have timestring parameters in my indices. 我有自定义索引,例如a,b,c等。我的索引中没有时间字符串参数。

curator delete indices --older-than 14 --time-unit days --timestring %Y.%m.%d --regex '^logstash-' 策展人删除索引-大于14-时间单位天-timestring%Y.%m。%d --regex'^ logstash-'

How to execute the deletion of indices in these format.? 如何执行这些格式的索引删除?

Curator cannot remove data from an index. 馆长无法从索引中删除数据。 It can only remove one or more indices. 它只能删除一个或多个索引。 This makes it especially hard for you since your index hames are not time-series in nature (the a, b, c, etc. you mentioned). 这对您来说尤其困难,因为索引标记本质上不是时间序列(您提到的a,b,c等)。

You should switch to using time-series indices and gradually phase out the named, non-timeseries indices. 您应该切换为使用时间序列索引,并逐步淘汰命名的非时间序列索引。

It's also apparent you're reading about older versions of curator, based on the syntax you're sharing. 显然,您正在基于共享的语法来阅读旧版本的curator。 That is the old Curator 3.x syntax. 那是旧的Curator 3.x语法。 Curator 3.x is deprecated, as it only supports Elasticsearch 1.x indices and 2.x indices. 不推荐使用Curator 3.x,因为它仅支持Elasticsearch 1.x索引和2.x索引。 Curator 4.x supports 2.x indices, and 5.x indices. Curator 4.x支持2.x索引和5.x索引。 Curator 5.x support Elasticsearch 5.x indices only. Curator 5.x仅支持Elasticsearch 5.x索引。 See https://www.elastic.co/guide/en/elasticsearch/client/curator/5.3/version-compatibility.html 参见https://www.elastic.co/guide/zh-CN/elasticsearch/client/curator/5.3/version-compatibility.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM