zelasticsearch.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:csirtg-smrt-py 作者: csirtgadgets 项目源码 文件源码
def _create_index(self):
        dt = datetime.utcnow()
        dt = dt.strftime('%Y.%m')
        es = connections.get_connection()
        if not es.indices.exists('indicators-{}'.format(dt)):
            index = Index('indicators-{}'.format(dt))
            index.aliases(live={})
            index.doc_type(Indicator)
            index.create()

            m = Mapping('indicator')
            m.field('indicator_ipv4', 'ip')
            m.field('indicator_ipv4_mask', 'integer')
            m.save('indicators-{}'.format(dt))
        return 'indicators-{}'.format(dt)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号