Ogstash.javapipeline ][main] Pipeline aborted due to error {:pipeline_id=>"main", :exception=>#<LogStash::Json::ParserError: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')

hi there . im trying to import data to elastic cloud but getting this error .

my conf file looks like this

</>

input{
file{
path => "/home/saidjon/Downloads/big_data/urbandict-word-defs.csv"
start_position => "beginning"
sincedb_path => "NUL"

}

}

filter{
csv{ columns => ['word_id','word','up_votes','down_votes','author','definition']
}
}

output{

	elasticsearch{
		hosts          =>    ["https://elastic host :9243"]
		 user          =>   "xxx"
		 password      =>    "xxxx"
		index         =>    "upc_words"
	}

}

this keeps getting error . ogstash.javapipeline ][main] Pipeline aborted due to error {:pipeline_id=>"main", :exception=>#<LogStash::Json::ParserError: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')

but when i try to import into local elastic host with this conf (changing only host of course) it works .
please help . it's been two days i am stuck here , no progress , searched , tried every answer no hope ,
looking forward to get some help , cheers.

My guess is that https://elastic host :9243 is returning HTML. The output expects it to send JSON. Conceivably an authentication error. Does elasticsearch log anything when you start logstash?

Hi @saidjon, welcome to our community forums!

From what I understand, if you change the hosts value to the Elasticsearch Service endpoint URL, then you are encountering this issue. I am not sure if that would help but you could take a look at our documentation. I am just wondering whether the hosts value you specified is correct or not.

If you are still encountering any problems, can you run Logstash with debug logging and provide the logs here (please remove any sensitive information)? For example:

  • bin/logstash --debug -f <PATH_TO_CONFIG_FILE>

Thank you.

hi @ropc , thanks for your reply. i uploaded the whole log to github ,its too long too post it here . can you look at it https://github.com/saidjons/elastic_cloud_error

yeah , it 's responding with html output , i tried with new password , but its the same ,

@saidjon Thank you for the logs provided.

  1. I see that you are using the Cloud ID. That can be useful in certain scenarios as described in the note section in the documentation I just shared.

  2. Your hosts value in the Elasticsearch output plugin actually points to your Kibana endpoint URL. This is where the problem lies. You need to use the Elasticsearch endpoint URL. You can find it in your Elasticsearch Service Console by browsing to:

  • Deployments => <deployment_name> => Elasticsearch and click on Copy Endpoint URL.

Use this endpoint URL as the hosts value in your Elasticsearch output plugin and you should be good to go.

Oh man . What a stupid error from me . Thank you so much to point it out. It's working.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.