elasticsearch模板配置
来源:互联网 发布:淘宝客微信群 编辑:程序博客网 时间:2024/06/05 08:53
配置所有string字段都不分词
新建文件dynamic_templates,内容如下:
{
"template": "*",
"mappings": {
"logs": {
"dynamic_templates": [
{
"strings": {
"match_mapping_type": "string",
"mapping": {
"type": "keyword"
}
}
}
]
}
}
}
创建脚本:update_dynamic_templates.sh ,内容如下
#!/bin/bash
auth=elastic:changeme
echo update template mobreq mobperf srvmonitor...
cd /data/services/elastic/templates
curl -XPUT -u $auth http://localhost:9200/_template/dynamic_templates -d @dynamic_templates
curl -u $auth http://localhost:9200/_template/dynamic_templates?pretty
echo "update end.."
update_dynamic_templates.sh和dynamic_templates放在同一目录下,运行update_dynamic_templates.sh就行。
注意,模板对新建的库才有效果
另外,附带一个完整一点的配置作参考
{
"order": 14,
"template": "aomimodeldata-*",
"settings": {
"refresh_interval": "10s",
"index.number_of_shards": 12,
"index.number_of_replicas": 1,
"index.max_result_window": 200000,
"search.slowlog.threshold.query.warn": "10s",
"search.slowlog.threshold.query.info": "5s",
"indexing.slowlog.threshold.index.warn": "10s",
"indexing.slowlog.threshold.index.info": "5s"
},
"mappings": {
"logs": {
"dynamic": true,
"_all" : {
"enabled" : false
},
"properties": {
"app.srvid":{
"type":"keyword"
},
"source":{
"type":"keyword"
},
"app.groupid":{
"type":"keyword"
},
"model.ctx.svrname":{
"type":"keyword"
},
"model.id":{
"type":"keyword"
},
"app.clientname":{
"type":"keyword"
},
"app.ips":{
"type":"keyword"
},
"app.ports":{
"type":"keyword"
},
"@timestamp":{
"type":"date"
}
}
}
}
}
阅读全文
0 0
- elasticsearch模板配置
- elasticsearch 模板 时间戳 配置
- 如何为logstash+elasticsearch配置索引模板?
- 如何为logstash+elasticsearch配置索引模板?
- Elasticsearch配置
- Elasticsearch配置
- elasticsearch配置
- elasticsearch配置
- elasticsearch配置
- ElasticSearch配置
- elasticsearch配置
- ElasticSearch配置
- elasticsearch配置
- elasticsearch template 模板
- elasticsearch 模板添加字段
- Elasticsearch查询配置(Elasticsearch+springboot)
- 【配置】Elasticsearch安装配置
- Elasticsearch——Templates 模板
- 2018届注册会计师面授长线一期班
- 假设在n进制下,下面的等式成立,567 * 456 = 150216,n的值是()。
- 如何在DataFrame 中优雅的增加一行,一列
- Flume 1.7组件概述与列表
- PIL(Python Image Library)常用操作简介
- elasticsearch模板配置
- 搞懂树状数组
- LIS算法: 最长上升子序列
- oracle报错,“单行子查询返回多个行”
- linux 修改时间和时区
- HTML5 data- 自定义属性
- 自定义函数标签
- C语言实现数据保护算法(1)——DES&3DES加解密
- jQuery实现点击全选和取消全选