我可以做这个:
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
禁止非日志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
根据
--quiet
的doc,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
关于elasticsearch - 批量插入时如何为Elastic Search设置Quiet选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56448263/