· 6 years ago · Mar 07, 2019, 10:42 AM
1import requests
2from requests_aws4auth import AWS4Auth
3
4...
5aws_auth = AWS4Auth(access_key, secret_key, region, es_service, session_token=token)
6
7res = requests.request(url=url, method=method, data=query, headers={'Content-Type': 'application/json'}, auth=aws_auth)
8
9if not res.ok:
10 print(res.text)
11
12...
13
14GET log_index/_doc/_search?q=country_code:US
15
16GET log_index/_doc/_search?q=country_code:(US OR CA)
17
18GET log_index/_doc/_search?q=country_code:US AND os:windows