Tag Archives: Logstash increment

How to Solve Logstash error: failed to execute action

Logstash error failed to execute action

The main reason why most of them report this error is that the conf file configuration is written incorrectly

input {
    stdin {
    }
    jdbc {
      # mysql database connection
      jdbc_connection_string => "jdbc:mysql://127.0.0.1:3306/itripdb?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC"
      # mysqly username and password
      jdbc_user => "root"
      jdbc_password => ""
      # Driver configuration Here fill in your own mysql-connector-java-8.0.13.jar path
      jdbc_driver_library => "D:\soft\Elasticsearch\logstash-7.9.3\logstash-7.9.3\bin\mysql-connector-java-8.0.13.jar"
      # Driver class name
      jdbc_driver_class => "com.mysql.jdbc.Driver"
      jdbc_paging_enabled => "true"
      # Specify to display 300000 entries per page
      jdbc_page_size => "300000"
      # Execute the specified sql file
 
     # The sql statement to be executed
       statement => "SELECT * FROM itrip_hotel"
      # Set listen to the meaning of each field minute hour day month year, default all * means: updated every minute
      schedule => "* * * * * *"
      # index type
      # type => ""
    }
}
 
 
output {
 
    elasticsearch {
        #es server
        hosts => ["localhost:9200"]
        #ES index name
        index => "itrip_hotel"
        #primary key self-incrementing ID
        document_id => "%{id}"
    }
    
    #Set json format
    stdout {
        codec => json_lines
    }
}