I have created a put.json file with the following contents:-
{
"type":"jdbc",
"jdbc":
{"driver":"com.microsoft.sqlserver.jdbc.SQLServerDriver",
"url":"jdbc:sqlserver://LOCALHOST\SQLEXPRESS;databaseName=Report
_ME",
"user":"user",
"password":"password","sql":"select * from
[Report.[dbo].[abc]"
}
}
I try to post config using the command curl -XPUT
"http://localhost:9200/_river/mybooks/_meta" -d put.json.
Got the below error:-
C:>curl -XPUT "http://localhost:9200/_river/mybooks/_meta" -d put.json
{"error":"MapperParsingException[failed to parse]; nested:
ElasticsearchParseExc
eption[Failed to derive xcontent from (offset=0, length=8): [112, 117, 116,
46,
106, 115, 111, 110]]; ","status":400}
Please advice
On Tuesday, 23 December 2014 16:15:00 UTC+5:30, Jason Zhang wrote:
2 ways to post data using curl:
- the data here need to be bracketed like
curl -XPUT '' -d '{ "foo": "bar" }'
- put the data into file, then
curl -XPUT '' -d @put.json
.
I think the second is preferred.
On Tue 23.23.14 02:18, Ashutosh Parab wrote:
I am trying to post jdbc river config using CURL -XPUT on Windows Xp. I
want to transfer data from MS SQL database into Elastic Search. However
I
am getting some exceptions. My Elastic Search version is 1.0.1
C:>curl -XPUT "http://localhost:9200/_river/mybooks/_meta" -d
{"type":"jdbc","j
dbc":{"driver":"com.microsoft.sqlserver.jdbc.SQLServerDriver","url":"jdbc:sqlser
ver://LOCALHOST\SQLEXPRESS;databaseName=Report","user":
"user","password":"password","sql":"select * from [Report].[dbo
].[abc]","index":"pkId","type":"bigint"}}
{"error":"MapperParsingException[failed to parse]; nested:
JsonParseException[Un
recognized token 'jdbc': was expecting ('true', 'false' or 'null')\n at
[Source:
[B@c7947e; line: 1, column: 12]]; ","status":400}
C:>
Can someone please check the syntax of my curl command?
--
You received this message because you are subscribed to the Google
Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/e6fdea56-ca5e-4905-a68b-042472a77fc1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/6ce878a8-9ee6-47dd-8f6b-177248da2b31%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.