Index postgreSQL to elasticsearch


#1

any tips on how to index postgreSQL to elasticsearch, i followed

http://blog.comperiosearch.com/blog/2014/01/30/elasticsearch-indexing-sql-databases-the-easy-way/

by installing

and see below error

curl: (6) Couldn't resolve host 'id,date_time,status,step,process,service_name,host_name,app_name'
curl: (6) Couldn't resolve host 'from'
curl: (6) Couldn't resolve host 'activity_monitor_transaction'
curl: (6) Couldn't resolve host 'where'
curl: (6) Couldn't resolve host 'date_time'

here is the curl command

curl -XPUT "http://localhost:9200/_river/actmon/_meta" -d'
{
"type": "jdbc",
"jdbc": {
"driver": "org.postgresql.Driver",
"url": "jdbc:postgresql://xxxx:5432/aicpgsd",
"user": "actmon",
"password": "atmp95",
"index": "actmon",
"type": "actmon",
"sql": "select id,date_time,status,step,process,service_name,host_name,app_name from activity_monitor_transaction
where date_time BETWEEN '2015-07-01' AND '2015-07-10'"
}
}'


#2

It seems your curl is not working. Have you tried to do something like curl http:www.google.com ?
Try this to check if curl is fine.


#3

curl is fine, i am able to load some json file but not this particular one


(David Pilato) #4

Are you running on Windows?


#5

no on linux


(Jörg Prante) #6

Your JSON is invalid for the shell. Check the apostrophes/single quotes in the SQL. They conflict with shell and curl -d parameter. Please use shell escape.


(system) #7