{
"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 模板的更多相关文章

  1. es模板

    Index Templatesedit Index templates allow you to define templates that will automatically be applied ...

  2. elasticsearch 动态模板设置

    自定义动态映射 如果你想在运行时增加新的字段,你可能会启用动态映射.然而,有时候,动态映射 规则 可能不太智能.幸运的是,我们可以通过设置去自定义这些规则,以便更好的适用于你的数据. 日期检测 当 E ...

  3. es简单介绍及使用注意事项

    是什么? Elasticsearch是一个基于Apache Lucene(TM)的开源搜索引擎.无论在开源还是专有领域,Lucene可以被认为是迄今为止最先进.性能最好的.功能最全的搜索引擎库. El ...

  4. 使用Logstash创建ES映射模版并进行数据默认的动态映射规则

    本文配置为 ELK 即(Elasticsearch.Logstash.Kibana)5.5.1. Elasticsearch 能够自动检测字段的类型并进行映射,例如引号内的字段映射为 String,不 ...

  5. elasticsearch 动态模板

    在elasticsearch中,如果你有一类相似的数据字段,想要统一设置其映射,就可以用到一项功能:动态模板映射(dynamic_templates). 每个模板都有一个名字用于描述这个模板的用途,一 ...

  6. Logstash动态模板映射收集Nginx的Json格式日志

    Logstash传输给ES的数据会自动映射为5索引,5备份,字段都为text的的索引.这样基本上无法进行数据分析.所以必须将Logstash的数据按照既定的格式存储在ES中,这时候就要使用到ES模板技 ...

  7. Elasticsearch笔记

    资料 官网: http://www.elasticsearch.org 中文资料:http://www.learnes.net/ .Net驱动: http://nest.azurewebsites.n ...

  8. 分布式实时日志处理平台ELK

    这三样东西分别作用是:日志收集.索引与搜索.可视化展现 l  logstash 这张架构图可以看出logstash只是collect和index的地方,运行时传入一个.conf文件,配置分三部分:in ...

  9. elasticsearch映射

    前面讲到,无论是关系型数据库还是非关系型数据库,乃至elasticsearch这种事实上承担着一定储存作用的搜索引擎,数据类型都是非常重要而基础的概念.但elasticsearch与其它承担着数据存储 ...

随机推荐

  1. VirtualBox安装CentOS实现鼠标自动切换和复制粘贴

    1. 输入命令: cd /media 2. 输入命令: sh VBoxLinuxAdditions.run 3. 可能会出现错误: 解决的办法是依次输入命令: yum install update y ...

  2. 算法笔记_219:泊松分酒(Java)

    目录 1 问题描述 2 解决方案   1 问题描述 泊松是法国数学家.物理学家和力学家.他一生致力科学事业,成果颇多.有许多著名的公式定理以他的名字命名,比如概率论中著名的泊松分布. 有一次闲暇时,他 ...

  3. POJ 2186 强联通分量

    点击打开链接 题意:牛A喜欢牛B,若牛B喜欢牛C,则牛A喜欢牛C,问最后多少牛被其它全部牛喜欢 思路:用强联通分量进行缩点,最后形成的图是有向无环图DAG.而拓扑序的值为DAG的长度,则加一,可是最后 ...

  4. js和html插件集

    1.UEditor编辑器 UEditor是由百度web前端研发部开发所见即所得富文本web编辑器,具有轻量,可定制,注重用户体验等特点,开源基于MIT协议,允许自由使用和修改代码... 2.echar ...

  5. ios中布局(推荐一)

    - (void)viewDidLoad { [super viewDidLoad]; NSArray *data=@[@"标题一",@"标题二",@" ...

  6. Scribes:小型文本编辑器,支持远程编辑

    Scribes是一款简洁的文本编辑器.现在给大家介绍下.     功能列表,  Python插件扩展  支持远程编辑(如ftp, sftp, ssh, samba, webdav, webdavs)  ...

  7. Inside NGINX: How We Designed for Performance & Scale

    NGINX leads the pack in web performance, and it’s all due to the way the software is designed. Where ...

  8. javascript中的复制

    github 深度复制这个问题看似简单,实际上要想完美实现需要很多知识. 需要考虑Set,Map,Promise等类型的对象 这个库简洁明了,是一个小巧玲珑的JS库 Promise简单例子 funct ...

  9. spring加载jar包中多个配置文件(转)

    转自:http://evan0625.iteye.com/blog/1598366 在使用spring加载jar包中的配置文件时,不支持通配符,需要一个一个引入,如下所示: Java代码 <co ...

  10. mysql--SQL编程(关于mysql中的日期,实例,判断生日是否为闰年) 学习笔记2.1

    关于日期处理的实例: 从mysql给出的 example 这个是官方源码下载以及导入,http://dev.mysql.com/doc/employee/en/employees-installati ...