Skip to content

Instantly share code, notes, and snippets.

@throughnothing
Forked from mago0/gist:3289623
Created August 7, 2012 21:45
Show Gist options
  • Save throughnothing/3289647 to your computer and use it in GitHub Desktop.
Save throughnothing/3289647 to your computer and use it in GitHub Desktop.
Search ElasticSearch with Curl
#!/bin/bash
if [ $# -ne 4 ]; then
echo "Usage: $0 <'password'> <index> <field> <value>"
fi
password=$1
index=$2
field=$3
value=$4
curl -k --user admin:$password -XGET "https://SERVER/${index}/_search?pretty=1" -d "{ query : { term : { $field : $value } } }"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment