es 模板
{
"template": "log*",
"order":10,
"settings": {
"index":{
"refresh_interval" :"30s",
"number_of_shards": "6",
"number_of_replicas": "1",
"translog.flush_threshold_size": "1024mb",
"translog.durability": "async"
}
},
"mappings" :{
"logs" :{
"properties": {
"Date": {
"type": "date"
},
"Level": {
"type": "keyword"
},
"Class": {
"type": "keyword"
}
}
}
}
}
{
"template": "live*",
"order":0,
"settings": {
"index":{
"refresh_interval" :"30s",
"number_of_shards": "6",
"number_of_replicas": "1",
"translog.flush_threshold_size": "1024mb",
"translog.durability": "async"
}
},
"mappings" :{
"logs" :{
"properties": {
"@timestamp": {
"type": "date"
},
"Date": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"Level": {
"type": "keyword",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"Thread": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"RequestId": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"Class": {
"type": "keyword",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"msg": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
}
}
}
修改版本
{
"order": 9,
"template": "live*",
"settings": {
"index": {
"refresh_interval": "30s",
"number_of_shards": "6",
"translog": {
"flush_threshold_size": "1024mb",
"durability": "async"
},
"number_of_replicas": "1"
}
},
"mappings": {
"live-front": {-----------》这里的值不是随便写的。这里写成你的type的值
"properties": {
"@timestamp": {
"type": "date"
},
"Class": {
"type": "text"
},
"Date": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss.SSS"
},
"Level": {
"type": "keyword"
},
"RequestId": {
"type": "text"
},
"Thread": {
"type": "text"
},
"beat": {
"properties": {
"hostname": {
"type": "keyword"
}
}
},
"kafka": {
"properties": {
"consumer_group": {
"type": "keyword"
},
"offset": {
"type": "long"
},
"partition": {
"type": "long"
},
"topic": {
"type": "keyword"
}
}
},
"msg": {
"type": "text"
},
"source": {
"type": "keyword"
},
"type": {
"type": "keyword"
}
}
}
}
}
es 模板的更多相关文章
- es模板
Index Templatesedit Index templates allow you to define templates that will automatically be applied ...
- elasticsearch 动态模板设置
自定义动态映射 如果你想在运行时增加新的字段,你可能会启用动态映射.然而,有时候,动态映射 规则 可能不太智能.幸运的是,我们可以通过设置去自定义这些规则,以便更好的适用于你的数据. 日期检测 当 E ...
- es简单介绍及使用注意事项
是什么? Elasticsearch是一个基于Apache Lucene(TM)的开源搜索引擎.无论在开源还是专有领域,Lucene可以被认为是迄今为止最先进.性能最好的.功能最全的搜索引擎库. El ...
- 使用Logstash创建ES映射模版并进行数据默认的动态映射规则
本文配置为 ELK 即(Elasticsearch.Logstash.Kibana)5.5.1. Elasticsearch 能够自动检测字段的类型并进行映射,例如引号内的字段映射为 String,不 ...
- elasticsearch 动态模板
在elasticsearch中,如果你有一类相似的数据字段,想要统一设置其映射,就可以用到一项功能:动态模板映射(dynamic_templates). 每个模板都有一个名字用于描述这个模板的用途,一 ...
- Logstash动态模板映射收集Nginx的Json格式日志
Logstash传输给ES的数据会自动映射为5索引,5备份,字段都为text的的索引.这样基本上无法进行数据分析.所以必须将Logstash的数据按照既定的格式存储在ES中,这时候就要使用到ES模板技 ...
- Elasticsearch笔记
资料 官网: http://www.elasticsearch.org 中文资料:http://www.learnes.net/ .Net驱动: http://nest.azurewebsites.n ...
- 分布式实时日志处理平台ELK
这三样东西分别作用是:日志收集.索引与搜索.可视化展现 l logstash 这张架构图可以看出logstash只是collect和index的地方,运行时传入一个.conf文件,配置分三部分:in ...
- elasticsearch映射
前面讲到,无论是关系型数据库还是非关系型数据库,乃至elasticsearch这种事实上承担着一定储存作用的搜索引擎,数据类型都是非常重要而基础的概念.但elasticsearch与其它承担着数据存储 ...
随机推荐
- scpclient使用报错fchmod无法找到问题解决
因为这个函数时linux下专用的,Windows下无法使用,所以会导致提示这个函数不能使用,解决的方法如下: 1. import platform 2. if platform.system() == ...
- InfluxDB和MySQL的读写对比测试
今天进行了InfluxDB和MySQL的对比测试,这里记录下结果,也方便我以后查阅. 操作系统: CentOS6.5_x64InfluxDB版本 : v1.1.0MySQL版本:v5.1.73CPU ...
- Java中equals()和hashCode()的关系以及重写equals()和hashCode()的重要性
转载请注明原文地址:http://www.cnblogs.com/ygj0930/p/6580647.html 一:关系 如果两个对象相等(equal),它们的hashcode一定相同: 如果两个对 ...
- cpan安装报错Invalid host name on line 1 at *FirstTime.pm line 1857.
今天鼓捣一下CPAN,安装时出错: root@ubuntu:~# cpan install DBI CPAN.pm requires configuration, but most of it can ...
- 〖Linux〗秒开www.stackoverflow.com,非代理方式
stackoverflow.com就不介绍了,一种解决方法就是手动分析链接,使用nslookup得到hosts: #stack overflow 198.252.206.140 cdn.sstatic ...
- python之函数用法get()
# -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法get() #http://www.runoob.com/python/att-dic ...
- iOS – 单例模式写一次就够了
一. 单例模式简介 单例模式的作用 可以保证在程序运行过程,一个类只有一个实例,而且该实例易于供外界访问 从而方便地控制了实例个数,并节约系统资源 单例模式的使用场合 在整个应用程序中,共享一份资源( ...
- 【LeetCode】217. Contains Duplicate (2 solutions)
Contains Duplicate Given an array of integers, find if the array contains any duplicates. Your funct ...
- 魅族MX四核手机转让,二手淘宝上+hi-pda论坛结合使用成功已出
2013-3-14 内容存档在evernote,笔记名"魅族MX四核手机转让,二手淘宝上+hi-pda论坛结合使用成功已出"
- HDU 3980 Paint Chain (sg函数)
Paint Chain Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total ...