这里写自定义目录标题
在请求kibana中的接口获取数据
因为/kibanashow/elasticsearch/_msearch接口是post,payload请求
错误信息
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "The msearch request must be terminated by a newline [\n]"
}
],
"type": "illegal_argument_exception",
"reason": "The msearch request must be terminated by a newline [\n]"
},
"status": 400
}
需要header
self.headers = {
'Authorization':'x x x,
'Content-Type':'application/json',
'Cookie':xxx',
'User-Agent':'xxx,
'kbn-version':'6.4.1',
'Host':'XXX',
'Accept': 'text/plain'}
## 解决方案
请求参数变成为list格式
data = [{
"index":"logstash-haproxy*","ignore_unavailable":true