简介
Kibana
原始描述
Kibana API integration with managed authentication. This is a write-capable integration — it can read, create, update, and delete saved objects, dashboards,...
通过你的 Agent 添加
安装目录:kibana/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
技能正文
name: kibana
description: |
Kibana API integration with managed authentication. Manage saved objects, dashboards, data views, spaces, alerts, and fleet.
Use this skill when users want to interact with Kibana for observability, security, and search analytics.
For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway).
compatibility: Requires network access and valid Maton API key
metadata:
author: maton
version: "1.0"
clawdbot:
emoji:
homepage: "https://maton.ai"
requires:
env:
- MATON_API_KEY
Kibana
Access Kibana saved objects, dashboards, data views, spaces, alerts, and fleet via managed API authentication.
Quick Start
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/kibana/api/saved_objects/_find?type=dashboard')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('kbn-xsrf', 'true')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Base URL
https://gateway.maton.ai/kibana/{native-api-path}
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/kibana/api/saved_objects/_find?type=dashboard')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('kbn-xsrf', 'true')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
https://gateway.maton.ai/kibana/{native-api-path}
The gateway proxies requests to your Kibana instance and automatically injects authentication.
Authentication
All requests require the Maton API key and the kbn-xsrf header:
Authorization: Bearer $MATON_API_KEY
kbn-xsrf: true
Environment Variable: Set your API key as MATON_API_KEY:
export MATON_API_KEY="YOUR_API_KEY"
Getting Your API Key
- Sign in or create an account at maton.ai
- Go to maton.ai/settings
- Copy your API key
Connection Management
Manage your Kibana connections at https://ctrl.maton.ai.
List Connections
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections?app=kibana&status=ACTIVE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Create Connection
python <<'EOF'
import urllib.request, os, json
data = json.dumps({'app': 'kibana'}).encode()
req = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections?app=kibana&status=ACTIVE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
python <<'EOF'
import urllib.request, os, json
data = json.dumps({'app': 'kibana'}).encode()
req = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Open the returned url in a browser to complete authentication. You'll need to provide your Kibana API key.
Delete Connection
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
API Reference
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Important: All Kibana API requests require the kbn-xsrf: true header.
Status & Features
Get Status
GET /kibana/api/status
Response:
{
"name": "kibana",
"uuid": "abc123",
"version": {
"number": "8.15.0",
"build_hash": "..."
},
"status": {
"overall": {"level": "available"}
}
}
List Features
GET /kibana/api/features
GET /kibana/api/features
Returns list of all Kibana features and their capabilities.
Saved Objects
Find Saved Objects
GET /kibana/api/saved_objects/_find?type={type}
Query Parameters:
type- Object type:dashboard,visualization,index-pattern,search,lens,mapsearch- Search querypage- Page numberper_page- Results per page (default 20, max 10000)fields- Fields to return
Response:
{
"page": 1,
"per_page": 20,
"total": 5,
"saved_objects": [
{
"id": "abc123",
"type": "dashboard",
"attributes": {
"title": "My Dashboard",
"description": "Dashboard description"
},
"version": "1",
"updated_at": "2024-01-01T00:00:00.000Z"
}
]
}
Get Saved Object
GET /kibana/api/saved_objects/{type}/{id}
Create Saved Object
POST /kibana/api/saved_objects/{type}/{id}
Content-Type: application/json
{
"attributes": {
"title": "My Index Pattern",
"timeFieldName": "@timestamp"
}
}
Update Saved Object
PUT /kibana/api/saved_objects/{type}/{id}
Content-Type: application/json
{
"attributes": {
"title": "Updated Title"
}
}
Delete Saved Object
DELETE /kibana/api/saved_objects/{type}/{id}
Bulk Operations
POST /kibana/api/saved_objects/_bulk_get
Content-Type: application/json
[
{"type": "dashboard", "id": "abc123"},
{"type": "visualization", "id": "def456"}
]
Data Views
List Data Views
GET /kibana/api/data_views
GET /kibana/api/saved_objects/{type}/{id}
POST /kibana/api/saved_objects/{type}/{id}
Content-Type: application/json
{
"attributes": {
"title": "My Index Pattern",
"timeFieldName": "@timestamp"
}
}
Update Saved Object
PUT /kibana/api/saved_objects/{type}/{id}
Content-Type: application/json
{
"attributes": {
"title": "Updated Title"
}
}
Delete Saved Object
DELETE /kibana/api/saved_objects/{type}/{id}
Bulk Operations
POST /kibana/api/saved_objects/_bulk_get
Content-Type: application/json
[
{"type": "dashboard", "id": "abc123"},
{"type": "visualization", "id": "def456"}
]
Data Views
List Data Views
GET /kibana/api/data_views
PUT /kibana/api/saved_objects/{type}/{id}
Content-Type: application/json
{
"attributes": {
"title": "Updated Title"
}
}
DELETE /kibana/api/saved_objects/{type}/{id}
Bulk Operations
POST /kibana/api/saved_objects/_bulk_get
Content-Type: application/json
[
{"type": "dashboard", "id": "abc123"},
{"type": "visualization", "id": "def456"}
]
Data Views
List Data Views
GET /kibana/api/data_views
POST /kibana/api/saved_objects/_bulk_get
Content-Type: application/json
[
{"type": "dashboard", "id": "abc123"},
{"type": "visualization", "id": "def456"}
]
List Data Views
GET /kibana/api/data_views
Response:
{
"data_view": [
{
"id": "abc123",
"title": "logs-*",
"timeFieldName": "@timestamp"
}
]
}
Get Data View
GET /kibana/api/data_views/data_view/{id}
Create Data View
POST /kibana/api/data_views/data_view
Content-Type: application/json
{
"data_view": {
"title": "logs-*",
"timeFieldName": "@timestamp"
}
}
GET /kibana/api/data_views/data_view/{id}
POST /kibana/api/data_views/data_view
Content-Type: application/json
{
"data_view": {
"title": "logs-*",
"timeFieldName": "@timestamp"
}
}
Response:
{
"data_view": {
"id": "abc123",
"title": "logs-*",
"timeFieldName": "@timestamp"
}
}
Update Data View
POST /kibana/api/data_views/data_view/{id}
Content-Type: application/json
{
"data_view": {
"title": "updated-logs-*"
}
}
Delete Data View
DELETE /kibana/api/data_views/data_view/{id}
Spaces
List Spaces
GET /kibana/api/spaces/space
POST /kibana/api/data_views/data_view/{id}
Content-Type: application/json
{
"data_view": {
"title": "updated-logs-*"
}
}
DELETE /kibana/api/data_views/data_view/{id}
Spaces
List Spaces
GET /kibana/api/spaces/space
Response:
[
{
"id": "default",
"name": "Default",
"description": "Default space",
"disabledFeatures": []
}
]
Get Space
GET /kibana/api/spaces/space/{id}
Create Space
POST /kibana/api/spaces/space
Content-Type: application/json
{
"id": "marketing",
"name": "Marketing",
"description": "Marketing team space",
"disabledFeatures": []
}
Update Space
PUT /kibana/api/spaces/space/{id}
Content-Type: application/json
{
"id": "marketing",
"name": "Marketing Team",
"description": "Updated description"
}
Delete Space
DELETE /kibana/api/spaces/space/{id}
Alerting
Find Alert Rules
GET /kibana/api/alerting/rules/_find
GET /kibana/api/spaces/space/{id}
POST /kibana/api/spaces/space
Content-Type: application/json
{
"id": "marketing",
"name": "Marketing",
"description": "Marketing team space",
"disabledFeatures": []
}
Update Space
PUT /kibana/api/spaces/space/{id}
Content-Type: application/json
{
"id": "marketing",
"name": "Marketing Team",
"description": "Updated description"
}
Delete Space
DELETE /kibana/api/spaces/space/{id}
Alerting
Find Alert Rules
GET /kibana/api/alerting/rules/_find
PUT /kibana/api/spaces/space/{id}
Content-Type: application/json
{
"id": "marketing",
"name": "Marketing Team",
"description": "Updated description"
}
DELETE /kibana/api/spaces/space/{id}
Alerting
Find Alert Rules
GET /kibana/api/alerting/rules/_find
Query Parameters:
search- Search querypage- Page numberper_page- Results per page
Response:
{
"page": 1,
"per_page": 10,
"total": 5,
"data": [
{
"id": "abc123",
"name": "CPU Alert",
"consumer": "alerts",
"enabled": true,
"rule_type_id": "metrics.alert.threshold"
}
]
}
Get Alert Rule
GET /kibana/api/alerting/rule/{id}
Enable/Disable Rule
POST /kibana/api/alerting/rule/{id}/_enable
POST /kibana/api/alerting/rule/{id}/_disable
Mute/Unmute Rule
POST /kibana/api/alerting/rule/{id}/_mute_all
POST /kibana/api/alerting/rule/{id}/_unmute_all
Get Alerting Health
GET /kibana/api/alerting/_health
Connectors (Actions)
List Connectors
GET /kibana/api/actions/connectors
GET /kibana/api/alerting/rule/{id}
POST /kibana/api/alerting/rule/{id}/_enable
POST /kibana/api/alerting/rule/{id}/_disable
Mute/Unmute Rule
POST /kibana/api/alerting/rule/{id}/_mute_all
POST /kibana/api/alerting/rule/{id}/_unmute_all
Get Alerting Health
GET /kibana/api/alerting/_health
Connectors (Actions)
List Connectors
GET /kibana/api/actions/connectors
POST /kibana/api/alerting/rule/{id}/_mute_all
POST /kibana/api/alerting/rule/{id}/_unmute_all
GET /kibana/api/alerting/_health
Connectors (Actions)
List Connectors
GET /kibana/api/actions/connectors
Response:
[
{
"id": "abc123",
"name": "Email Connector",
"connector_type_id": ".email",
"is_preconfigured": false,
"is_deprecated": false
}
]
Get Connector
GET /kibana/api/actions/connector/{id}
List Connector Types
GET /kibana/api/actions/connector_types
Execute Connector
POST /kibana/api/actions/connector/{id}/_execute
Content-Type: application/json
{
"params": {
"to": ["user@example.com"],
"subject": "Alert",
"message": "Alert triggered"
}
}
Fleet
List Agent Policies
GET /kibana/api/fleet/agent_policies
GET /kibana/api/actions/connector/{id}
GET /kibana/api/actions/connector_types
Execute Connector
POST /kibana/api/actions/connector/{id}/_execute
Content-Type: application/json
{
"params": {
"to": ["user@example.com"],
"subject": "Alert",
"message": "Alert triggered"
}
}
Fleet
List Agent Policies
GET /kibana/api/fleet/agent_policies
POST /kibana/api/actions/connector/{id}/_execute
Content-Type: application/json
{
"params": {
"to": ["user@example.com"],
"subject": "Alert",
"message": "Alert triggered"
}
}
List Agent Policies
GET /kibana/api/fleet/agent_policies
Response:
{
"items": [
{
"id": "abc123",
"name": "Default policy",
"namespace": "default",
"status": "active"
}
],
"total": 1,
"page": 1,
"perPage": 20
}
List Agents
GET /kibana/api/fleet/agents
List Packages
GET /kibana/api/fleet/epm/packages
GET /kibana/api/fleet/agents
GET /kibana/api/fleet/epm/packages
Returns all available integrations/packages.
Security
List Roles
GET /kibana/api/security/role
Response:
[
{
"name": "admin",
"metadata": {},
"elasticsearch": {
"cluster": ["all"],
"indices": [...]
},
"kibana": [...]
}
]
Get Role
GET /kibana/api/security/role/{name}
Cases
Find Cases
GET /kibana/api/cases/_find
GET /kibana/api/security/role/{name}
Find Cases
GET /kibana/api/cases/_find
Query Parameters:
status-open,in-progress,closedseverity-low,medium,high,criticalpage- Page numberperPage- Results per page
Response:
{
"cases": [],
"page": 1,
"per_page": 20,
"total": 0
}
Code Examples
JavaScript
const response = await fetch('https://gateway.maton.ai/kibana/api/saved_objects/_find?type=dashboard', {
headers: {
'Authorization': `Bearer ${process.env.MATON_API_KEY}`,
'kbn-xsrf': 'true'
}
});
const dashboards = await response.json();
console.log(dashboards);
Python
import os
import requests
response = requests.get(
'https://gateway.maton.ai/kibana/api/saved_objects/_find?type=dashboard',
headers={
'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}',
'kbn-xsrf': 'true'
}
)
print(response.json())
Notes
- All requests require
kbn-xsrf: true header
- Saved object types:
dashboard, visualization, index-pattern, search, lens, map
- Data views are the modern replacement for index patterns
- Spaces provide multi-tenancy support
- Fleet manages Elastic Agents and integrations
- Some operations require specific Kibana privileges
Error Handling
Status
Meaning
200
Success
204
No content (successful delete)
400
Invalid request
401
Invalid or missing authentication
403
Permission denied
404
Resource not found
409
Conflict (e.g., object already exists)
Resources
import os
import requests
response = requests.get(
'https://gateway.maton.ai/kibana/api/saved_objects/_find?type=dashboard',
headers={
'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}',
'kbn-xsrf': 'true'
}
)
print(response.json())
- All requests require
kbn-xsrf: trueheader - Saved object types:
dashboard,visualization,index-pattern,search,lens,map - Data views are the modern replacement for index patterns
- Spaces provide multi-tenancy support
- Fleet manages Elastic Agents and integrations
- Some operations require specific Kibana privileges
Error Handling
Status
Meaning
200
Success
204
No content (successful delete)
400
Invalid request
401
Invalid or missing authentication
403
Permission denied
404
Resource not found
409
Conflict (e.g., object already exists)
Resources
| Status | Meaning |
|---|---|
| 200 | Success |
| 204 | No content (successful delete) |
| 400 | Invalid request |
| 401 | Invalid or missing authentication |
| 403 | Permission denied |
| 404 | Resource not found |
| 409 | Conflict (e.g., object already exists) |
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。