Install
openclaw skills install kibana-data-viewsManage Kibana Data Views (formerly index patterns) via REST API. Use when: (1) Creating, listing, updating, or deleting data views, (2) Checking data view existence before dashboard creation, (3) Troubleshooting missing index patterns, (4) Programmatically managing Kibana index patterns. API endpoints: POST /api/data_views, GET /api/data_views, GET /api/data_views/{viewId}, PUT /api/data_views/{viewId}, DELETE /api/data_views/{viewId}.
openclaw skills install kibana-data-viewsManage Kibana Data Views (formerly "index patterns") via the Kibana REST API.
http://<kibana-host>/api/data_views
For Omni-Monitor: http://192.168.99.43/api/data_views
Kibana API requires kbn-xsrf: true header. For authenticated requests, use Kibana's session cookie or Basic auth.
GET /api/data_views
Response:
{
"data_views": [
{
"id": "...",
"title": "zbx-metrics-*",
"name": "Zabbix Metrics",
"timeFieldName": "@timestamp"
}
]
}
GET /api/data_views/{viewId}
Path Parameters:
viewId (string, required): Data view identifierResponse 200:
{
"data_view": {
"id": "...",
"title": "zbx-metrics-*",
"name": "Zabbix Metrics",
"timeFieldName": "@timestamp",
"fields": {...}
}
}
POST /api/data_views/data_view
Headers:
kbn-xsrf: true (required)Content-Type: application/jsonRequest Body:
{
"data_view": {
"title": "zbx-metrics-*",
"name": "Zabbix Metrics",
"timeFieldName": "@timestamp",
"allowNoIndex": true
}
}
Response 200: Returns created data_view object
Response 400: Bad request (e.g., duplicate title)
PUT /api/data_views/{viewId}
Path Parameters:
viewId (string, required): Data view identifierRequest Body:
{
"data_view": {
"title": "zbx-metrics-*",
"name": "Zabbix Metrics Updated",
"timeFieldName": "@timestamp"
}
}
DELETE /api/data_views/{viewId}
Headers:
kbn-xsrf: true (required)Response 204: Successfully deleted
Response 404: Data view not found
GET /api/data_views
Then search results for matching title.
POST /api/data_views/validate
Check if indices exist without creating a data view.
| Title | Description |
|---|---|
zbx-metrics-* | Zabbix CPU/Memory/Disk metrics |
zbx-hosts-* | Zabbix hosts |
zbx-problems-* | Zabbix problems |
zbx-triggers-* | Zabbix triggers |
k8s-pod-logs-* | K8s pod logs |
k8s-audit-logs-* | K8s audit logs |
vm-system-logs-* | VM system logs |
ingress-nginx-logs-* | Ingress nginx logs |
*-logs-* | All logs |
When accessing Kibana API from external tool, you may need to proxy through Kibana:
http://192.168.99.43/api/console/proxy?path=<encoded-path>&method=<GET|POST|PUT|DELETE>
Example - List data views via proxy:
GET http://192.168.99.43/api/console/proxy?path=%2Fapi%2Fdata_views&method=GET
If Lens fails with error Cannot read properties of undefined (reading 'indexpattern'):
curl -s "http://192.168.99.43/api/data_views" \
-H "kbn-xsrf: true"
Check data view ID matches what dashboard references:
indexpattern-datasource-layer-<uuid> referencesRecreate missing data view:
curl -X POST "http://192.168.99.43/api/data_views/data_view" \
-H "kbn-xsrf: true" \
-H "Content-Type: application/json" \
-d '{
"data_view": {
"title": "zbx-metrics-*",
"name": "Zabbix Metrics",
"timeFieldName": "@timestamp",
"allowNoIndex": true
}
}'
# Query from within k8s cluster
kubectl exec -n elastic elasticsearch-0 -- curl -s -u 'elastic:Changeme123' \
'http://localhost:9200/.kibana/_search?size=100' \
-H 'Content-Type: application/json' \
-d '{"query": {"prefix": {"type": "index-pattern"}}}'
| Script | Purpose |
|---|---|
list_data_views.py | List all data views from Kibana |
create_data_view.py | Create a new data view |
delete_data_view.py | Delete a data view |
check_and_fix_data_views.py | Diagnose and fix missing data views |