【问题标题】:Reindex data in new cluster should update with latest time stamp新集群中的重新索引数据应使用最新的时间戳更新
【发布时间】:2020-08-20 10:08:41
【问题描述】:

最近我将数据从一个弹性集群重新索引到另一个最新版本的集群。但是以前集群中的数据是旧数据,现在我需要新集群中具有最新时间戳的数据。

【问题讨论】:

    标签: elasticsearch kibana


    【解决方案1】:

    您可以在 reindex api 中使用脚本

    类似的东西应该可以工作

    POST _reindex
     {
       "source": {
         "index": "test"
       }, 
       "dest": {
         "index": "test2"
       }, 
       "script": {
              "lang": "painless",
              "source": """
              ctx._source['@timestamp'] = new Date().getTime();
                """
       }
     }
     
    

    【讨论】:

    • 阿比,我看到了你的评论。如果您看不到@timestamp,请确保您正在查看重新索引的索引。还要确保重新索引查询的执行没有任何错误
    • @abhi,你设法重新索引了吗?如果是这样,请不要忘记验证它
    猜你喜欢
    • 2012-08-31
    • 2011-06-09
    • 1970-01-01
    • 2014-06-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-11-30
    • 2017-12-20
    相关资源
    最近更新 更多