logstash.conf(部分):
output {
elasticsearch {
# ES的IP地址及端口
hosts => ["127.0.0.1:9200"]
# 索引名稱 可自定義
index => "test"
pipeline => "attachment"
# 需要關(guān)聯(lián)的數(shù)據(jù)庫(kù)中有有一個(gè)id字段裸诽,對(duì)應(yīng)類型中的id
document_id => "%{id}"
}
stdout {
# JSON格式輸出
codec => json_lines
}
}
建立文本抽取管道pipeline(全局執(zhí)行一次即可使用)
PUT _ingest/pipeline/attachment
{
"description": "Extract attachment information",
"processors": [
{
"attachment": {
"field": "data",
"indexed_chars": -1,
"ignore_missing": true
}
},
{
"remove": {
"field": "data"
}
}
]
}
解決辦法