Skip to content

Commit

Permalink
Merge branch 'master' into update-ecs-mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankHassanabad committed Jun 9, 2021
2 parents b0fb0db + 8c03ccf commit 6e8cbf3
Show file tree
Hide file tree
Showing 72 changed files with 2,020 additions and 507 deletions.
6 changes: 3 additions & 3 deletions docs/developer/getting-started/sample-data.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ There are a couple ways to easily get data ingested into {es}.
[discrete]
=== Sample data packages available for one click installation

The easiest is to install one or more of our vailable sample data packages. If you have no data, you should be
The easiest is to install one or more of our available sample data packages. If you have no data, you should be
prompted to install when running {kib} for the first time. You can also access and install the sample data packages
by going to the home page and clicking "add sample data".

Expand All @@ -27,5 +27,5 @@ Make sure to execute `node scripts/makelogs` *after* {es} is up and running!
[discrete]
=== CSV upload

If running with a platinum or trial license, you can also use the CSV uploader provided inside the Machine learning app.
Navigate to the Data visualizer to upload your data from a file.
You can also use the CSV uploader provided on the {kib} home page.
Navigate to **Add data** > **Upload file** to upload your data from a file.
3 changes: 1 addition & 2 deletions docs/setup/connect-to-elasticsearch.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ image::images/add-data-fleet.png[Add data using Fleet]
[[upload-data-kibana]]
=== Upload a file

experimental[] If your data is in a CSV, JSON, or log file, you can upload it using the File
Data Visualizer. You can upload a file up to 100 MB. This value is configurable up to 1 GB in
experimental[] If your data is in a CSV, JSON, or log file, you can upload it using the {file-data-viz}. You can upload a file up to 100 MB. This value is configurable up to 1 GB in
<<kibana-ml-settings, Advanced Settings>>. To upload a file with geospatial data,
refer to <<import-geospatial-data, Import geospatial data>>.

Expand Down
Binary file modified docs/setup/images/add-data-fv.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/setup/images/add-data-tutorials.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<titleabbrev>Health monitoring</titleabbrev>
++++

experimental[]

The Task Manager has an internal monitoring mechanism to keep track of a variety of metrics, which can be consumed with either the health monitoring API or the {kib} server log.

The health monitoring API provides a reliable endpoint that can be monitored.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ For details on scaling Task Manager, see <<task-manager-scaling-guidance>>.
[[task-manager-diagnosing-root-cause]]
==== Diagnose a root cause for drift

experimental[]

The following guide helps you identify a root cause for _drift_ by making sense of the output from the <<task-manager-health-monitoring>> endpoint.

By analyzing the different sections of the output, you can evaluate different theories that explain the drift in a deployment.
Expand Down
7 changes: 7 additions & 0 deletions examples/index_pattern_field_editor_example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## index pattern field editor example

This example index pattern field editor app shows how to:
- Edit index pattern fields via flyout
- Delete index pattern runtime fields with modal confirm prompt

To run this example, use the command `yarn start --run-examples`.
10 changes: 10 additions & 0 deletions examples/index_pattern_field_editor_example/kibana.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"id": "indexPatternFieldEditorExample",
"version": "0.0.1",
"kibanaVersion": "kibana",
"server": false,
"ui": true,
"requiredPlugins": ["data", "indexPatternFieldEditor", "developerExamples"],
"optionalPlugins": [],
"requiredBundles": []
}
145 changes: 145 additions & 0 deletions examples/index_pattern_field_editor_example/public/app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import React, { useState } from 'react';
import ReactDOM from 'react-dom';
import {
EuiPage,
EuiPageHeader,
EuiPageBody,
EuiPageContent,
EuiPageContentBody,
EuiButton,
EuiInMemoryTable,
EuiText,
DefaultItemAction,
} from '@elastic/eui';
import { AppMountParameters } from '../../../src/core/public';
import {
DataPublicPluginStart,
IndexPattern,
IndexPatternField,
} from '../../../src/plugins/data/public';
import { IndexPatternFieldEditorStart } from '../../../src/plugins/index_pattern_field_editor/public';

interface Props {
indexPattern?: IndexPattern;
indexPatternFieldEditor: IndexPatternFieldEditorStart;
}

const IndexPatternFieldEditorExample = ({ indexPattern, indexPatternFieldEditor }: Props) => {
const [fields, setFields] = useState<IndexPatternField[]>(
indexPattern?.getNonScriptedFields() || []
);
const refreshFields = () => setFields(indexPattern?.getNonScriptedFields() || []);
const columns = [
{
field: 'name',
name: 'Field name',
},
{
name: 'Actions',
actions: [
{
name: 'Edit',
description: 'Edit this field',
icon: 'pencil',
type: 'icon',
'data-test-subj': 'editField',
onClick: (fld: IndexPatternField) =>
indexPatternFieldEditor.openEditor({
ctx: { indexPattern: indexPattern! },
fieldName: fld.name,
onSave: refreshFields,
}),
},
{
name: 'Delete',
description: 'Delete this field',
icon: 'trash',
type: 'icon',
'data-test-subj': 'deleteField',
available: (fld) => !!fld.runtimeField,
onClick: (fld: IndexPatternField) =>
indexPatternFieldEditor.openDeleteModal({
fieldName: fld.name,
ctx: {
indexPattern: indexPattern!,
},
onDelete: refreshFields,
}),
},
] as Array<DefaultItemAction<IndexPatternField>>,
},
];

const content = indexPattern ? (
<>
<EuiText data-test-subj="indexPatternTitle">Index pattern: {indexPattern?.title}</EuiText>
<div>
<EuiButton
onClick={() =>
indexPatternFieldEditor.openEditor({
ctx: { indexPattern: indexPattern! },
onSave: refreshFields,
})
}
data-test-subj="addField"
>
Add field
</EuiButton>
</div>
<EuiInMemoryTable<IndexPatternField>
items={fields}
columns={columns}
pagination={true}
hasActions={true}
sorting={{
sort: {
field: 'name',
direction: 'asc',
},
}}
/>
</>
) : (
<p>Please create an index pattern</p>
);

return (
<EuiPage>
<EuiPageBody>
<EuiPageHeader>Index pattern field editor demo</EuiPageHeader>
<EuiPageContent>
<EuiPageContentBody>{content}</EuiPageContentBody>
</EuiPageContent>
</EuiPageBody>
</EuiPage>
);
};

interface RenderAppDependencies {
data: DataPublicPluginStart;
indexPatternFieldEditor: IndexPatternFieldEditorStart;
}

export const renderApp = async (
{ data, indexPatternFieldEditor }: RenderAppDependencies,
{ element }: AppMountParameters
) => {
const indexPattern = (await data.indexPatterns.getDefault()) || undefined;
ReactDOM.render(
<IndexPatternFieldEditorExample
indexPattern={indexPattern}
indexPatternFieldEditor={indexPatternFieldEditor}
/>,
element
);

return () => ReactDOM.unmountComponentAtNode(element);
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@
* Side Public License, v 1.
*/

export { EnvironmentService, Environment, EnvironmentServiceSetup } from './environment';
import { IndexPatternFieldEditorPlugin } from './plugin';

export const plugin = () => new IndexPatternFieldEditorPlugin();
56 changes: 56 additions & 0 deletions examples/index_pattern_field_editor_example/public/plugin.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import { Plugin, CoreSetup, AppMountParameters, AppNavLinkStatus } from '../../../src/core/public';
import { DeveloperExamplesSetup } from '../../developer_examples/public';
import { DataPublicPluginStart } from '../../../src/plugins/data/public';
import { IndexPatternFieldEditorStart } from '../../../src/plugins/index_pattern_field_editor/public';

interface StartDeps {
data: DataPublicPluginStart;
indexPatternFieldEditor: IndexPatternFieldEditorStart;
}

interface SetupDeps {
developerExamples: DeveloperExamplesSetup;
}

export class IndexPatternFieldEditorPlugin implements Plugin<void, void, SetupDeps, StartDeps> {
public setup(core: CoreSetup<StartDeps>, deps: SetupDeps) {
core.application.register({
id: 'indexPatternFieldEditorExample',
title: 'Index pattern field editor example',
navLinkStatus: AppNavLinkStatus.hidden,
async mount(params: AppMountParameters) {
const [, depsStart] = await core.getStartServices();
const { renderApp } = await import('./app');
return renderApp(depsStart, params);
},
});

deps.developerExamples.register({
appId: 'indexPatternFieldEditorExample',
title: 'Index pattern field editor',
description: `IndexPatternFieldEditor provides a UI for editing index pattern fields directly from Kibana apps. This example plugin demonstrates integration.`,
links: [
{
label: 'README',
href:
'https://github.com/elastic/kibana/blob/master/src/plugins/index_pattern_field_editor/README.md',
iconType: 'logoGithub',
size: 's',
target: '_blank',
},
],
});
}

public start() {}

public stop() {}
}
18 changes: 18 additions & 0 deletions examples/index_pattern_field_editor_example/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target",
"skipLibCheck": true
},
"include": [
"index.ts",
"public/**/*.ts",
"public/**/*.tsx",
"../../typings/**/*",
],
"exclude": [],
"references": [
{ "path": "../../src/core/tsconfig.json" },
{ "path": "../../src/plugins/kibana_react/tsconfig.json" },
]
}
Loading

0 comments on commit 6e8cbf3

Please sign in to comment.