Logstash Amazon Output Elasticsearch Config Error

时间:2016-08-30 04:39:04

标签: elasticsearch logstash

I'm try to send the data from mysql using logstash jdbc mysql to Amazon Elasticsearch Service and I got an error , my config db.conf as follow :

input {
jdbc {
    # Postgres jdbc connection string to our database, mydb
    jdbc_connection_string => "jdbc:mysql://awsmigration.XXXXXXXX.ap-southeast-1.rds.amazonaws.com:3306/admin_slurp?zeroDateTimeBehavior=convertToNull"
    # The user we wish to execute our statement as
    jdbc_user => "root"
    jdbc_password => "XXXXXX"
    # The path to our downloaded jdbc driver
    jdbc_driver_library => "/opt/logstash/drivers/mysql-connector-java-5.1.39/mysql-connector-java-5.1.39-bin.jar"
    # The name of the driver class for Postgresql
    jdbc_driver_class => "com.mysql.jdbc.Driver"
    # our query
    statement => "SELECT *, id as _id from Receipt"

    jdbc_paging_enabled => true
    jdbc_page_size => 200
    }
}
output {
amazon_es {
    hosts => ["https://search-XXXXXXXX.ap-southeast-1.es.amazonaws.com:443"]
    region => "ap-southeast-1"
    # aws_access_key_id, aws_secret_access_key optional if instance profile is configured
    aws_access_key_id => 'XXXXXXXX'
    aws_secret_access_key => 'XXXXXXXX'
    index => "slurp_receipt"
   }
}

The errors :

fetched an invalid config {:config=>"    jdbc {\n        # Postgres jdbc connection string to our database, mydb\n        jdbc_connection_string => \"jdbc:mysql://awsmigration.XXXXXXXX.ap-southeast-1.rds.amazonaws.com:3306/admin_slurp?zeroDateTimeBehavior=convertToNull\"\n        # The user we wish to execute our statement as\n        jdbc_user => \"dryrun\"\n        jdbc_password => \"dryruntesting\"\n        # The path to our downloaded jdbc driver\n        jdbc_driver_library => \"/opt/logstash/drivers/mysql-connector-java-5.1.39/mysql-connector-java-5.1.39-bin.jar\"\n        # The name of the driver class for Postgresql\n        jdbc_driver_class => \"com.mysql.jdbc.Driver\"\n        # our query\n        statement => \"SELECT *, id as _id from Receipt\"\n\n        jdbc_paging_enabled => true\n        jdbc_page_size => 200\n    }\n}\noutput {\n    amazon_es {\n        hosts => [\"https://search-XXXXXXXX-southeast-1.es.amazonaws.com:443\"]\n        region => \"ap-southeast-1\"\n        # aws_access_key_id, aws_secret_access_key optional if instance profile is configured\n        aws_access_key_id => 'XXXXXXXX'\n        aws_secret_access_key => 'XXXXXXXX'\n        index => \"slurp_receipt\"\n    }\n}\n\n\n", :reason=>"Expected one of #, input, filter, output at line 1, column 5 (byte 5) after     ", :level=>:error}

I'm using Ubuntu 14 , logstash 2.3.4 .

How to solve it?

Thank you

0 个答案:

没有答案