[英]Python, ElasticSearch/Kibana 'kibanaSavedObjectMeta' Visualization Metadata Index replace
[英]ElasticSearch - Kibana - Not able to get Index Pattern with Python
我正在创建一个python脚本,以访问在Kibana上创建的索引模式。 首先,我尝试使用以下方式列出该索引:
for index in es.indices.get('*'):
print index
如果我在管理上转到Kibana-> Kibana->索引模式,则会看到以下索引:
但是,当我运行上一个脚本时,我只能看到使用此脚本创建的索引:
from datetime import datetime
from elasticsearch import Elasticsearch
es = Elasticsearch()
doc = {
'author': 'John',
'text': 'Elasticsearch: good tool',
'timestamp': datetime.now(),
}
res = es.index(index="test-index", doc_type='tweet', id=1, body=doc)
print(res['result'])
我的问题是:当我调用“ es.indices”时,我是否无法从Kibana访问索引? 为什么我无法在Python中使用Elasticsearch库看到索引模式?
谢谢!
您可以尝试-doc在这里 :
resultL = []
res = es.cat.indices(format="json")
for line in res:
resultL.extend([line[key] for key in line if key==u"index"])
return resultL
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.