2017-08-03 64 views
0

我的logstash.conf文件和mysql-connector-java-5.1.38.jar都位於F:\ Software \ logstash-5.5.1 \ logstash-5.5.1 \倉位置 獲得以下錯誤,同時運行的conf文件在CMD:logstash conf中elasticsearch的未知設置'host'

F:\ SOFTWARE \ logstash-5.5.1 \ logstash-5.5.1 \ BIN> logstash -f logstash.conf ERROR StatusLogger沒有log4j2配置找到文件。使用默認配置:僅將錯誤記錄到控制檯。 將Logstash的日誌發送到F:/Software/logstash-5.5.1/logstash-5.5.1/logs,該日誌現在通過log4j2.properties [2017-08-03T16:01:17,142] [錯誤] [logstash.outputs彈性搜索的未知設置'主機' [2017-08-03T16:01:17,149] [錯誤] [logstash.agent]無法創建管道{:reason =>「配置有問題」}

下面是我的conf文件:

input { 
jdbc { 
    # MySql jdbc connection string to our database, testdb 
    jdbc_connection_string => "jdbc:mysql://localhost:3306/testdb" 
    # The user we wish to execute our statement as 
    jdbc_user => "root" 
    jdbc_password => "root" 
    # The path to our downloaded jdbc driver 
    jdbc_driver_library => "F:/Software/logstash-5.5.1/logstash-5.5.1/bin/mysql-connector-java-5.1.38/mysql-connector-java-5.1.38.jar" 
    # The name of the driver class for Postgresql 
    jdbc_driver_class => "com.mysql.jdbc.Driver" 
    # our query 
    statement => "SELECT * from testtable" 
} 

}

output { 
stdout { codec => json_lines } 
elasticsearch{ 
hosts => ["localhost:9200"] 
protocol => "http" 
index => "test-migrate" 
document_type => "data" 
} 

}

+0

你的問題是什麼? –

+0

我的問題是我的配置無法正常工作。 – user2144684

+0

但現在它正在工作。這是一些配置問題。 – user2144684

回答

0

這是標準的和基本的conf文件

好運!!!!

input { 
    jdbc { 
     jdbc_driver_library => "/mysql-connector-java-5.1.44-bin.jar" 
     jdbc_driver_class => "com.mysql.jdbc.Driver" 
     jdbc_connection_string => "jdbc:mysql://localhost:3306/yourdatabase" 
     jdbc_user => "root" 
     jdbc_password => "" 
     statement => "SELECT * from yourtable" 
    } 
} 
output { 
    #stdout {codec => rubydebug} 
    elasticsearch { 
     hosts => "localhost:9200" 
     index => "inandi" 
     document_type => "name" 
     document_id => "%{name}" 
    } 
} 
相關問題