No. They are not valid json files.
You need to provide one json file per document.

-- 
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr


Le 9 avril 2014 à 14:36:31, Prasanth R ([email protected]) a écrit:

Hi david,

 My json file contains data like this
 { "field1" : "value1" }
{ "field1" : "value2" }
{ "field1" : "value3" }

Is it possible to index with fsriver?.

My river/index creation as below,

curl -XPUT 'localhost:9200/_river/security/_meta' -d '{
  "type":"fs",
  "fs": {
    "url": "/Projects/elasticsearch-1.0.1/JSON/",
    "update_rate": 1000, 
    "json_support" : "true"
  },

"index":{
"index":"security",
"type":"logs",
"bulk_size":50
}
}

I am keep getting error saying that error 'Error while indexing content from 
/Projects/elasticsearch-1.0.1/JSON/'

Could you please help me out?
Thanks
Prasanth.R

On Thursday, November 21, 2013 11:01:40 PM UTC+5:30, David Pilato wrote:
Did you add a return after the last body?

-- 
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr


Le 21 novembre 2013 at 15:14:15, cml ([email protected]) a écrit:

Hi Rafal,
what I do is 
{"index":{"_index":"test","_type":"keywords","_id":"1"}}
{"keywords":"red"}

and i post as:
curl -s -XPOST 'http://192.168.213.158:9200/_bulk' --data-binary @keywords.json
Get an error:
{"error":"ActionRequestValidationException[Validation Failed: 1: no requests 
added;]","status":500}

any idea?






在 2013年4月10日星期三UTC+2下午11时49分56秒,Rafał Kuć写道:
Hello!

In order to send two documents in the same JSON file you need to use 
ElasticSearch Bulk API. You can find more information about it here: 
http://www.elasticsearch.org/guide/reference/api/bulk/

Basically your document would have to look like this:

{"index":{"_index":"test","_type":"test","_id":"1"}}
{"lane":"M05","routes":160}
{"index":{"_index":"test","_type":"test","_id":"2"}}
{"lane":"M04","routes":170}

If the above content would be stored in a file called bulk.json, you can send 
it using the following command:

curl -s -XPOST 'http://jfblouvmlxecs01:9200/_bulk' --data-binary @bulk.json

--
Regards,
 Rafał Kuć
 Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch - ElasticSearch


Thanks. I've tried adding the @ and that works for a very simple JSON document. 
 This is the one I used:
{"lane":"M05","routes":160}

I also tried adding this JSON doc with 2 rows (2 records)  like this, however 
it put both records under the same id:

{"lane":"M05","routes":160},{"lane":"M04","routes":170}

How can I do this when I have multiple records in the same .json file?

On Wednesday, April 10, 2013 5:03:43 PM UTC-4, Rafał Kuć wrote:
Hello!

You can find more information about indexing data here: 
http://www.elasticsearch.org/guide/reference/api/index_/

One thing I've noticed in your command is that you lack the @ character before 
the file name. Your command should look like this:

curl -XPOST 'http://jfblouvmlxecs01:9200/test/test/1' -d @lane.json

instead of the one you've pasted.

--
Regards,
 Rafał Kuć
 Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch - ElasticSearch


I'm completely new to Elasticsearch and I've been importing data to 
Elasticsearch up to this point by manually entering the JSON.

I'd like to begin loading in .json files to make things faster and possibly to 
bulk load in the future.  I'm not sure how to do this currently.  The .json 
would be generated from a SQL Server query and formatted as JSON by another 
layer, and then placed in a folder on the server.

I've attempted to run this code to index the JSON, however I get an error 
message:

[root@JFBLOUVMLXECS01 ~]# curl -XPOST 'http://jfblouvmlxecs01:9200/test/test/1' 
-d lane.json
{"error":"ElasticSearchParseException[Failed to derive xcontent from (offset=0, 
length=9): [108, 97, 110, 101, 46, 106, 115, 111, 
110]]","status":400}[root@JFBLOUVMLXECS01 ~]#

Any help you can provide would be much appreciated.  Please keep in mind I'm a 
total noob with this.
--
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
 


--
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
--
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/6b1e4ba4-8734-451d-9da5-83b52cafd5f2%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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/etPan.53456009.2901d82.164d%40MacBook-Air-de-David.local.
For more options, visit https://groups.google.com/d/optout.

Reply via email to