Skip to content

Commit 13876c8

Browse files
Merge branch 'master' into component_templates/feedback
2 parents e11fda6 + a285ede commit 13876c8

File tree

1,617 files changed

+71395
-15100
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,617 files changed

+71395
-15100
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@
144144
/x-pack/plugins/licensing/ @elastic/kibana-platform
145145
/x-pack/plugins/global_search/ @elastic/kibana-platform
146146
/x-pack/plugins/cloud/ @elastic/kibana-platform
147+
/x-pack/test/saved_objects_field_count/ @elastic/kibana-platform
147148
/packages/kbn-config-schema/ @elastic/kibana-platform
148149
/src/legacy/server/config/ @elastic/kibana-platform
149150
/src/legacy/server/http/ @elastic/kibana-platform

Jenkinsfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ kibanaPipeline(timeoutMinutes: 155, checkPrChanges: true, setCommitStatus: true)
4141
'xpack-ciGroup9': kibanaPipeline.xpackCiGroupProcess(9),
4242
'xpack-ciGroup10': kibanaPipeline.xpackCiGroupProcess(10),
4343
'xpack-accessibility': kibanaPipeline.functionalTestProcess('xpack-accessibility', './test/scripts/jenkins_xpack_accessibility.sh'),
44+
'xpack-savedObjectsFieldMetrics': kibanaPipeline.functionalTestProcess('xpack-savedObjectsFieldMetrics', './test/scripts/jenkins_xpack_saved_objects_field_metrics.sh'),
4445
// 'xpack-pageLoadMetrics': kibanaPipeline.functionalTestProcess('xpack-pageLoadMetrics', './test/scripts/jenkins_xpack_page_load_metrics.sh'),
4546
'xpack-securitySolutionCypress': { processNumber ->
4647
whenChanged(['x-pack/plugins/security_solution/', 'x-pack/test/security_solution_cypress/']) {

docs/apm/api.asciidoc

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Some APM app features are provided via a REST API:
1010

1111
* <<agent-config-api>>
1212
* <<apm-annotation-api>>
13+
* <<kibana-api,Kibana API>>
1314

1415
[float]
1516
[[apm-api-example]]
@@ -468,3 +469,87 @@ curl -X POST \
468469
}
469470
}
470471
--------------------------------------------------
472+
473+
////
474+
*******************************************************
475+
////
476+
477+
[[kibana-api]]
478+
=== Kibana API
479+
480+
In addition to the APM specific API endpoints, Kibana provides its own <<api,REST API>>
481+
which you can use to automate certain aspects of configuring and deploying Kibana.
482+
An example is below.
483+
484+
[[api-create-apm-index-pattern]]
485+
==== Customize the APM index pattern
486+
487+
As an alternative to updating <<apm-settings-in-kibana,`apm_oss.indexPattern`>> in your `kibana.yml` configuration file,
488+
you can use Kibana's <<saved-objects-api-update,update object API>> to update the default APM index pattern on the fly.
489+
490+
The following example sets the default APM app index pattern to `some-other-pattern-*`:
491+
492+
[source,sh]
493+
----
494+
curl -X PUT "localhost:5601/api/saved_objects/index-pattern/apm_static_index_pattern_id" \ <1>
495+
-H 'Content-Type: application/json' \
496+
-H 'kbn-xsrf: true' \
497+
-H 'Authorization: Basic ${YOUR_AUTH_TOKEN}' \
498+
-d' {
499+
"attributes": {
500+
"title": "some-other-pattern-*", <2>
501+
}
502+
}'
503+
----
504+
<1> `apm_static_index_pattern_id` is the internal, hard-coded ID of the APM index pattern.
505+
This value should not be changed
506+
<2> Your custom index pattern matcher.
507+
508+
The API returns the following:
509+
510+
[source,json]
511+
----
512+
{
513+
"id":"apm_static_index_pattern_id",
514+
"type":"index-pattern",
515+
"updated_at":"2020-07-06T22:55:59.555Z",
516+
"version":"WzYsMV0=",
517+
"attributes":{
518+
"title":"some-other-pattern-*"
519+
}
520+
}
521+
----
522+
523+
To view the new APM app index pattern, use the <<saved-objects-api-get,GET object API>>:
524+
525+
[source,sh]
526+
----
527+
curl -X GET "localhost:5601/api/saved_objects/index-pattern/apm_static_index_pattern_id" \ <1>
528+
-H 'kbn-xsrf: true' \
529+
-H 'Authorization: Basic ${YOUR_AUTH_TOKEN}'
530+
----
531+
<1> `apm_static_index_pattern_id` is the internal, hard-coded ID of the APM index pattern.
532+
533+
The API returns the following:
534+
535+
[source,json]
536+
----
537+
{
538+
"id":"apm_static_index_pattern_id",
539+
"type":"index-pattern",
540+
"updated_at":"2020-07-06T22:55:59.555Z",
541+
"version":"WzYsMV0=",
542+
"attributes":{...}
543+
"fieldFormatMap":"{...}
544+
"fields":"[{...},{...},...]
545+
"sourceFilters":"[{\"value\":\"sourcemap.sourcemap\"}]",
546+
"timeFieldName":"@timestamp",
547+
"title":"some-other-pattern-*"
548+
},
549+
...
550+
}
551+
----
552+
553+
// More examples will go here
554+
555+
More information on Kibana's API is available in <<api,REST API>>.

docs/apm/set-up.asciidoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ simply click *Load Kibana objects* at the bottom of the Setup Instructions.
2525
[role="screenshot"]
2626
image::apm/images/apm-index-pattern.png[Setup index pattern for APM in Kibana]
2727

28-
To use a custom index pattern, see <<apm-settings-in-kibana>>.
28+
TIP: To use a custom index pattern,
29+
adjust Kibana's <<apm-settings-in-kibana,settings>> or use the <<api-create-apm-index-pattern,Kibana API>>.
2930

3031
[float]
3132
[[apm-getting-started-next]]
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [AuditableEvent](./kibana-plugin-core-server.auditableevent.md)
4+
5+
## AuditableEvent interface
6+
7+
Event to audit.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
export interface AuditableEvent
13+
```
14+
15+
## Remarks
16+
17+
Not a complete interface.
18+
19+
## Properties
20+
21+
| Property | Type | Description |
22+
| --- | --- | --- |
23+
| [message](./kibana-plugin-core-server.auditableevent.message.md) | <code>string</code> | |
24+
| [type](./kibana-plugin-core-server.auditableevent.type.md) | <code>string</code> | |
25+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [AuditableEvent](./kibana-plugin-core-server.auditableevent.md) &gt; [message](./kibana-plugin-core-server.auditableevent.message.md)
4+
5+
## AuditableEvent.message property
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
message: string;
11+
```
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [AuditableEvent](./kibana-plugin-core-server.auditableevent.md) &gt; [type](./kibana-plugin-core-server.auditableevent.type.md)
4+
5+
## AuditableEvent.type property
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
type: string;
11+
```
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [Auditor](./kibana-plugin-core-server.auditor.md) &gt; [add](./kibana-plugin-core-server.auditor.add.md)
4+
5+
## Auditor.add() method
6+
7+
Add a record to audit log. Service attaches to a log record: - metadata about an end-user initiating an operation - scope name, if presents
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
add(event: AuditableEvent): void;
13+
```
14+
15+
## Parameters
16+
17+
| Parameter | Type | Description |
18+
| --- | --- | --- |
19+
| event | <code>AuditableEvent</code> | |
20+
21+
<b>Returns:</b>
22+
23+
`void`
24+
25+
## Example
26+
27+
How to add a record in audit log:
28+
29+
```typescript
30+
router.get({ path: '/my_endpoint', validate: false }, async (context, request, response) => {
31+
context.core.auditor.withAuditScope('my_plugin_operation');
32+
const value = await context.core.elasticsearch.legacy.client.callAsCurrentUser('...');
33+
context.core.add({ type: 'operation.type', message: 'perform an operation in ... endpoint' });
34+
35+
```
36+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [Auditor](./kibana-plugin-core-server.auditor.md)
4+
5+
## Auditor interface
6+
7+
Provides methods to log user actions and access events.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
export interface Auditor
13+
```
14+
15+
## Methods
16+
17+
| Method | Description |
18+
| --- | --- |
19+
| [add(event)](./kibana-plugin-core-server.auditor.add.md) | Add a record to audit log. Service attaches to a log record: - metadata about an end-user initiating an operation - scope name, if presents |
20+
| [withAuditScope(name)](./kibana-plugin-core-server.auditor.withauditscope.md) | Add a high-level scope name for logged events. It helps to identify the root cause of low-level events. |
21+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [Auditor](./kibana-plugin-core-server.auditor.md) &gt; [withAuditScope](./kibana-plugin-core-server.auditor.withauditscope.md)
4+
5+
## Auditor.withAuditScope() method
6+
7+
Add a high-level scope name for logged events. It helps to identify the root cause of low-level events.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
withAuditScope(name: string): void;
13+
```
14+
15+
## Parameters
16+
17+
| Parameter | Type | Description |
18+
| --- | --- | --- |
19+
| name | <code>string</code> | |
20+
21+
<b>Returns:</b>
22+
23+
`void`
24+

0 commit comments

Comments
 (0)