Can someone tell me why this is failing with Invalid authorization? I think that the endpoint is as documented.
WEBHOOK_URL = 'https://localhost:8088/services/collector/event'
#headers = {'Content-Type': 'application/json'}
headers={'Authorization': 'A1DD6F1E-0F63-40CF-9A15-C82B36AFD89F', 'Content-Type': 'application/json'}
message = { "index":"main", "sourcetype":"xqe_metric", "event":"Testing"}
print WEBHOOK_URL, headers, message
connection = httplib.HTTPSConnection('localhost:8088')
connection.request('POST', WEBHOOK_URL, json.dumps(message), headers)
response = connection.getresponse()
print response.read().decode(), '/n'
Response
Failed="no"
http://localhost:8088/services/collector/event {'Content-Type': 'application/json', 'Authorization': 'A1DD6F1E-0F63-40CF-9A15-C82B36AFD89F'} {'index': 'main', 'sourcetype': 'xqe_metric', 'event': 'Testing'}
{"text":"Invalid authorization","code":3} /n
![alt text][1]
[1]: /storage/temp/110173-screen-shot-2016-03-03-at-42206-pm.png
↧