https://github.com/arsen/elastic-tools
CLI Utilities to export/import data from elasticsearch as json
https://github.com/arsen/elastic-tools
dump-files elasticsearch export-json import-json
Last synced: about 2 months ago
JSON representation
CLI Utilities to export/import data from elasticsearch as json
- Host: GitHub
- URL: https://github.com/arsen/elastic-tools
- Owner: arsen
- License: mit
- Created: 2018-04-30T18:21:55.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-30T22:51:46.000Z (about 8 years ago)
- Last Synced: 2025-10-23T09:54:19.453Z (8 months ago)
- Topics: dump-files, elasticsearch, export-json, import-json
- Language: JavaScript
- Homepage:
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# elastic-tools
CLI Utilities to export/import JSON from elasticsearch
## Usage
### Exporting data to json
```bash
elastic-export --host 127.0.0.1:9200 --index MyIndex --out ./data.json
```
The \_id of the document from elastic's index will be part of the body of the exported document:
For example, this document from elastic:
```json
{
"_index": "users",
"_type": "_doc",
"_id": "1",
"_score": 1,
"_source": {
"active": true,
"name": "User 1",
"email": "email1"
}
}
```
will be exported to JSON like this:
```json
{
"_id": "1",
"active": true,
"name": "User 1",
"email": "email1"
}
```
### Importing data from json array
```bash
elastic-import --host 127.0.0.1:9200 --index MyIndex --data ./data.json
```