todolist
1. @timestamp 참조하여 localDate field 생성 (UTC, +09:00)
2. create date index name pipeline
3. reindex using a pipeline
References
https://www.elastic.co/guide/en/elasticsearch/reference/7.6/date-index-name-processor.html
https://www.elastic.co/guide/en/elasticsearch/reference/7.6/date-processor.html#date-processor
https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-reindex.html
PUT _ingest/pipeline/pipeline_test
{
"description" : "...",
"processors" : [
{
"date" : {
"field" : "@timestamp", // refer field
"target_field" : "localDate", // new field
"formats" : ["yyyy-MM-dd"],
"timezone" : "UTC"
}
}
]
}
PUT _ingest/pipeline/pipeline_test-daily
{
"description": "for create localDate field and reindex daily",
"processors" : [
{
"date_index_name" : {
"field": "@timestamp",
"timezone": "+09:00",
"index_name_prefix" : "test-",
"index_name_format" : "yyyy-MM-dd",
"date_rounding" : "d"
}
}
]
}
POST _reindex
{
"source": {
"index": "reindex 대상"
},
"dest": {
"index": "new index",
"pipeline": "test-pipeline"
}
}