2017-07-06 137 views
0

如何使用Logstash加載二進制文件(pdf,xls,other ...)並且不更改其內容。如何使用Logstash加載二進制文件

目前,我嘗試用

input { 
file { 
    path => "C:/path/files/*" 
    type => "gesamt" 
    start_position => "beginning" 
    sincedb_path => "NUL" 
} 
} 
filter {  
    multiline { 
     pattern => "/.*./gesamt" 
     negate => true 
     what => "previous" 
    } 

base64 { 
    field => "blob" 
} 
} 
output { 
    elasticsearch { 
    hosts => ["http://localhost:9200"] 
    index => "index-name" 
    pipeline=>"test-pipeline" 
} 
} 

看來,多過濾器損壞的二進制內容加載。

回答

1

您不能將二進制文件轉儲到Elasticsearch中,這不會讓它們變得可搜索,而且文件系統可能更適合於保存它們。

如果你想使他們搜索,你可能想看看ingest attachment processor

+0

有一個測試流水線攝取使用附件工作正常。問題是如何在將logstash作爲二進制文件加載到pdf(或其他文件)而不損壞它們,然後將它們發送到elasticsearch? –

+0

logstash僅適用於某些[編解碼器](https://www.elastic.co/guide/en/logstash/5.5/codec-plugins.html),但不適用於二進制文件 – alr