Last active
August 29, 2015 14:01
-
-
Save miku/8b15e43d72d0dca3aeaf to your computer and use it in GitHub Desktop.
Elasticsearch wrapper (cat and top)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function escat() { | |
INDEXCAT="curl -sL localhost:9200/_cat/indices" | |
if [ $# -eq 0 ]; then | |
$INDEXCAT|sort -k2 | |
else | |
case $1 in | |
-s) $INDEXCAT|sort -nrk 5; shift 1;; | |
-S) $INDEXCAT|sort -nrk 5; shift 1;; | |
-n) $INDEXCAT|sort -k 2; shift 1;; | |
-t) $INDEXCAT|sort -k 1; shift 1;; | |
*) shift 1;; | |
esac | |
fi | |
} | |
function estop() { | |
clear | |
while true; do escat "$@"; sleep 2; clear; done | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment