Use Logstash for execute enrich policy with HTTP output

Hello,

I need to schedule the execution of an enrich policy. I think i can use Logstash for that, with an HTTP output.

Actualy, i have a Logstash who send data to Elasticsearch from Mysql Database. These data are going to be used for enrich other data.
So, i think it can be cool to execute my enrich policy just after sending my data with Logstash.

There is my conf :

input {
  jdbc {
    jdbc_driver_library => "D:\Beat\Logstash\Logstash_Enrich\connecteurs\mysql-connector-java-5.1.49.jar"
    jdbc_driver_class => "com.mysql.jdbc.Driver"
	jdbc_connection_string => "jdbc:mysql://Mysql:3306/tools?useSSL=true&requireSSL=true"
    jdbc_user => "xxxxxxxx"
    jdbc_password => "xxxxxxxxx"
#    schedule => "* * * * * *"
	statement => "
	SELECT xxxx
	FROM xxx 
	"
  }
}
filter {
}
output {
    stdout {
        codec => rubydebug
    }
	elasticsearch {
		hosts => ["https://myelk:9200"]
		index => "myindex"
		action =>"update"
		doc_as_upsert => true
		document_id=>"myid"
		user => "aSuperCoolUser"
		password => "xxxxxxx"
	}
	http {
		http_method=> "put"
		url=>	"https://myuser:mypassword@myelk:9243/_enrich/policy/enrich_policy_test002/_execute"
	}
}

The Elasticsearch Output run correcty. But a have an error related to my HTTP output :

[HTTP Output Failure] Encountered non-2xx HTTP code 400

Is other informations needed ? How can i solve this error ?

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