# 在使用Elasticsearch的Ingest功能实现数据解析时,也要使用到Logstash的转换功能
# 如下情况使用logstash处理会更加方便:
# 1. 更多输入,Logstash可从本地获取来自许多其他来源的数据如TCP、UDP、syslog、关系数据库
# 2. 更多输出,Ingest节点仅将Elasticsearch作为输出,但可能要使用多个输出。例如将传入数据存到S3并在Elasticsearch中对其建立索引
# 3. 利用Logstash中更丰富的转换功能,例如外部查找,在(从Beats和其他来源获取)数据时使用持久队列功能来处理峰值
# -----------------------------------------------------------------------
# 为了更轻松地迁移配置,Logstash提供了Ingest管道转换工具(该工具将Ingest的pipeline转换为Logstash的配置文件)
cd ~/logstash/bin
./ingest-convert.sh --input INPUT_FILE_URI --output OUTPUT_FILE_URI [--append-stdio]
INPUT_FILE_URI # is a file URI that specifies the full path to the JSON file that defines the ingest node pipeline.
OUTPUT_FILE_URI # is the file URI of the Logstash DSL file that will be generated by the tool.
# For Example
cd ~/logstash/bin
./ingest-convert.sh --input file:///tmp/ingest/apache.json --output file:///tmp/ingest/apache.conf
# 部分限制
# Painless script conversion is not supported.
# 仅对部分可用的处理器进行转换,对不受支持的处理器定义会发出警告,并继续进行尽力而为的转换
# 目前支持的处理器
Append
Convert
Date
GeoIP
Grok
Gsub
Json
Lowercase
Rename
Set
logstash filter 配置转 ingest pipeline
最新推荐文章于 2021-07-14 23:15:08 发布