Error while indexing data to App Search using Logstash

Hi Team,

I have been trying to index the data from local Elasticsearch cluster to App Search engine using logstash. But I'm getting the below error.

Copy to clipboard

[2021-02-01T13:45:30,097][DEBUG][logstash.javapipeline    ][main] Pipeline terminated by worker error {:pipeline_id=>"main", :exception=>#<LogStash::ConfigurationError: Failed to connect to App Search. Error making http request>, :backtrace=>["C:/Users/local/logstash-7.8.1/vendor/bundle/jruby/2.5.0/gems/logstash-output-elastic_app_search-1.0.0/lib/logstash/outputs/elastic_app_search.rb:37:in `register'", "org/logstash/config/ir/compiler/OutputStrategyExt.java:126:in `register'", "org/logstash/config/ir/compiler/AbstractOutputDelegatorExt.java:68:in `register'", "C:/Users/local/logstash-7.8.1/logstash-core/lib/logstash/java_pipeline.rb:226:in `block in register_plugins'", "org/jruby/RubyArray.java:1809:in `each'", "C:/Users/local/logstash-7.8.1/logstash-core/lib/logstash/java_pipeline.rb:225:in `register_plugins'", "C:/Users/local/logstash-7.8.1/logstash-core/lib/logstash/java_pipeline.rb:541:in `maybe_setup_out_plugins'", "C:/Users/local/logstash-7.8.1/logstash-core/lib/logstash/java_pipeline.rb:238:in `start_workers'", "C:/Users/local/logstash-7.8.1/logstash-core/lib/logstash/java_pipeline.rb:183:in `run'", "C:/Users/local/logstash-7.8.1/logstash-core/lib/logstash/java_pipeline.rb:134:in `block in start'"], "pipeline.sources"=>["c:/Users/local/logstash-7.8.1/bin/es-as-test.conf"], :thread=>"#<Thread:0x599df170 run>"}
[2021-02-01T13:45:30,142][ERROR][logstash.agent           ] Failed to execute action {:id=>:main, :action_type=>LogStash::ConvergeResult::FailedAction, :message=>"Could not execute action: PipelineAction::Create<main>, action_result: false", :backtrace=>nil}

Please find my configuration below.

Copy to clipboard

    input {
        elasticsearch {
            hosts => [ "localhost:9200" ]
    		index => "poc_import"
    		query => '{"query": {"match_all": {}}}'
    		size => 10
        }
    }

    output {
    	elastic_app_search {
    		url => "appsearch.pks.test.com"
    		api_key => "private-4qqtesdfsdfsdfewergadryz"
    		engine => "sanjay"
    		path => "/api/as/v1/"
    	}
    }

Not sure why it is not able to make the HTTP request.

Have already raised this issue (Error while indexing data to App Search - #2 by Vadim_Yakhin), but app Search team have redirected me here. Please help me in resolving this issue.

Thanks,
Dharma Sanjay Reddy M.