logstash 输出到elasticsearch 自动建立index
2015-12-09 22:12
253 查看
由于es 单index 所能承受的数据量有限,之前情况是到400w数据300G左右的时候,整个数据的插入会变得特别慢(索引重建)甚至会导致集群之间的通信断开,于是我们采用每天一个index的方法来缓解压力,logstash 默认是支持每天产生索引的默认名为 logstash-yyyy.MM.dd 那么我们怎么才能重命名它呢,或者当我们有多个logstash实例的时候怎么才能让他们分别开来。
其实logstash的es output中 有几个参数是控制此选项的:
index => "dylocation-%{+YYYY.MM.dd}" // 和模板中得template 名称 匹配 如果匹配ok 则采用此模板
template_overwrite => true // 覆盖当前模板的一个参数 覆盖 template 和 template_name
其实呢 index的名字是和logstash中output 中得elasticsearch中得 template 匹配的怎么个匹配法呢 我们看看 默认的一个模板
/xxx/logstash/lib/logstash/outputs/elasticsearch 下的 elasticsearch-template.json
也就说
其实logstash的es output中 有几个参数是控制此选项的:
index => "dylocation-%{+YYYY.MM.dd}" // 和模板中得template 名称 匹配 如果匹配ok 则采用此模板
template_overwrite => true // 覆盖当前模板的一个参数 覆盖 template 和 template_name
其实呢 index的名字是和logstash中output 中得elasticsearch中得 template 匹配的怎么个匹配法呢 我们看看 默认的一个模板
/xxx/logstash/lib/logstash/outputs/elasticsearch 下的 elasticsearch-template.json
{ "template" : "logstash-*", "settings" : { "index.refresh_interval" : "5s" }, "mappings" : { "_default_" : { "_all" : {"enabled" : true}, "dynamic_templates" : [ { "string_fields" : { "match" : "*", "match_mapping_type" : "string", "mapping" : { "type" : "string", "index" : "analyzed", "omit_norms" : true, "fields" : { "raw" : {"type": "string", "index" : "not_analyzed", "ignore_above" : 256} } } } } ], "properties" : { "@version": { "type": "string", "index": "not_analyzed" }, "geoip" : { "type" : "object", "dynamic": true, "path": "full", "properties" : { "location" : { "type" : "geo_point" } } } } } } }
也就说
相关文章推荐
- 【iCore3 双核心板】例程十:RTC实时时钟实验——显示日期和时间
- 动态规划 - 最长公共子序列(LCS)
- 变量,常量,引用类型,值类型,枚举类型, 值类型和引用类型的简单区别,类型转换,装箱与拆箱
- tableView的重用机制
- iOS 推送 通知 测试
- windows下安装配置apache、mysql、php
- Android studio安装和一些快捷键
- 实验五
- 07-定时器之雪花
- 一天一个数据结构之HashMap
- nfs服务检测与自动恢复
- 10018---HttpClient 基本使用
- python 与hadoop之pyhdfs的使用
- OC - 第八章(二) KVC
- 样本类和模式匹配
- Shortest Palindrome
- Git和Github的配合使用
- 使用配置hadoop中常用的Linux(ubuntu)命令
- Hibernate的catalog导致数据库连接与实际操作的库不一致
- gevent关闭socket操作