自動創建Kibana索引

參考 https://www.cnblogs.com/dance-walter/p/10471950.html

參考 https://www.elastic.co/guide/en/kibana/current/saved-objects-api-create.html

如果需要認證,使用curl保留cookie的方式:

curl -c cookie.txt -XPOST -H 'Content-Type: application/json'  -H 'kbn-xsrf: anything'  "http://localhost:5601/api/security/v1/login" -d"{\"username\": \"elastic\", \"password\": \"elastic\"}"

curl -b @cookie.txt -f -XPOST -H 'Content-Type: application/json' -H 'kbn-xsrf: anything' "http://localhost:5601/api/saved_objects/index-pattern" -d"{\"attributes\":{\"title\":\"cus*\"}}"

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章