[英]Pushing JSON files to elasticsearch using Python Script: Works but does not show up in Kibana
背景资料:
嗨,
我一直在尝试使用自定义脚本将JSON文件推送到Elasticsearch中,该脚本运行并完成-但是,当我检查Elasticsearch和Kibana时,索引存在,但我发送的所有文档都没有上载。 我已经做过无数次了。 不知道我要去哪里错了,因为这以前可行-
码
#Change the IP as desiered
es = Elasticsearch(
['localhost'],
timeout=420000,
port=9200
)
print ("Start")
#Append to this list if all files from a folder have been uploaded
done_list = []
filenames = os.listdir("/home/directory/file_json")
print(filenames)
for current_folder in filenames:
for f in glob.glob("/home/directory/file_json/"+current_folder+"/*.json"):
print("File Open")
MyFile = open(f).read()
print("Bulking - "+f)
es.bulk(MyFile,"test","_doc")
print("done elasticsearch")
done_list.append(current_folder)
print(current_folder + " done")
print ("Finished")
如果有人能让我知道这是否有某种错误,或者我错过了某些东西,将不胜感激。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.