Hi,
I have setup Logstash, ES and Kibana on EC2 server and used localhost:9200 in all three setup yml file. curl command is also working fine. but once I am pushing msg using jdbc I am getting below error.
JDBC working file and displaying the result on local screen using below code snippet
"output {
stdout { codec => json_lines }
}"
conf.d -
input {
jdbc {
jdbc_connection_string => "jdbc:postgresql://oratopg.cspwou0nzxz1.us-east-1.rds.amazonaws.com:5432/postgres"
jdbc_user => "dhairyaj"
jdbc_password => "Rsadmin11"
jdbc_validate_connection => true
jdbc_driver_library => "/home/ubuntu/jdbc/postgresql-9.4.1209.jar"
jdbc_driver_class => "org.postgresql.Driver"
statement => "SELECT * from pg_stat_activity"
schedule => "* * * * *"
}
}
output {
elasticsearch {
protocol => "http"
index => "pg_stat_activity"
document_type => "pg_stat_activity"
document_id => "%{uid}"
hosts => ["http://localhost:9200"]
}
}
I have also tried both localhost and 127.0.0.1:9200 in conf file but its not working.
error:
Attempted to send a bulk request to Elasticsearch configured at '["http://localhost:9200"]', but an error occurred and it failed! Are you sure you can reach elasticsearch from this machine using the configuration provided? {:error_message=>"[406] {"error":"Content-Type header [text/plain; charset=ISO-8859-1] is not supported","status":406}", :error_class=>"Elasticsearch ::Transport::Transport::Errors::NotAcceptable", :backtrace=>["/etc/logstash-6.0.1/plugin/plugin/logstash-2.3.4/vendor/bundle/jruby/1.9/gems/elasticsearch-transport-1.0.18/lib/elasticsearch/ transport/transport/base.rb:201:in __raise_transport_error'", "/etc/logstash-6.0.1/plugin/plugin/logstash-2.3.4/vendor/bundle/jruby/1.9/gems/elasticsearch-transport-1.0.18/lib/elasticsearc h/transport/transport/base.rb:312:in
perform_request'", "/etc/logstash-6.0.1/plugin/plugin/logstash-2.3.4/vendor/bundle/jruby/1.9/gems/elasticsearch-transport-1.0.18/lib/elasticsearch/tran sport/transport/http/manticore.rb:67:in perform_request'", "/etc/logstash-6.0.1/plugin/plugin/logstash-2.3.4/vendor/bundle/jruby/1.9/gems/elasticsearch-transport-1.0.18/lib/elasticsearch/t ransport/client.rb:128:in
perform_request'", "/etc/logstash-6.0.1/plugin/plugin/logstash-2.3.4/vendor/bundle/jruby/1.9/gems/elasticsearch-api-1.0.18/lib/elasticsearch/api/actions/bulk.rb:9 0:in bulk'", "/etc/logstash-6.0.1/plugin/plugin/logstash-2.3.4/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-2.7.1-java/lib/logstash/outputs/elasticsearch/http_client.rb:53:in
non_threadsafe_bulk'", "/etc/logstash-6.0.1/plugin/plugin/logstash-2.3.4/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-2.7.1-java/lib/logstash/outputs/elasticsearch/http_clie nt.rb:38:in bulk'", "org/jruby/ext/thread/Mutex.java:149:in
synchronize'", "/etc/logstash-6.0.1/plugin/plugin/logstash-2.3.4/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-2.7 .1-java/lib/logstash/outputs/elasticsearch/http_client.rb:38:in bulk'", "/etc/logstash-6.0.1/plugin/plugin/logstash-2.3.4/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-2.7.1-j ava/lib/logstash/outputs/elasticsearch/common.rb:172:in
safe_bulk'", "/etc/logstash-6.0.1/plugin/plugin/logstash-2.3.4/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-2.7.1-java /lib/logstash/outputs/elasticsearch/common.rb:101:in submit'", "/etc/logstash-6.0.1/plugin/plugin/logstash-2.3.4/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-2.7.1-java/lib/l ogstash/outputs/elasticsearch/common.rb:86:in
retrying_submit'", "/etc/logstash-6.0.1/plugin/plugin/logstash-2.3.4/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-2.7.1-java/lib