ES 数据写入时自动增加时间戳
创建Pipeline
1 2 3 4 5 6 7 8 9 10 11 12 |
PUT /_ingest/pipeline/x { "description": "Creates a timestamp when a document is initially indexed", "processors": [ { "set": { "field": "timestamp", "value": "{{_ingest.timestamp}}" } } ] } |
测试Pipeline
1 2 |
PUT /test/_doc/1?pipeline=x { "foo": "bar" } |
设置索引默认Pipeline
1 2 3 4 5 6 |
PUT /test/_settings { "settings": { "default_pipeline": "x" } } |