批量插入时如何为 Elastic Search 设置 Quiet 选项?

How to set Quiet option for Elastic Search when doing a Bulk Insert?

我能做到:

curl -s -XPOST  1.2.3.4:9200/my_index/my_index_type/_bulk  -H "Content-Type: application/x-ndjson" --data-binary  @/home/modified.json 

但这失败了:

curl -s -XPOST  1.2.3.4:9200/my_index/my_index_type/_bulk  -H "Content-Type: application/x-ndjson" --data-binary  @/home/modified.json --quiet

如何设置'quiet'?

谢谢。

您似乎想要使用 --quiet 禁止 non-log STDOUT 输出。让我们试试这个方法-

curl -s --quiet -XPOST 1.2.3.4:9200/my_index/my_index_type/_bulk -H "Content-Type: application/x-ndjson" --data-binary  @/home/modified.json

根据--quietdoc

This flag must come before any command.

如果它不起作用,那么您可以使用 -o 开关并将输出发送到 dev/null 而不是使用 --quiet

curl -s -o /dev/null -XPOST 1.2.3.4:9200/my_index/my_index_type/_bulk -H "Content-Type: application/x-ndjson" --data-binary  @/home/modified.json