我有一个客户在 JSON 文件中向我提供了如下所示的 Elastic 查询输出:
{
"took": 74,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 169905,
"max_score": 1,
"hits": [
{
"_index": "myindex",
"_type": "data",
"_id": "46c40732-71b6-4d30-96de-d38d6fc88b6786c7b6e758a4e927a8beb906a52cfc47d00f58bb472fc031fadac042591d7400",
"_score": 1,
"_source": {
"reqSize": 0,
...
"respCode": 0
}
},
{
"_index": "myindex",
"_type": "data",
"_id": "46c40732-71b6-4d30-96de-d38d6fc88b67f3edcdcee2f1710aac0325ecfc190addcfdb842f3efa3ce391306c9ca2eaf628",
"_score": 1,
"_source": {
"reqSize": 0,
...
"respCode": 0
}
}, ...
可以看到,有将近 170.000 条记录。我想在我的测试 Elastic 中摄取这些数据。我需要摄取的数据是 _source 中的数据。我怎样才能最好地从文件中提取它?如果输入在 JSON 文件中,logstash 是否是执行此操作的正确工具?
感谢您的建议。C