/aws-es-cli

CLI to access elasticsearch cluster on AWS

Primary LanguageJavaScript

aws-es-cli

A little utility to access a secured AWS hosted Elasticsearch cluster via command line. This simply wraps Elasticsearch javascript client with http-aws-es.

Install

npm install -g https://github.com/parthshah/aws-es-cli.git

aws-es-cli

Usage

aws-es$ help

  Commands:

    help [command...]             Provides help for a given command.
    exit                          Exits application.
    connect [options] [uri...]
    exec [options] [fn] [params]
    disconnect
  • Connect to AWS Elasticsearch
aws-es$ connect -k {aws-access-key-id} -s {aws-secret-access-key} {elasticsearch-host}

Get params from file...

params/search.json:

{
  "index": "projects",
  "type": "projectV4",
  "body": {
    "query": {
      "match": {
        "name": "test"
      }
    }
  }
}
aws-es$ exec search -f params/search.json
[info] {
"took": 19,
"timed_out": false,
"_shards": {
  "total": 5,
  "successful": 5,
  "failed": 0
},
"hits": {
  "total": 454,

  ...

Pass params inline

aws-es$ exec search '{"index": "projects", "type": "projectV4", "body": { "query": { "match": {"name": "test"}}}}'