elastic / makelogs

109 stars 44 forks source link

[createIndex] roll past when index patterns do not exist #15

Closed spalger closed 8 years ago

spalger commented 8 years ago

makelogs dies if the index templates don't magically exist.

$ makelogs -c 40k -d 8 --auth=admin:admin
Generating 40000 events from 2016-01-03T00:00:00+00:00 to 2016-01-19T23:59:59+00:00
? Existing logstash-* indices and/or index templates were found, can they be replaced? Yes
clearing existing "logstash-*" index templates and indices
Error: [index_template_missing_exception] index_template [makelogs_index_template__logstash-] missing
    at respond (/Users/d33t/.nvm/versions/node/v0.12.9/lib/node_modules/makelogs/node_modules/elasticsearch/src/lib/transport.js:256:15)
    at checkRespForFailure (/Users/d33t/.nvm/versions/node/v0.12.9/lib/node_modules/makelogs/node_modules/elasticsearch/src/lib/transport.js:219:7)
    at HttpConnector.<anonymous> (/Users/d33t/.nvm/versions/node/v0.12.9/lib/node_modules/makelogs/node_modules/elasticsearch/src/lib/connectors/http.js:155:7)
    at IncomingMessage.wrapper (/Users/d33t/.nvm/versions/node/v0.12.9/lib/node_modules/makelogs/node_modules/elasticsearch/node_modules/lodash/index.js:3095:19)
    at IncomingMessage.emit (events.js:129:20)
    at _stream_readable.js:908:16
    at process._tickCallback (node.js:355:11)
w33ble commented 8 years ago

This happened when I used the current stable version of makelogs first, and then tried to use the beta.

I can confirm if this works once it's up on npm.

w33ble commented 8 years ago

Installed this branch via github, and it runs correctly now. Should be good to merge.