- Kibana Guide: other versions:
- What is Kibana?
- What’s new in 7.17
- Kibana concepts
- Quick start
- Set up
- Install Kibana
- Configure Kibana
- Alerting and action settings
- APM settings
- Banners settings
- Development tools settings
- Graph settings
- Fleet settings
- i18n settings
- Logging settings
- Logs settings
- Metrics settings
- Machine learning settings
- Monitoring settings
- Reporting settings
- Secure settings
- Search sessions settings
- Security settings
- Spaces settings
- Task Manager settings
- Telemetry settings
- URL drilldown settings
- Start and stop Kibana
- Access Kibana
- Securing access to Kibana
- Add data
- Upgrade Kibana
- Logging configuration migration
- Configure security
- Configure reporting
- Configure monitoring
- Production considerations
- Discover
- Dashboard and visualizations
- Canvas
- Maps
- Build a map to compare metrics by country or region
- Track, visualize, and alert on assets in real time
- Map custom regions with reverse geocoding
- Heat map layer
- Tile layer
- Vector layer
- Plot big data
- Search geographic data
- Configure map settings
- Connect to Elastic Maps Service
- Import geospatial data
- Troubleshoot
- Reporting and sharing
- Machine learning
- Graph
- Alerting
- Observability
- APM
- Security
- Dev Tools
- Fleet
- Osquery
- Stack Monitoring
- Stack Management
- REST API
- Get features API
- Kibana spaces APIs
- Kibana role management APIs
- User session management APIs
- Saved objects APIs
- Index patterns APIs
- Alerting APIs
- Action and connector APIs
- Cases APIs
- Import and export dashboard APIs
- Logstash configuration management APIs
- Machine learning APIs
- Short URLs APIs
- Get Task Manager health
- Upgrade assistant APIs
- Kibana plugins
- Accessibility
- Release notes
- Kibana 7.17.27
- Kibana 7.17.26
- Kibana 7.17.25
- Kibana 7.17.24
- Kibana 7.17.23
- Kibana 7.17.22
- Kibana 7.17.21
- Kibana 7.17.20
- Kibana 7.17.19
- Kibana 7.17.18
- Kibana 7.17.17
- Kibana 7.17.16
- Kibana 7.17.15
- Kibana 7.17.14
- Kibana 7.17.13
- Kibana 7.17.12
- Kibana 7.17.11
- Kibana 7.17.10
- Kibana 7.17.9
- Kibana 7.17.8
- Kibana 7.17.7
- Kibana 7.17.6
- Kibana 7.17.5
- Kibana 7.17.4
- Kibana 7.17.3
- Kibana 7.17.2
- Kibana 7.17.1
- Kibana 7.17.0
- Developer guide
HTTP service
editHTTP service
editThe HTTP service is available both server and client side.
Server side usage
editThe server-side HttpService allows server-side plugins to register endpoints with built-in support for request validation. These endpoints may be used by client-side code or be exposed as a public API for users. Most plugins integrate directly with this service.
The service allows plugins to: * to extend the Kibana server with custom HTTP API. * to execute custom logic on an incoming request or server response. * implement custom authentication and authorization strategy.
import { schema } from '@kbn/config-schema'; import type { CoreSetup, Plugin } from 'kibana/server'; export class MyPlugin implements Plugin { public setup(core: CoreSetup) { const router = core.http.createRouter(); const validate = { params: schema.object({ id: schema.string(), }), }; router.get({ path: 'my_plugin/{id}', validate }, async (context, request, response) => { const data = await findObject(request.params.id); if (!data) return response.notFound(); return response.ok({ body: data, headers: { 'content-type': 'application/json' } }); }); } }
Client side usage
editThe HTTP service is also offered on the client side and provides an API to communicate with the Kibana server via HTTP interface.
The client-side HttpService is a preconfigured wrapper around window.fetch
that includes some default behavior and automatically handles common errors (such as session expiration). The service should only be used for access to backend endpoints registered by the same plugin. Feel free to use another HTTP client library to request 3rd party services.
import { CoreStart } from 'kibana/public'; interface ResponseType {…}; interface MyPluginData {…}; async function fetchData<ResponseType>(core: CoreStart) { return await core.http.get<MyPluginData>( '/api/my_plugin/', { query: … }, ); }
On this page