I would like to import some data from index e.g. "logstash-2016-07-01" to new index.
So I created new index using:
curl -XPUT 'hostname:port/anomaly/'
Next I searched data what I need using this query:
curl 'hostname:port/logstash-2016.07*/_search?pretty' -d @/tmp/query > /tmp/json.data
/tmp/query
{"size":500,"sort":[{"@timestamp":{"order":"desc","unmapped_type":"boolean"}}],"query":{"filtered":{"query":{"query_string":{"analyze_wildcard":true,"query":"*:*"}},"filter":{"bool":{"must":[{"range":{"@timestamp":{"gte":1468965600000,"lte":1469138400000}}}],"must_not":[]}}}}}
I obtained correct data in json format. And I would like import these data to new index "anomaly". So I tried this:
curl -XPUT hostname:port/_bulk --data-binary @/tmp/json.data
{"error":"JsonParseException[Unexpected end-of-input: expected close marker for OBJECT (from [Source: [B@10e3753c; line: 1, column: 0])\n at [Source: [B@10e3753c; line: 1, column: 3]]","status":500}
Any ideas how to import /tmp/json.data to index 'anomaly'?