GithubHelp home page GithubHelp logo

luckodjo / json-to-es-bulk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mradamlacey/json-to-es-bulk

0.0 0.0 0.0 4 KB

Utility to create an Elasticsearch bulk request from JSON data

License: MIT License

JavaScript 100.00%

json-to-es-bulk's Introduction

json-to-es-bulk

Simple utility that reads in a file (specified on the command line with -f) that contains an array of JSON data and outputs a new file with contents suitable as the request body for an Elasticsearch bulk request.

The utility will create a file named request-data.txt in the output path specified.

Limitations

  • Currently is required that there is a property named id in each object of the array in order to properly create the bulk request.
  • Only index operations are supported

The easy use-case for this tool is to use something like JSON-Generator to generate test data that can easily be converted to a bulk request.

Usage

Getting started

  • Clone this repo
  • Run npm install

Creating request data for an input file:

node index.js -f inputdata.json --index test --type test

This will read inputdata.json from the current directory, and create a bulk request to the test index to the test mapping.

Using curl to index the request data:

curl -XPOST http://localhost:9200/_bulk @<path to output file>

json-to-es-bulk's People

Contributors

mradamlacey avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.