Skip to content

Instantly share code, notes, and snippets.

View jmlucjav's full-sized avatar

jmlucjav

  • Europe
View GitHub Profile
@jmlucjav
jmlucjav / jsonArrayToElasticsearch.js
Created June 5, 2018 12:28 — forked from stiekel/jsonArrayToElasticsearch.js
Import array in JSON file to Elasticsearch
// import json array file to elasticsearch
const fs = require('fs')
const shelljs = require('shelljs')
let endpoint = process.argv[2]
let jsonFile = process.argv[3]
if (!endpoint || !jsonFile || endpoint.search('_bulk') === -1) {
console.log('sample: node jsonArrayToES.js localhost:9200/bank/customer/_bulk customer.json')
process.exit()
}