首页 > 解决方案 > Elasticsearch 以实体为中心的索引

问题描述

有没有人通过使用 python 和 groovy 脚本将事件中心索引重新索引为每个日志消息都有自己的索引的以实体为中心的索引,来使用 elasticsearch 进行以实体为中心的索引?

我收到了很多以下消息:

Jul 23 09:24:16 msda msda-core[5147]:  1563866656876839.mt
Jul 23 09:24:18 msda msda-core[5210]:  1563866656876839.0.dn

我有很多带有 .mt 后缀和 .dn 后缀的相同 ID 号。

如果一小时内出现带有 .dn 后缀的消息,我总是需要找到具有相同 ID 号和适当 dn 后缀的消息。

任何想法将不胜感激!

标签: elasticsearchelastic-stackelasticsearch-pluginelasticsearch-aggregation

解决方案


如果您运行的是 v7.2 或更高版本,我建议使用 Elasticsearch 数据帧转换来创建按 id 编号分组的以事件为中心的索引。https://www.elastic.co/guide/en/elastic-stack-overview /current/ml-dataframes.html

在最小和最大时间戳上使用脚本化指标来计算持续时间。Elastic 文档中有一个很好的示例 - https://www.elastic.co/guide/en/elastic-stack-overview/7.3/example-clientips.html


推荐阅读