跳转到主要内容

从JSL生成ElasticSearch模板

项目描述

jsl_elasticsearch 从JSL定义生成ElasticSearch映射。

它需要Python 3.4或更高版本(主要用于 functools.singledispatch)。

它专门针对ElasticSearch作为时间序列数据库,用于具有使用 jsl Python库定义的模式的JSON数据的用例。

主要API是 jsl_elasticsearch.render_es_template

def render_es_template(document, title, role, doc_type="content"):
    """Render an ElasticSearch time series template for given JSL document

    Template name is generated from the given *title* and *role*
    Document variables are resolved using the given *role*
    *doc_type* specifies the ElasticSearch mapping name (default: "content")
    """

Kibana期望的 @timestamp 字段将自动添加,并且默认情况下字符串字段被标记为 not_analyzed(因此ElasticSearch将它们视为不透明的令牌,而不是作为要进行分析的纯文本字段)

目前支持以下JSL字段类型

  • jsl.StringField

  • jsl.NumberField

  • jsl.IntField

  • jsl.ArrayField

  • jsl.DictField

  • jsl.DocumentField

还定义了一个额外的字段类型

  • jsl_elasticsearch.TextField

由于默认情况下字符串字段被标记为不透明的令牌,TextField 是一个新的 StringField 子类,它将字段标记为ElasticSearch映射中的全文搜索,但JSL中处理方式与 StringField 完全一样。

项目详情


下载文件

下载适用于您平台的文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。

源代码发行版

jsl-elasticsearch-0.1.dev0.tar.gz (5.8 kB 查看哈希值)

上传时间 源代码

构建发行版

jsl_elasticsearch-0.1.dev0-py3-none-any.whl (6.2 kB 查看哈希值)

上传时间 Python 3

由以下机构支持