NDJSON is a convenient format for storing or streaming structured data that may be processed one record at a time.
- Each line is a valid JSON value
- Line separator is ‘\n’
cat test.json | jq -c '.[]' > testNDJSON.json
#!/bin/bash | |
################################################################ | |
##### script to backup lucene index from elastic search #### | |
################################################################ | |
# Shamelessly copied from https://gist.github.com/nherment/1939828 | |
NOW=`date +%Y%m%d%H%M%S` |
#!/usr/bin/env python | |
__author__ = "Evantha Manikpura" | |
import datetime | |
import argparse | |
from elasticsearch import Elasticsearch | |
ES_WRITER = None |
NDJSON is a convenient format for storing or streaming structured data that may be processed one record at a time.
cat test.json | jq -c '.[]' > testNDJSON.json
The "set" lines These lines deliberately cause your script to fail. Wait, what? Believe me, this is a good thing. With these settings, certain common errors will cause the script to immediately fail, explicitly and loudly. Otherwise, you can get hidden bugs that are discovered only when they blow up in production.
set -euo pipefail is short for:
set -e
set -u