Created
March 1, 2018 17:31
-
-
Save clarkgrubb/1c5828fecbeeed34883b42d5e92c81f9 to your computer and use it in GitHub Desktop.
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
for network in facebook gemini outbrain taboola | |
do | |
curl 'http://signals-es-access-1.test.inspcloud.com:9200/signals_${network}_ads/defaultSettings/_search' \ | |
-d '{"query":{"match_all":{}}}' \ | |
| ./make_convenient.py \ | |
| jq . \ | |
> signals_${network}_ads/defaultSettings.json | |
done | |
cat ~/make_convenient.py | |
#!/usr/bin/env python3 | |
import json | |
import sys | |
input_data = json.loads(sys.stdin.read()) | |
customer_to_defaultSettings = {} | |
for hit in input_data['hits']['hits']: | |
customer = hit['_id'] | |
defaultSettings = hit['_source']['defaultSettings'] | |
customer_to_defaultSettings[customer] = defaultSettings | |
sys.stdout.write(json.dumps(customer_to_defaultSettings)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment