Skip to content
/ es_query Public

A way to make easy requests to Elastic Search without suffering the Kibana editor

Notifications You must be signed in to change notification settings

arudp/es_query

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

es_query

Command to run an ElasticSearch query from the command line.

Deps to install with pip3:

pip3 install --upgrade pip && pip3 install click requests

Pipe the query through the stdin (e.g., cat file or echo) and run it:

echo ${QUERY} | python3 es.py --host es-prod --endpoint project_drafts/_search --pretty

Where es-prod is the name of the host in /etc/hosts

Of course, this can be written to a file or piped into something like jq for pretty printing. I'd recommend to alias it in your .rc file:

alias es_prod="python3 /path/to/es.py --host es-prod --endpoint

$ echo ${QUERY} | es_prod project_drafts/_search --pretty | jq | less

You can also add an executable to your PATH:

#!/bin/bash

PYTHONPATH=/path/to/python3/bin python3 /path/to/es.py $@

About

A way to make easy requests to Elastic Search without suffering the Kibana editor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages