diff --git a/package.json b/package.json
index 4374c5056995..4fcc9db19f0b 100644
--- a/package.json
+++ b/package.json
@@ -67,6 +67,7 @@
},
"dependencies": {
"@bigfunger/decompress-zip": "0.2.0-stripfix2",
+ "@bigfunger/jsondiffpatch": "0.1.38-webpack",
"@spalger/angular-bootstrap": "0.12.1",
"@spalger/filesaver": "1.1.2",
"@spalger/leaflet-draw": "0.2.3",
diff --git a/src/plugins/kibana/public/settings/sections/indices/add_data_steps/paste_samples_step.html b/src/plugins/kibana/public/settings/sections/indices/add_data_steps/paste_samples_step.html
index b24c6b74094f..382b31765d07 100644
--- a/src/plugins/kibana/public/settings/sections/indices/add_data_steps/paste_samples_step.html
+++ b/src/plugins/kibana/public/settings/sections/indices/add_data_steps/paste_samples_step.html
@@ -10,4 +10,3 @@
+
+
+ {{processor.error.message}}
+
+
+
+
+
+
diff --git a/src/plugins/kibana/public/settings/sections/indices/add_data_steps/pipeline_setup/views/processor_ui_container_header.html b/src/plugins/kibana/public/settings/sections/indices/add_data_steps/pipeline_setup/views/processor_ui_container_header.html
new file mode 100644
index 000000000000..c5e7aa9e582d
--- /dev/null
+++ b/src/plugins/kibana/public/settings/sections/indices/add_data_steps/pipeline_setup/views/processor_ui_container_header.html
@@ -0,0 +1,58 @@
+
diff --git a/src/plugins/kibana/public/settings/sections/indices/add_data_steps/pipeline_setup/views/processor_ui_set.html b/src/plugins/kibana/public/settings/sections/indices/add_data_steps/pipeline_setup/views/processor_ui_set.html
new file mode 100644
index 000000000000..c6459b62f384
--- /dev/null
+++ b/src/plugins/kibana/public/settings/sections/indices/add_data_steps/pipeline_setup/views/processor_ui_set.html
@@ -0,0 +1,8 @@
+
+ pipeline="wizard.stepResults.pipeline"
+ sample-doc="wizard.stepResults.pipeline.output">
diff --git a/src/plugins/kibana/public/settings/sections/indices/filebeat/directives/filebeat_wizard.js b/src/plugins/kibana/public/settings/sections/indices/filebeat/directives/filebeat_wizard.js
index fba75f020781..d2f01e9d240b 100644
--- a/src/plugins/kibana/public/settings/sections/indices/filebeat/directives/filebeat_wizard.js
+++ b/src/plugins/kibana/public/settings/sections/indices/filebeat/directives/filebeat_wizard.js
@@ -4,7 +4,7 @@ import IngestProvider from 'ui/ingest';
require('plugins/kibana/settings/sections/indices/add_data_steps/pattern_review_step');
require('plugins/kibana/settings/sections/indices/add_data_steps/paste_samples_step');
-require('plugins/kibana/settings/sections/indices/add_data_steps/pipeline_step');
+require('plugins/kibana/settings/sections/indices/add_data_steps/pipeline_setup');
require('plugins/kibana/settings/sections/indices/add_data_steps/install_filebeat_step');
// wrapper directive, which sets up the breadcrumb for all filebeat steps
@@ -51,7 +51,8 @@ modules.get('apps/settings')
};
this.save = () => {
- return ingest.save(this.stepResults.indexPattern, this.stepResults.pipeline)
+ const processors = this.stepResults.pipeline.processors.map(processor => processor.model);
+ return ingest.save(this.stepResults.indexPattern, processors)
.then(
() => {
this.nextStep();
diff --git a/src/plugins/kibana/public/settings/styles/main.less b/src/plugins/kibana/public/settings/styles/main.less
index 7cf4bbc16a0b..3bd4e4208b69 100644
--- a/src/plugins/kibana/public/settings/styles/main.less
+++ b/src/plugins/kibana/public/settings/styles/main.less
@@ -180,6 +180,10 @@ kbn-settings-indices {
p.text-center {
padding-top: 1em;
}
+
+ .nav-buttons {
+ float:right;
+ }
}
diff --git a/src/plugins/kibana/server/lib/schemas/resources/ingest_processor_schemas.js b/src/plugins/kibana/server/lib/schemas/resources/ingest_processor_schemas.js
index 02154a359f24..4a8d42fbb530 100644
--- a/src/plugins/kibana/server/lib/schemas/resources/ingest_processor_schemas.js
+++ b/src/plugins/kibana/server/lib/schemas/resources/ingest_processor_schemas.js
@@ -2,10 +2,10 @@ import Joi from 'joi';
const base = Joi.object({
processor_id: Joi.string().required()
-}).unknown();
+});
export const set = base.keys({
type_id: Joi.string().only('set').required(),
- target_field: Joi.string().required(),
- value: Joi.any().required()
+ target_field: Joi.string().allow(''),
+ value: Joi.string().allow('')
});
diff --git a/src/ui/public/ingest/ingest.js b/src/ui/public/ingest/ingest.js
index 0f39c9784a9f..a80d1522f6b6 100644
--- a/src/ui/public/ingest/ingest.js
+++ b/src/ui/public/ingest/ingest.js
@@ -1,5 +1,6 @@
-import { keysToSnakeCaseShallow } from '../../../plugins/kibana/common/lib/case_conversion';
+import { keysToCamelCaseShallow, keysToSnakeCaseShallow } from '../../../plugins/kibana/common/lib/case_conversion';
import _ from 'lodash';
+import angular from 'angular';
export default function IngestProvider($rootScope, $http, config) {
@@ -14,7 +15,7 @@ export default function IngestProvider($rootScope, $http, config) {
index_pattern: keysToSnakeCaseShallow(indexPattern)
};
if (!_.isEmpty(pipeline)) {
- payload.pipeline = pipeline;
+ payload.pipeline = _.map(pipeline, processor => keysToSnakeCaseShallow(processor));
}
return $http.post(`${ingestAPIPrefix}`, payload)
@@ -38,4 +39,24 @@ export default function IngestProvider($rootScope, $http, config) {
});
};
+ this.simulate = function (pipeline) {
+ function pack(pipeline) {
+ const result = keysToSnakeCaseShallow(pipeline);
+ result.processors = _.map(result.processors, processor => keysToSnakeCaseShallow(processor));
+
+ return result;
+ }
+
+ function unpack(response) {
+ const data = response.data.map(result => keysToCamelCaseShallow(result));
+ return data;
+ }
+
+ return $http.post(`${ingestAPIPrefix}/simulate`, pack(pipeline))
+ .then(unpack)
+ .catch(err => {
+ throw ('Error communicating with Kibana server');
+ });
+ };
+
}
diff --git a/src/ui/public/styles/variables/for-theme.less b/src/ui/public/styles/variables/for-theme.less
index e3eb53f5c0bc..2c6f2a6904ad 100644
--- a/src/ui/public/styles/variables/for-theme.less
+++ b/src/ui/public/styles/variables/for-theme.less
@@ -121,6 +121,14 @@
@settings-indices-active-color: @btn-success-bg;
+// Settings - Add Data Wizard - Pipeline Setup =================================
+@settings-pipeline-setup-output-preview-border: @gray12;
+@settings-pipeline-setup-output-preview-bg: @gray-lighter;
+
+@settings-pipeline-setup-pipeline-border: @gray12;
+
+@settings-pipeline-setup-processor-container-overlay-bg: fade(#000, 10%);
+@settings-pipeline-setup-processor-container-header-border: @gray12;
// Visualize ===================================================================
@visualize-show-spy-border: @gray-lighter;
diff --git a/test/unit/api/ingest/processors/_set.js b/test/unit/api/ingest/processors/_set.js
index dd97f92e2701..395a29a80d5b 100644
--- a/test/unit/api/ingest/processors/_set.js
+++ b/test/unit/api/ingest/processors/_set.js
@@ -25,7 +25,8 @@ define(function (require) {
processors: [{
processor_id: 'processor1',
type_id: 'set',
- value: 'bar'
+ value: 'bar',
+ target_field: 42
}]
})
.expect(400)