kibana 索引配置

  • 管理索引

点击设置 --- Elasticsearch 的 Index management 可以查看 elk 生成的所有索引 (设置,Elasticsearch ,管理)

  • 配置 kibana 的索引匹配

    设置,Kibana,索引模式

  • 配置索引生命周期

    点击设置 --- Elasticsearch 的 Index Lifecycle Policies 可以配置策略管理索引生命周期

配置索引策略文档地址:https://www.elastic.co/guide/en/elasticsearch/reference/7.3/index-lifecycle-management.html

首先创建 Index Lifecycle Policies 也就官方文档中的四个阶段配置

需要说明的是并不是每个阶段都是必要配置

配置好生命周期策略后,我们需要创建一个模板,将我们现在的输入 index 接管过来,然后将策略应用于这个模板,这就达到了,每次创建的 index 都能应用于这一策略

其实最方便的就是将你创建的索引都以 logstash-* 开头,默认就包含一个名为 logstash 的模板。

查询当前的模板

# 查询所有模板
GET /_template/ #查询其中某一个模板
GET /_template/logstash {
"logstash" : {
"order" : 0,
"version" : 60001,
"index_patterns" : [
"logstash-*"
],
"settings" : {
"index" : {
"lifecycle" : {
"name" : "watch-history-ilm-policy"
},
"number_of_shards" : "1",
"refresh_interval" : "5s"
}
},
"mappings" : {
"dynamic_templates" : [
{
"message_field" : {
"path_match" : "message",
"mapping" : {
"norms" : false,
"type" : "text"
},
"match_mapping_type" : "string"
}
},
{
"string_fields" : {
"mapping" : {
"norms" : false,
"type" : "text",
"fields" : {
"keyword" : {
"ignore_above" : 256,
"type" : "keyword"
}
}
},
"match_mapping_type" : "string",
"match" : "*"
}
}
],
"properties" : {
"@timestamp" : {
"type" : "date"
},
"geoip" : {
"dynamic" : true,
"properties" : {
"ip" : {
"type" : "ip"
},
"latitude" : {
"type" : "half_float"
},
"location" : {
"type" : "geo_point"
},
"longitude" : {
"type" : "half_float"
}
}
},
"@version" : {
"type" : "keyword"
}
}
},
"aliases" : { }
}
}

以上的模板接管了 logstash-* 开头的 index,然后将策略应用于这些 index

如果你不想以 logstash-* 开头创建索引,你可以先创建个模板参考如下:

PUT /_template/my_template
{
"order" : 0,
"index_patterns" : [
"filebeat_cash-*",
"filebeat_custom-*",
"filebeat_portal-*",
"filebeat_user-*",
"filebeat_hkd-*",
"filebeat_test_custom-*",
"filebeat_test_portal-*",
"filebeat_test_user-*",
"filebeat_test_hkd-*",
"filebeat_test_canal_topic-*"
],
"settings" : {
"index" : {
"number_of_shards" : "1",
"refresh_interval" : "5s"
}
},
"mappings" : {
"dynamic_templates" : [
{
"message_field" : {
"path_match" : "message",
"mapping" : {
"norms" : false,
"type" : "text"
},
"match_mapping_type" : "string"
}
},
{
"string_fields" : {
"mapping" : {
"norms" : false,
"type" : "text",
"fields" : {
"keyword" : {
"ignore_above" : 256,
"type" : "keyword"
}
}
},
"match_mapping_type" : "string",
"match" : "*"
}
}
],
"properties" : {
"@timestamp" : {
"type" : "date"
},
"geoip" : {
"dynamic" : true,
"properties" : {
"ip" : {
"type" : "ip"
},
"latitude" : {
"type" : "half_float"
},
"location" : {
"type" : "geo_point"
},
"longitude" : {
"type" : "half_float"
}
}
},
"@version" : {
"type" : "keyword"
}
}
},
"aliases" : { }
}

以上的模板接管了 filebeat-* 开头的 index,然后将策略应用于这些 index

现在我们就可以在 index management 里查看索引当前的生命周期状态

ELK 索引生命周期管理的更多相关文章

  1. 这么简单的ES索引生命周期管理,不了解一下吗~

    对于日志或指标(metric)类时序性强的ES索引,因为数据量大,并且写入和查询大多都是近期时间内的数据.我们可以采用hot-warm-cold架构将索引数据切分成hot/warm/cold的索引.h ...

  2. Elasticsearch7.X ILM索引生命周期管理(冷热分离)

    Elasticsearch7.X ILM索引生命周期管理(冷热分离) 一.“索引生命周期管理”概述 Elasticsearch索引生命周期管理指:Elasticsearch从设置.创建.打开.关闭.删 ...

  3. Elastic 使用索引生命周期管理实现热温冷架构

    Elastic: 使用索引生命周期管理实现热温冷架构 索引生命周期管理 (ILM) 是在 Elasticsearch 6.6(公测版)首次引入并在 6.7 版正式推出的一项功能.ILM 是 Elast ...

  4. ElasticSearch——索引生命周期管理

    从ES6.6开始,Elasticsearch提供索引生命周期管理功能,索引生命周期管理可以通过API或者kibana界面配置,详情参考[index-lifecycle-management] 本文仅通 ...

  5. Elasticsearch索引生命周期管理方案

    一.前言 在 Elasticsearch 的日常中,有很多如存储 系统日志.行为数据等方面的应用场景,这些场景的特点是数据量非常大,并且随着时间的增长 索引 的数量也会持续增长,然而这些场景基本上只有 ...

  6. Elasticsearch 索引生命周期管理 ILM 实战指南

    文章转载自:https://mp.weixin.qq.com/s/7VQd5sKt_PH56PFnCrUOHQ 1.什么是索引生命周期 在基于日志.指标.实时时间序列的大型系统中,集群的索引也具备类似 ...

  7. ES 7.13版本设置索引模板和索引生命周期管理

    第一步:索引管理中查看都有哪些索引文件,然后添加索引模式(后面的日期用*表示) 第二步:索引生命周期管理 自带的有一个log,就使用这个,不用再新建了,根据需求修改里面的配置就行了 第三步:添加索引模 ...

  8. Elasticsearch索引生命周期管理探索

    文章转载自: https://mp.weixin.qq.com/s?__biz=MzI2NDY1MTA3OQ==&mid=2247484130&idx=1&sn=454f199 ...

  9. Logstash & 索引生命周期管理(ILM)

    Grok语法 Grok是通过模式匹配的方式来识别日志中的数据,可以把Grok插件简单理解为升级版本的正则表达式.它拥有更多的模式,默认,Logstash拥有120个模式.如果这些模式不满足我们解析日志 ...

随机推荐

  1. GoCN每日新闻(2019-10-30)

    GoCN每日新闻(2019-10-30) GoCN每日新闻(2019-10-30) 1. Asta Xie: 玩转Go语言,从beego开始 https://mp.weixin.qq.com/s/Io ...

  2. wireshark安装和使用 -基础篇

    使用前知道: wireshark版本:3.0.2 使用wireshark的目的是因为它支持linux/windows/mac,而且新版本是开源免费的.还有一个原因是使用Fiddler不支持mac.截止 ...

  3. SpringCloud:学习Gateway网关拦截器的ServerWebExchange

    1.Gateway的拦截器 我们要在项目中实现一个拦截器,需要继承两个类:GlobalFilter, Ordered GlobalFilter:全局过滤拦截器,在gateway中已经有部分实现,具体参 ...

  4. python 操作es

    Elasticsearch 是一个开源的搜索引擎,建立在一个全文搜索引擎库 Apache Lucene™ 基础之上. Lucene 可能是目前存在的,不论开源还是私有的,拥有最先进,高性能和全功能搜索 ...

  5. BERT模型

    BERT模型是什么 BERT的全称是Bidirectional Encoder Representation from Transformers,即双向Transformer的Encoder,因为de ...

  6. Dubbo Filter机制概述

    https://blog.csdn.net/prestigeding/article/details/82085705  从上文可知,在服务的调用或消费端发送请求命令中,Dubbo引入过滤器链机制来实 ...

  7. win10-mysql卸载干净

    本文介绍,在Windows10系统下,如何彻底删除卸载MySQL 1.停止MySQL服务 开始——所有应用——Windows管理工具——服务,将MySQL服务停止. 2.卸载mysql server ...

  8. H3C交换机如何删除VLAN

    H3C交换机如何删除VLAN,如果直接使用“undo vlan”是删不干净的,因为配置VLAN时还配置过接口. 1.首先通过console口或telnet连接三层交换机,进入用户视图模式”<H3 ...

  9. 支付宝小程序开发——rich-text富文本组件支持html代码

    前言: 与微信小程序不同,支付宝小程序的富文本组件并不能直接支持html代码,如: 如上,支付宝小程序的富文本组件只支持数组类型,html代码需要使用 mini-html-parser 转换,具体用法 ...

  10. python时间戳,获取当前时间,时间格式转换,求出前几天或后几天的时间

    import time import datetime import locale import random class TimeUtil: def __init__(self, curtime=N ...