Hello,
I am trying to implement an ElasticSearch server to store and display analysis of https answer.
What I'm doing is that I send all the documents via python with the following code :
i = 0
for answer in answers:
query = json.dumps(answer)
url = "http://localhost:9200/piccolo-" + str(answer["campaign"]) + "/answer/" + str(i)
response = requests.post(url, data=query)
i += 1
return redirect("/", code=302)
which send a packet like this to the ElasticSearch server :
`#@l#FdnV+
U
UPOST /piccolo-0/answer/1023 HTTP/1.1
Host: localhost:9200
Content-Length: 584
User-Agent: python-requests/2.9.1
Connection: keep-alive
Accept: */*
Accept-Encoding: gzip, deflate
{"trust_flag": "trusted", "alert_type": "", "ordered": 0, "campaign": 0, "grade": "D", "ip": "104.20.77.29", "type_str": "TLS 1.2 Handshake (49195)", "complete": 1, "chain_hash": "174bb3c4415d932d291569cd123a9f9f58ec16d9", "version": 771, "answer_type": 21, "type": "TLS 1.2 Handshake (49195)", "ciphersuite": 49195, "timestamp_str": "2015-12-16 10:01:36", "timestamp": 1450260096, "alert_level": "", "date": "2015-12-16 10:01:36", "_timestamp": 1450260096, "name": "txxx.com", "n_transvalid": 2, "rfc": 1, "cipherphrase": "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", "chain_length": 6}
And when I try to get the document with the rest API, I get something like this :
{
"_index": "piccolo-0",
"_type": "answer",
"_id": "1",
"_version": 1,
"_timestamp": 1450260096,
"found": true,
"_source": {
"trust_flag": "trusted",
"alert_type": "",
"ordered": 1,
"campaign": 0,
"grade": "B",
"ip": "23.3.13.42",
"type_str": "TLS 1.2 Handshake (49199)",
"complete": 1,
"chain_hash": "5e66cc799c18d0c05e339f9314e904527cf1e8f7",
"version": 771,
"answer_type": 21,
"type": "TLS 1.2 Handshake (49199)",
"ciphersuite": 49199,
"timestamp_str": "2015-12-16 10:01:36",
"timestamp": 1450260096,
"alert_level": "",
"date": "2015-12-16 10:01:36",
"_timestamp": 1450260096,
"name": "target.com",
"n_transvalid": 0,
"rfc": 0,
"cipherphrase": "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256",
"chain_length": 3
}
}
Which is what I want, but I didn't find the way to visualize all those documents into Kibana4.
Thanks in advance for all the help you will provide me