Elastic Search
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import elasticsearch | |
| def scroll_query(es, index, query): | |
| """ | |
| :param es: an elasticsearch client object created with elasticsearch.Elasticsearch() | |
| :param index: the name of the log to query (e.g. 'conn', 'timetohello', etc.) | |
| :param query: elasticsearch query (docs on elastic.co) | |
| :return: iterator containing results of elastic query |