参考了: https://blog.csdn.net/alan_liuyue/article/details/78361431
https://www.cnblogs.com/jstarseven/p/7707499.html
步骤一、 新建文件 template-es.json (名字可自定义),内容如下:
{ "template": "*", "version": 50001, "settings": { "index.refresh_interval": "5s", "analysis": { "analyzer": { "comma": { "type": "pattern", "pattern":"," } } } }, "mappings": { "properties": { "id": { "type": "long" }, "template_name": { "type": "text", "analyzer": "standard" }, "template_data": { "type": "text", "analyzer": "standard" }, "author": { "type": "text", "analyzer": "standard" }, "keywords": { "type": "text", "analyzer": "comma" }, "category_ids": { "type": "text", "analyzer": "comma" }, "thumb_id": { "type": "long" }, "description": { "type": "text", "analyzer": "standard" }, "updated_at": { "type": "date" }, "created_at": { "type": "date" }, "@timestamp": { "type": "date" }, "@version": { "type": "keyword" } } } }步骤二、在logstash.conf配置如下:
重启logstash, 亲测可用