2016-12-20 8 views
0

私は、base64フィールドのデータを取得するために、ingest-attachmentを使用しています。logstash設定で弾性パイプラインのアタッチメントを設定しますか?

PUT _ingest/pipeline/attachment 
{ 
    "description" : "Extract attachment information", 
    "processors" : [ 
    { 
     "attachment" : { 
     "field" : "data" 
     } 
    } 
    ] 
} 



PUT my_index/my_type/my_id?pipeline=attachment 
{ 
    "data": "e1xydGYxXGFuc2kNCkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBhbWV0DQpccGFyIH0=" 
} 

GET my_index/my_type/my_id 

{ 
    "found": true, 
    "_index": "my_index", 
    "_type": "my_type", 
    "_id": "my_id", 
    "_version": 1, 
    "_source": { 
    "data":  "e1xydGYxXGFuc2kNCkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBhbWV0DQpccGFyIH0=", 
"attachment": { 
    "content_type": "application/rtf", 
    "language": "ro", 
    "content": "Lorem ipsum dolor sit amet", 
    "content_length": 28 
    } 
    } 
} 

Logstash設定ファイルを使用して同じことを行うにはどうすればよいですか? パイプラインのアタッチメントを定義するための参照がありません。

答えて

1

あなたは、単にこのように、あなたのイベントが適切なパイプラインによって処理されますように、あなたのelasticsearch出力構成でwhich pipeline to useを指定する必要があります。

output { 
    elasticsearch { 
     hosts => ["localhost:9200"] 
     index => "my_index" 
     document_type => "my_type" 
     pipeline => "attachment"    <--- use this 
    } 
} 

PS:これが唯一のES 5とLogstash上で動作することに注意してください5.

+0

これで運がいいですか? – Val

+0

私のプロジェクトに使ったものとまったく同じです。ありがとう – srinisunka

関連する問題