不为失败找理由,要为成功找方法。

elasticsearch 为所有文档添加时间戳 是否支持次功能啊

Elasticsearch | 作者 muscle_coder | 发布于2021年02月20日 | 阅读数:1677

elasticsearch 为所有文档添加时间戳 是否支持次功能啊
elasticsearch 为所有文档添加时间戳 是否支持次功能啊
elasticsearch 为所有文档添加时间戳 是否支持次功能啊
已邀请:

zmc - ES PAAS、JuiceFS

赞同来自:

应该是不支持的,没有看到类似的文档;
不管是业务层的时间戳还是类似与ELK这种日志系统,都是上游定义好写到ES的;
就像mysql一样,我们定义createTime和updateTime是我们使用的规范,而不是mysql本身给我们的字段中带了一个时间戳;

wkdx - 宅男

赞同来自:

logstash导入的时候不是都有时间戳吗,啊哈哈哈哈🌝🌝

God_lockin

赞同来自:

pipeline里加个字段就好,ingest那一章里有提到

laoyang360 - 《一本书讲透Elasticsearch》作者,Elastic认证工程师 [死磕Elasitcsearch]知识星球地址:http://t.cn/RmwM3N9;微信公众号:铭毅天下; 博客:https://elastic.blog.csdn.net

赞同来自:

可以的 ingest 设置时间戳就可以

https://mp.weixin.qq.com/s/wQYHgj-QlYQIzwXbX4aD8Q

PUT _ingest/pipeline/indexed_at

{

"description": "Adds indexed_at timestamp to documents",

"processors": [

{

"set": {

"field": "_source.indexed_at",

"value": "{{_ingest.timestamp}}"

}

}

]

}



PUT ms-test

{

"settings": {

"index.default_pipeline": "indexed_at"

}

}



POST ms-test/_doc/1



{"title":"just testing"}

要回复问题请先登录注册