kibana
15 commands
15 shown
Export dashboard
Export a Kibana dashboard with all dependencies
curl -s 'http://kibana:5601/api/saved_objects/_export' -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '{"type":"dashboard","includeReferencesDeep":true}' -o dashboard.ndjson
Import dashboard
Import a previously exported dashboard
curl -X POST 'http://kibana:5601/api/saved_objects/_import' -H 'kbn-xsrf: true' --form file=@dashboard.ndjson
KQL: filter by field value
Kibana Query Language — filter logs by field values
status: 404 AND method: GET
KQL: range query
Filter events in the last hour with slow responses
response_time > 500 AND @timestamp > now-1h
KQL: wildcard search
Wildcard match in a field value
message: *OOMKilled*
KQL: nested field filter
Filter by nested Kubernetes metadata fields
kubernetes.pod.name: web-* AND kubernetes.namespace: prod
Create index pattern via API
Register a new index pattern via Kibana REST API
curl -X POST http://kibana:5601/api/saved_objects/index-pattern -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '{"attributes":{"title":"logs-*","timeFieldName":"@timestamp"}}'
Export saved objects
Export dashboards and visualizations to NDJSON
curl -X POST http://kibana:5601/api/saved_objects/_export -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '{"type":["dashboard","visualization"],"includeReferencesDeep":true}' -o export.ndjson
Import saved objects
Import dashboards/visualizations from NDJSON
curl -X POST http://kibana:5601/api/saved_objects/_import?overwrite=true -H 'kbn-xsrf: true' -F file=@export.ndjson
Check Kibana health
Overall health status and Kibana version
curl -s http://kibana:5601/api/status | jq '{status: .status.overall.level, version: .version.number}'
List all index patterns
Show all registered index patterns
curl -s http://kibana:5601/api/saved_objects/_find?type=index-pattern | jq '.saved_objects[].attributes.title'
Dev Tools console query
Run Elasticsearch queries directly in Kibana Dev Tools
GET logs-*/_search
{
"query": {"match": {"level": "error"}},
"size": 10
}
Flush Kibana cache
Reset Kibana config object (triggers re-init on reload)
curl -X DELETE http://kibana:5601/api/saved_objects/config/7.17.0 -H 'kbn-xsrf: true'
Get space info
List all Kibana Spaces by ID
curl -s http://kibana:5601/api/spaces/space | jq '.[].id'
Copy objects between spaces
Copy a dashboard to another Kibana Space
curl -X POST http://kibana:5601/api/spaces/_copy_saved_objects -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '{"spaces":["staging"],"objects":[{"type":"dashboard","id":"my-dash"}],"overwrite":true}'
no commands match