Elasticsearch 基于查询数据导出,导入到索引

elasticsearch 导出

elasticdump
  --input="http://username:password@domain-es.jdl.com/domain_slowlog_es_*"
  --output="D:\Software\es_slow_log_total.json"
  --type=data
  --limit=1000
  --headers="{\"Content-Type\": \"application/json\"}"
  --sourceOnly=true
  --searchBody="{\"_source\":[\"resourceId\",\"pin\",\"time\",\"log_content\",\"slowLogType\",\"log_detail.level\",\"log_detail.total_shards\",\"log_detail.type\",\"log_detail.types\",\"log_detail.took_millis\",\"log_detail.total_hits\",\"log_detail.node_name\",\"log_detail.index\",\"log_detail.shard\"],\"query\":{\"bool\":{\"must\":{\"terms\":{\"resourceId\":[\"es-9i4977q5qh\",\"es-ch8s1wvrr5\",\"es-g41sh1v7oz\",\"es-gvkom2be36\",\"es-h2vbk839a2\",\"es-hhswy81fxa\",\"es-hhwdg51is0\",\"es-jx6fmk9a5a\",\"es-kt0dvdk5pz\",\"es-p4vfznv62m\",\"es-pzlzbtbfuq\",\"es-q2a7mgkh8w\",\"es-s53dzoummo\",\"es-tvwrhz61bc\",\"es-va0edcrg96\",\"es-wr6vg9mpbv\"]}},\"filter\":{\"range\":{\"time\":{\"gte\":\"1704038400000\",\"lte\":\"1705636800000\"}}}}}}"
posted @ 2024-07-15 18:05  SpecialSpeculator  阅读(31)  评论(0编辑  收藏  举报