Exception with posting jdbc river config

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 elasticsearch+unsubscribe@googlegroups.com.
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.

2 ways to post data using curl:

  1. the data here need to be bracketed like curl -XPUT '' -d '{ "foo": "bar" }'
  2. 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 elasticsearch+unsubscribe@googlegroups.com.
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/20141223104447.GA24617%40Lain.routerbf573c.com.
For more options, visit https://groups.google.com/d/optout.

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:

  1. the data here need to be bracketed like curl -XPUT '' -d '{ "foo": "bar" }'
  2. 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.

Use data binary flag

curl -XPUT "http://localhost:9200/_river/mybooks/_meta" --data-binary
"@put.json"

Jörg

On Tue, Dec 23, 2014 at 12:25 PM, Ashutosh Parab ashusheva@gmail.com
wrote:

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
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:

  1. the data here need to be bracketed like curl -XPUT '' -d '{ "foo": "bar" }'
  2. 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.
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
https://groups.google.com/d/msgid/elasticsearch/6ce878a8-9ee6-47dd-8f6b-177248da2b31%40googlegroups.com?utm_medium=email&utm_source=footer
.

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/CAKdsXoG2sTq8B404kHiDY%3DmH0z2K1No_3iZeAgaMKz_7suasUg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Hi Jorg,

Though converting to binary it still dosent parse do you have any
documentation for jdbc river in windows.The linux one was very helpful but
not much support for windows.\

Regards,
Sanu

--
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/877a6ce9-f0bb-4608-a365-ca71596ab6e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

What is your problem with JDBC plugin exactly? Can you post the error
message?

Jörg

On Mon, Apr 6, 2015 at 6:19 AM, Sanu Vimal sanuvimal@gmail.com wrote:

Hi Jorg,

Though converting to binary it still dosent parse do you have any
documentation for jdbc river in windows.The linux one was very helpful but
not much support for windows.\

Regards,
Sanu

--
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/877a6ce9-f0bb-4608-a365-ca71596ab6e7%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/877a6ce9-f0bb-4608-a365-ca71596ab6e7%40googlegroups.com?utm_medium=email&utm_source=footer
.

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/CAKdsXoH9v0-58eTEy4-zFBNZbuBE_n7J988AHbb_EtWLVEkPTQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.