LoginSignup
0
0

More than 3 years have passed since last update.

Reindex APIを使用した、インデックス名をLogstash形式での変換方法

Posted at

はじめに

Reindex APIによってLogstash形式での出力が必要になりました
その時考えたリクエストを記述します

リクエスト

参考リクエストを記述します

POST _reindex
{
  "source": {
    "index": "aaaaaa"
  },
  "dest": {
    "index": "meaningless"
  },
  "script": {
    "source":"""
      def dt = new Date();
      def sdf = new SimpleDateFormat("yyyy'.'MM'.'dd");
      ctx._index = "aaaaaa-" + sdf.format(dt);
    """
  }
}

結果

image.png

参考資料

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0