如何导出所有 8304 匹配项?
How can I export all 8304 hits?
我们使用 logz.io/#/dashboard/kibana
来监控我们的日志。我的过滤器产生了 8304 次匹配。我想将它们导出为 CSV 文件以供进一步分析。当我点击 export
(在新建、保存、打开、共享和自动刷新旁边)时,我只会获得前 500 次点击。
更新。根据对 similar question, the increasing the value of discover:sampleSize
选项的回复,这里会有帮助:下载的 CSV 应包含更多行。
但是,Elastic 团队的成员在他的回复中建议,应该首选通过直接查询 Elasticsearch 来提取所需的数据。
尝试直接从 Elasticsearch 导出。
考虑 this answer to "Is there any way in Elasticsearch to get results as CSV file in curl api?" 问题中的示例。
或者,使用名为 elasticsearch-dump
的工具。获取带有日志的 csv
分为两个步骤:
首先,将所需 index/query 的内容转储到 json
文件中:
elasticdump \
--input=http://production.es.com:9200/my_index \
--output=query.json \
--searchBody='{"query":{"term":{"username": "admin"}}}'
将 json
文件转换为 csv
文件(更多信息请参见“Export JSON to CSV with Headers using JQ") using jq
命令行实用程序。
或者,查看 this script 以 csv
格式转储 ES 索引。
我们使用 logz.io/#/dashboard/kibana
来监控我们的日志。我的过滤器产生了 8304 次匹配。我想将它们导出为 CSV 文件以供进一步分析。当我点击 export
(在新建、保存、打开、共享和自动刷新旁边)时,我只会获得前 500 次点击。
更新。根据对 similar question, the increasing the value of discover:sampleSize
选项的回复,这里会有帮助:下载的 CSV 应包含更多行。
但是,Elastic 团队的成员在他的回复中建议,应该首选通过直接查询 Elasticsearch 来提取所需的数据。
尝试直接从 Elasticsearch 导出。
考虑 this answer to "Is there any way in Elasticsearch to get results as CSV file in curl api?" 问题中的示例。
或者,使用名为 elasticsearch-dump
的工具。获取带有日志的 csv
分为两个步骤:
首先,将所需 index/query 的内容转储到
json
文件中:elasticdump \ --input=http://production.es.com:9200/my_index \ --output=query.json \ --searchBody='{"query":{"term":{"username": "admin"}}}'
将
json
文件转换为csv
文件(更多信息请参见“Export JSON to CSV with Headers using JQ") usingjq
命令行实用程序。
或者,查看 this script 以 csv
格式转储 ES 索引。