当前位置:   article > 正文

es之pipeline给索引加时间戳_es pipeline

es pipeline

步骤:
1.创建pipeline
PUT _ingest/pipeline/my_timestamp_pipeline
{
  "description": "Adds a field to a document with the time of ingestion",
  "processors": [
    {
      "set": {
        "field": "ingest_timestamp",
        "value": "{{_ingest.timestamp}}"
      }
    }
  ]
}


情况1,新建表加pipeline
PUT test111
{
    "settings": {
      "index":{
        "number_of_shards" :   3,
        "number_of_replicas" : 1,
        "blocks.read_only_allow_delete": "false",
        "default_pipeline": "my_timestamp_pipeline"
      }
    },
  "mappings": {
    "properties": {
      "addbigint1": {
        "type": "long"
      }}}

情况2.给已存在索引加时间戳
PUT /testme/_settings
{
"default_pipeline": "my_timestamp_pipeline" 
}

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/887747
推荐阅读
相关标签
  

闽ICP备14008679号