Kibana rest api

官方網站

https://www.elastic.co/guide/en/kibana/current/api.html

APIs 

Saved objects APIs

Create index-pattern

請求

POST api/saved_objects/index-pattern/my-pattern
{
  "attributes": {
    "title": "my-pattern-*",
    "timeFieldName":"log_time"
  }
}

響應

{
  "id": "my-pattern", 
  "type": "index-pattern",
  "version": 1,
  "attributes": {
    "title": "my-pattern-*"
  }
}

Bulk create saved objects

請求

POST api/saved_objects/_bulk_create
[
  {
    "type": "index-pattern",
    "id": "my-pattern",
    "attributes": {
      "title": "my-pattern-*"
    }
  },
  {
    "type": "dashboard",
    "id": "my-dashboard",
    "attributes": {
      "title": "Look at my dashboard"
    }
  }
]

響應

{
  "saved_objects": [
    {
      "id": "my-pattern",
      "type": "index-pattern",
      "version": 1,
      "attributes": {
        "title": "my-pattern-*"
      }
    },
    {
      "id": "my-dashboard",
      "type": "dashboard",
      "error": {
        "statusCode": 409,
        "message": "version conflict, document already exists"
      }
    }
  ]
}

Bulk get objects

請求

POST api/saved_objects/_bulk_get
[
  {
    "type": "index-pattern",
    "id": "my-pattern"
  },
  {
    "type": "dashboard",
    "id": "my-dashboard"
  }
]

響應

{
  "saved_objects": [
    {
      "id": "my-pattern",
      "type": "index-pattern",
      "version": 1,
      "attributes": {
        "title": "my-pattern-*"
      }
    },
    {
      "id": "my-dashboard",
      "type": "dashboard",
      "error": {
        "statusCode": 404,
        "message": "Not found"
      }
    }
  ]
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章