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与其它承担着数据存储 ...
随机推荐
- mysql标准写法及其他常见问题
/* Navicat MySQL Data Transfer Source Server : localhost_3306 Source Server Version : 50549 Source H ...
- 排序基础之插入排序、冒泡排序、选择排序详解与Java代码实现
转载请注明原文地址:http://www.cnblogs.com/ygj0930/p/6594533.html 一:插入排序==逐个往前相邻数比较交换,小的在前 第一轮:A[1]与A[0]比较,小的 ...
- 在 Vim 中使用 pydiction 对 Python 进行代码补全
Pydiction 允许你在 Vim 中实现 TAB 代码补全, 可以补全的内容包括:标准的.自定义的,以及第三方模块和包.外加关键字.BIFs,和字符串. Pydiction 由 3 个主要文件构成 ...
- java 图片与base64相互转化
CreateTime--2017年12月4日17:38:44 Author:Marydon 需要导入: import java.io.FileInputStream; import java.io ...
- python之模块copy,了解概念即可
# -*- coding: utf-8 -*- #python 27 #xiaodeng #python之模块copy,了解概念即可 import copy #浅拷贝 #copy拷贝一个对象,但是对象 ...
- Linux下RocksDB、LevelDB、ForestDB性能测试对比
简要说明 本次环境与http://www.cnblogs.com/oloroso/p/6306352.html中的一致. 依然是增删查改各测试10000次,每个测试重复5次取平均值. 1.不使用jem ...
- 在Java中使用Kafka
Producer部分 Producer在实例化后, 对外提供send方法, 用于将数据送到指定的topic和partition; 以及在退出时需要的destroy方法. 接口 KafkaProduce ...
- HDU 2217 Data Structure?
C - Data Structure? Time Limit:5000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u ...
- nginx搭建httpsserver
HTTPS简单介绍 HTTPS(Hypertext Transfer Protocol over Secure Socket Layer),是以安全为目标的HTTP通道,简单来讲就是HTTP的安全版. ...
- mac下phpstrom安装主题和主题推荐
phpstorm主题 在mac下finder下command+shift+G键到~/Library/Preferences/PhpStorm2016.2/colors,我的路径可能和你的不同,但是大同 ...