mirror of
https://github.com/projecthorus/sondehub-infra.git
synced 2025-01-31 07:55:24 +00:00
add debugging for failing request
This commit is contained in:
parent
224ce5c792
commit
30f1cea3de
@ -67,8 +67,11 @@ def get_sondes(event, context):
|
|||||||
payload["query"]["bool"]["filter"].append(
|
payload["query"]["bool"]["filter"].append(
|
||||||
{"range": {"datetime": {"gte": "now-1d", "lte": "now+1m"}}}
|
{"range": {"datetime": {"gte": "now-1d", "lte": "now+1m"}}}
|
||||||
)
|
)
|
||||||
|
try:
|
||||||
results = es.request(json.dumps(payload), path, "POST")
|
results = es.request(json.dumps(payload), path, "POST")
|
||||||
|
except:
|
||||||
|
print(json.dumps(event))
|
||||||
|
raise
|
||||||
buckets = results["aggregations"]["2"]["buckets"]
|
buckets = results["aggregations"]["2"]["buckets"]
|
||||||
sondes = {
|
sondes = {
|
||||||
bucket["1"]["hits"]["hits"][0]["_source"]["serial"]: bucket["1"]["hits"][
|
bucket["1"]["hits"]["hits"][0]["_source"]["serial"]: bucket["1"]["hits"][
|
||||||
|
Loading…
x
Reference in New Issue
Block a user