-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filebeat wizard #5790
Filebeat wizard #5790
Changes from 24 commits
2672b72
6b2a525
f1f0eab
518b9a3
dcb5e5a
52a4ee3
8b5c95d
50f4652
db8014c
ede8ef6
c5c85b7
25a4e91
b7ddd7e
70e21a2
6690e59
35bd6f4
20b1e6e
38a5ef0
43e44d1
47609ea
f93707b
a74b213
a76b5ec
54af347
2e112f5
e84b028
911cc51
770b51a
9748328
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<h2>Install filebeat step</h2> | ||
|
||
<div> | ||
Results: | ||
<ul> | ||
<li>Logs: {{results.samples}}</li> | ||
<li>Docs: {{results.sampleDocs}}</li> | ||
<li>Pattern: {{results.indexPattern}}</li> | ||
</ul> | ||
</div> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
var modules = require('ui/modules'); | ||
var template = require('plugins/kibana/settings/sections/indices/directives/install_filebeat_step.html'); | ||
|
||
modules.get('apps/settings') | ||
.directive('installFilebeatStep', function () { | ||
return { | ||
template: template, | ||
scope: { | ||
results: '=' | ||
}, | ||
controller: function ($scope) { | ||
var results = $scope.results; | ||
} | ||
}; | ||
}); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<h2>Paste samples step</h2> | ||
|
||
<button ng-click="samples = 'some sample logs'">Do Stuff</button> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
var modules = require('ui/modules'); | ||
var template = require('plugins/kibana/settings/sections/indices/directives/paste_samples_step.html'); | ||
|
||
modules.get('apps/settings') | ||
.directive('pasteSamplesStep', function () { | ||
return { | ||
template: template, | ||
scope: { | ||
samples: '=' | ||
} | ||
}; | ||
}); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<h2>Pattern review step</h2> | ||
|
||
<div> | ||
Docs: {{sampleDocs}} | ||
</div> | ||
|
||
<button ng-click="indexPattern = {id: 'logstash-*', title: 'myFirstIndexPattern'}">Create an index pattern</button> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
var modules = require('ui/modules'); | ||
var template = require('plugins/kibana/settings/sections/indices/directives/pattern_review_step.html'); | ||
|
||
modules.get('apps/settings') | ||
.directive('patternReviewStep', function () { | ||
return { | ||
template: template, | ||
scope: { | ||
sampleDocs: '=', | ||
indexPattern: '=', | ||
pipeline: '=' | ||
} | ||
}; | ||
}); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<h2>Build pipeline step</h2> | ||
|
||
<div> | ||
Logs: {{samples}} | ||
</div> | ||
|
||
<button ng-click="sampleDocs = {results: {os: 'osx'}}; pipeline = {processor: 'I processor'};">Build a pipeline</button> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
var modules = require('ui/modules'); | ||
var template = require('plugins/kibana/settings/sections/indices/directives/pipeline_step.html'); | ||
|
||
modules.get('apps/settings') | ||
.directive('pipelineStep', function () { | ||
return { | ||
template: template, | ||
scope: { | ||
samples: '=', | ||
sampleDocs: '=', | ||
pipeline: '=' | ||
} | ||
}; | ||
}); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<kbn-settings-app section="indices"> | ||
<kbn-settings-indices> | ||
<div> | ||
<div class="page-header"> | ||
<h1>Tail a File</h1> | ||
Let's send some log data to Elasticsearch. | ||
</div> | ||
</div> | ||
<div ng-controller="kbnSettingsIndicesFilebeat"> | ||
<div class="wizard-step-headings"> | ||
<span ng-class="{active: currentStep === 0}" | ||
class="wizard-step-heading" | ||
ng-click="setCurrentStep(0)"> | ||
1. Paste | ||
</span> | ||
<span ng-class="{active: currentStep === 1, aheadActive: currentStep < 1}" | ||
class="wizard-step-heading" | ||
ng-click="currentStep < 1 || setCurrentStep(1)"> | ||
2. Parse | ||
</span> | ||
<span ng-class="{active: currentStep === 2, aheadActive: currentStep < 2}" | ||
class="wizard-step-heading" | ||
ng-click="currentStep < 2 || setCurrentStep(2)"> | ||
3. Review | ||
</span> | ||
<span ng-class="{active: currentStep === 3, aheadActive: currentStep < 3}" | ||
class="wizard-step-heading" | ||
ng-click="currentStep < 3 || setCurrentStep(3)"> | ||
4. Install Filebeat | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove breadcrumb from Install Filebeat step There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done, made the buttons very light and unclickable instead of removing them completely |
||
</span> | ||
</div> | ||
|
||
<div ng-switch="currentStep"> | ||
<div ng-switch-when="0"> | ||
<paste-samples-step samples="stepResults.samples"></paste-samples-step> | ||
<div class="nav-buttons"> | ||
<button ng-disabled="!stepResults.samples" ng-click="nextStep()">Next</button> | ||
</div> | ||
</div> | ||
|
||
<div ng-switch-when="1"> | ||
<pipeline-step | ||
samples="stepResults.samples" | ||
pipeline="stepResults.pipeline" | ||
sample-docs="stepResults.sampleDocs"> | ||
</pipeline-step> | ||
|
||
<div class="nav-buttons"> | ||
<button ng-click="prevStep()">Prev</button> | ||
<button ng-disabled="!stepResults.pipeline || !stepResults.sampleDocs" ng-click="nextStep()">Next</button> | ||
</div> | ||
</div> | ||
|
||
<div ng-switch-when="2"> | ||
<pattern-review-step | ||
index-pattern="stepResults.indexPattern" | ||
sample-docs="stepResults.sampleDocs" | ||
pipeline="stepResults.pipeline"> | ||
</pattern-review-step> | ||
|
||
<div class="nav-buttons"> | ||
<button ng-click="prevStep()">Prev</button> | ||
<button ng-disabled="!stepResults.indexPattern" ng-click="nextStep()">Save</button> | ||
</div> | ||
</div> | ||
|
||
<div ng-switch-when="3"> | ||
<install-filebeat-step results="stepResults"></install-filebeat-step> | ||
</div> | ||
</div> | ||
</div> | ||
</kbn-settings-indices> | ||
</kbn-settings-app> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
var routes = require('ui/routes'); | ||
var modules = require('ui/modules'); | ||
var template = require('plugins/kibana/settings/sections/indices/filebeat/index.html'); | ||
|
||
require('plugins/kibana/settings/sections/indices/directives/pattern_review_step'); | ||
require('plugins/kibana/settings/sections/indices/directives/paste_samples_step'); | ||
require('plugins/kibana/settings/sections/indices/directives/pipeline_step'); | ||
require('plugins/kibana/settings/sections/indices/directives/install_filebeat_step'); | ||
|
||
routes.when('/settings/indices/create/filebeat', { | ||
template: template | ||
}); | ||
|
||
// wrapper directive, which sets up the breadcrumb for all filebeat steps | ||
modules.get('apps/settings') | ||
.controller('kbnSettingsIndicesFilebeat', function ($scope, AppState, safeConfirm) { | ||
var $state = $scope.state = new AppState(); | ||
var totalSteps = 4; | ||
$scope.stepResults = {}; | ||
|
||
$scope.setCurrentStep = function (step) { | ||
$state.currentStep = step; | ||
$state.save(); | ||
}; | ||
$scope.setCurrentStep(0); | ||
|
||
$scope.nextStep = function () { | ||
if ($state.currentStep + 1 < totalSteps) { | ||
$scope.setCurrentStep($state.currentStep + 1); | ||
} | ||
}; | ||
$scope.prevStep = function () { | ||
if ($state.currentStep > 0) { | ||
$scope.setCurrentStep($state.currentStep - 1); | ||
} | ||
}; | ||
|
||
$scope.$watch('state.currentStep', function (newValue, oldValue) { | ||
if (newValue < oldValue) { | ||
return safeConfirm('Going back will reset any changes you\'ve made to this step, do you want to continue?') | ||
.then( | ||
function () { | ||
if ($state.currentStep < 1) { | ||
delete $scope.stepResults.pipeline; | ||
} | ||
if ($state.currentStep < 2) { | ||
delete $scope.stepResults.indexPattern; | ||
} | ||
$scope.currentStep = newValue; | ||
}, | ||
function () { | ||
$state.currentStep = oldValue; | ||
$state.save(); | ||
} | ||
); | ||
} | ||
else { | ||
$scope.currentStep = newValue; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does this need to happen? isn't it already in the process of being set to newValue? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line is setting $scope.currentStep. The watcher is on $scope.state.currentStep. There might be better names I could use here... :/ I separated them this way so that the screen would only transition once the user has confirmed the alert message. |
||
} | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,13 @@ <h4> | |
<div> | ||
Pick this option if you already have data in Elasticsearch. | ||
</div> | ||
|
||
<h4> | ||
<a href="#/settings/indices/create/filebeat">Tail a File</a> | ||
</h4> | ||
<div> | ||
Pick this option if you have log data you'd like to send to Elasticsearch. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thoughts on this saying log files or log file data? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Log file data sounds ok to me. I wouldn't worry too much about the descriptive text, I'm guessing some wordsmith will refine these later on. |
||
</div> | ||
</div> | ||
</kbn-settings-indices> | ||
</kbn-settings-app> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turn this into a directive and access vars on controller instead of directly on $scope. Use controllerAs, bindToController, controller.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done