python elasticsearch模块使用,,环境 :pyhton


环境 :pyhton3

加载模块fromelasticsearchimportElasticsearch连接ESes=Elasticsearch(["172.30.6.12"])查询res=es.search(index="test-index",body={"query":{"match_all":{}}})#查询请求主机是ai.baidu.com所有信息res=es.search(index="packetbeat-*",body={'query':{'match':{'http.request.headers.host':'ai.baidu.com'}}})res=es.search(index="test-index",body={'query':{'match':{'any':'data'}}})#获取any=data的所有值


参考链接:https://www.cnblogs.com/yxpblog/p/5141738.html




python elasticsearch模块使用

评论关闭