https://www.elastic.co/guide/en/elasticsearch/reference/curr...
There is a Python implementation that makes creating complex queries pretty easy:
https://github.com/elastic/elasticsearch-dsl-py
I agree with the criticisms of Kibana, but I have had no problems querying Elasticsearch directly. It also supports scripted queries if the built-in aggregations aren't enough.
Of course, then you have to build your own visualizations with the results...