logstash mutate add_field-索引时如何在python中执行

问题描述

我在编写索引时在Logstash中使用以下内容

mutate {add_field => [ "[NEW_FIELD_INT]","%{OLD_FIELD_STRING}" ]}
mutate {convert => {"NEW_FIELD_INT" => "integer"}

如何使用Python使用它?

这是我的转储代码段:

# dump json to index
with open('\path\_file.json') as f:
    json_docs = json.loads(f.read())
    for json_doc in json_docs:
        my_id = json_doc.pop('_id',None)
        es.index(index=index_name,doc_type='_doc',id=my_id,body=json.dumps(json_doc))

感谢您的帮助 问候

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)