2017-01-04 8 views
0

私はElasticsearch 5.1.1でマッピングeventlogを作成しました。私はそれを正常に追加したが、その下にデータを追加している間に、私はIllegal_argument_exceptionと理由unknown setting [index._id]を得ている。インデックスを取得してからの私の結果は私のマッピングがあるyellow open eventlog sX9BYIcOQLSKoJQcbn1uxg 5 1 0 0 795b 795bElasticsearchにデータを追加中に[index._id]エラーが発生する

です:

{ 
    "mappings" : { 
    "_default_" : { 
     "properties" : { 
      "datetime" : {"type": "date"}, 
      "ip" : {"type": "ip"}, 
      "country" : { "type" : "keyword" }, 
      "state" : { "type" : "keyword" }, 
      "city" : { "type" : "keyword" } 
     } 
     } 
    } 
} 

と私は{"index":{"_id":1}}行が含まれていない場合は

curl -u elastic:changeme -XPUT 'http://localhost:8200/eventlog' -d '{"index":{"_id":1}} 
{"datetime":"2016-03-31T12:10:11Z","ip":"100.40.135.29","country":"US","state":"NY","city":"Highland"}'; 

を使用してデータを追加していて、私はIllegal_argument_exceptionを取得します理由はunknown setting [index.apiKey]です。

+0

試行ID { "インデックス":{ "ID":1}}に '_' 取り除くことによって –

+0

ことを試み@vinod_vh。うまくいきませんでした。今私は '不明な設定[index.id]'を得ています。 – khateeb

+0

その後、jsonファイルをよりよく渡します。http://stackoverflow.com/questions/41261302/do-we-can-upload-data-into-elasticsearch-using-json-file/41262017#41262017 –

答えて

0

コマンドラインからのデータを文字列として送信する際に問題が発生しました。データをJSONファイルに保存し、binaryとして送信すると解決しました。正しいコマンドは次のとおり

curl -u elastic:changeme -XPUT 'http://localhost:8200/eventlog/_bulk?pretty' --data-binary @eventlogs.json 
関連する問題