Skip to content

Instantly share code, notes, and snippets.

@portante
Last active July 11, 2017 02:29
Show Gist options
  • Select an option

  • Save portante/edb5c785040e116bfd6eb63cf35d40e8 to your computer and use it in GitHub Desktop.

Select an option

Save portante/edb5c785040e116bfd6eb63cf35d40e8 to your computer and use it in GitHub Desktop.
A simple script to emit a timestamped number of the count of documents currently in ES
#!/bin/bash
ES_URL='https://localhost:9200'
curl_get='curl -s -X GET --cacert /etc/elasticsearch/secret/admin-ca --cert /etc/elasticsearch/secret/admin-cert --key /etc/elasticsearch/secret/admin-key'
# Full Date Stamp Epoch Timestamp Count
# 2017-07-11T02:25:50 1499739950 02:25:50 36208782
for i in {1..30}; do
echo "$(date +%Y-%m-%dT%H:%M:%S) $($curl_get $ES_URL/_cat/count)"
sleep 10
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment