write-line

Estimated time to read: 1 minute

Experimental-feature notice

This page discusses experimental features. Experimental features are still in progress, and you may encounter bugs or unexpected behavior when using them.

If you experience an issue or want to know more about this feature's status, reach out to us at Era Software.

This command sends an HTTP POST request with the contents of a JSON file to the EraSearch API as an individual document/log line.

Warning

This command requires write access to any indices in the payload.

usage: eractl write-line [-h] [--url URL] [--key KEY] file_path index

positional arguments:
  file_path   Path to JSON file
  index       Index

optional arguments:
  -h, --help  show this help message and exit
  --url URL       EraSearch URL, set via environment with ERACTL_URL (default: http://localhost:9200)
  --key KEY       EraSearch API key, set via environment with ERACTL_API_KEY (default: None)

To run:

eractl write-line --url https://erasearch.example.com --key ****** path/to/file.json my-index

Or to pass arguments from the environment:

export ERACTL_URL="https://erasearch.example.com"
export ERACTL_API_KEY="******"
eractl write-line path/to/file.json my-index

Last update: October 6, 2022