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. utility.py:61: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array in

    utility.py:: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; ...

  2. SpringBoot:缓存注解@Cacheable详解

    1.查看@Cacheable @Target({ElementType.TYPE, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) @ ...

  3. cocos: 链接错误: _lz_adler32 in liblibquickmac.a

    错误: Undefined symbols for architecture x86_64: "_adler32", referenced from: _lz_adler32 in ...

  4. 二分法递归版本(c++)

    利用二分法求解在区间[0,π/2]上的根 #include<iostream> #include <cmath> using namespace std; double dic ...

  5. NOIP 2013货车运输

    当然这题有很多做法,但是我看到没有人写DSU的很惊奇 按照之前做连双向边题的经验,这题可以用并查集维护联通 然后对于每个询问\(x,y\),考虑启发式合并 当两个点集\(x,y\)合并时,一些涉及到其 ...

  6. 在CentOS上使用Docker镜像安装Jenkins

    1.必须先在CentOS上安装Docker,使用以下命名先在Docker Hub上搜索Jenkins镜像 docker search jenkins 2.下载Jenkins镜像,命令如下:(我下载的是 ...

  7. g-api notes

    目录 Q: What is GOrigin? What the meaning of parameters GMat(const GNode &n, std::size_t out) Q: h ...

  8. [转]C/C++实现回调机制的几种方式(回调、槽、代理)

    转自:https://www.jianshu.com/p/4f907bba6d5f (1)Callback方式(回调) Callback的本质是设置一个函数指针进去,然后在需要需要触发某个事件时调用该 ...

  9. 荔枝派nano例子

    买回来,先短接flash芯片的14脚,然后上电,再断开14脚,开始怎么折腾都不行,最后发现是android线的问题,换成jlink ob送的android线就能找到设备了,真崩溃 lsusb,应该能看 ...

  10. scrapy爬虫案例:用MongoDB保存数据

    用Pymongo保存数据 爬取豆瓣电影top250movie.douban.com/top250的电影数据,并保存在MongoDB中. items.py class DoubanspiderItem( ...