forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request elastic#7372 from elastic/feature/ingest
Add Data - CSV Former-commit-id: 15a4fa1
- Loading branch information
Showing
213 changed files
with
9,708 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
31 changes: 31 additions & 0 deletions
31
src/plugins/kibana/common/lib/__tests__/convert_pattern_and_ingest_name.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import expect from 'expect.js'; | ||
import {patternToIngest, ingestToPattern} from '../convert_pattern_and_ingest_name'; | ||
|
||
describe('convertPatternAndTemplateName', function () { | ||
|
||
describe('ingestToPattern', function () { | ||
|
||
it('should convert an index template\'s name to its matching index pattern\'s title', function () { | ||
expect(ingestToPattern('kibana-logstash-*')).to.be('logstash-*'); | ||
}); | ||
|
||
it('should throw an error if the template name isn\'t a valid kibana namespaced name', function () { | ||
expect(ingestToPattern).withArgs('logstash-*').to.throwException('not a valid kibana namespaced template name'); | ||
expect(ingestToPattern).withArgs('').to.throwException(/not a valid kibana namespaced template name/); | ||
}); | ||
|
||
}); | ||
|
||
describe('patternToIngest', function () { | ||
|
||
it('should convert an index pattern\'s title to its matching index template\'s name', function () { | ||
expect(patternToIngest('logstash-*')).to.be('kibana-logstash-*'); | ||
}); | ||
|
||
it('should throw an error if the pattern is empty', function () { | ||
expect(patternToIngest).withArgs('').to.throwException(/pattern must not be empty/); | ||
}); | ||
|
||
}); | ||
|
||
}); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/plugins/kibana/public/management/sections/indices/_edit.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
...nagement/sections/indices/add_data_steps/install_filebeat_step/install_filebeat_step.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<h2><em>Follow these instructions to install Filebeat.</em> | ||
Now that you've got a fresh pipeline and index pattern, let's throw some data at it! | ||
</h2> | ||
|
||
<div class="install-filebeat"> | ||
<ol> | ||
<li> | ||
<span> | ||
<strong>Install Filebeat</strong> on all servers on which you want to tail logs | ||
<a target="_blank" ng-href="{{installStep.docLinks.installation}}"> | ||
<i aria-hidden="true" class="fa fa-info-circle"></i> instructions | ||
</a> | ||
</span> | ||
</li> | ||
|
||
<li> | ||
<span> | ||
<strong>Point Filebeat</strong> at the log files you want to tail | ||
<a target="_blank" ng-href="{{installStep.docLinks.configuration}}"> | ||
<i aria-hidden="true" class="fa fa-info-circle"></i> instructions | ||
</a> | ||
</span> | ||
</li> | ||
|
||
<li ng-if="installStep.results.pipeline.processors.length"> | ||
<span> | ||
<strong>Configure Filebeat</strong> to send data through your new Elasticsearch pipeline | ||
<a target="_blank" ng-href="{{installStep.docLinks.elasticsearchOutput}}"> | ||
<i aria-hidden="true" class="fa fa-info-circle"></i> instructions | ||
</a><br/> | ||
At minimum you'll need to configure Filebeat's Elasticsearch output with a hostname, an index name, and a | ||
<a target="_blank" | ||
ng-href="{{installStep.docLinks.elasticsearchOutputAnchorParameters}}"> | ||
<i aria-hidden="true" class="fa fa-info-circle"></i> paramaters | ||
</a> block. Your config should end up looking something like this:<br/> | ||
<pre> | ||
output: | ||
elasticsearch: | ||
hosts: ["your-elasticsearch-host"] | ||
index: "your-base-index-name" | ||
parameters: | ||
pipeline: "{{installStep.pipelineId}}"</pre> | ||
<em>NOTE</em>: The Filebeat config takes a base index name and automatically rotates the target index by appending "-{date}" | ||
to the end, so if your pattern was "filebeat-*" you would make the index name "filebeat" in filebeat.yml.<br /> | ||
</span> | ||
</li> | ||
|
||
|
||
<li ng-if="!installStep.results.pipeline.processors.length"> | ||
<span> | ||
<strong>Configure Filebeat</strong> to send data to Elasticsearch | ||
<a target="_blank" ng-href="{{installStep.docLinks.elasticsearchOutput}}"> | ||
<i aria-hidden="true" class="fa fa-info-circle"></i> instructions | ||
</a><br/> | ||
At minimum you'll need to configure Filebeat's Elasticsearch output with a hostname and an index name. | ||
Your config should end up looking something like this:<br /> | ||
<pre> | ||
output: | ||
elasticsearch: | ||
hosts: ["your-elasticsearch-host"] | ||
index: "your-base-index-name"</pre> | ||
<em>NOTE</em>: The Filebeat config takes a base index name and automatically rotates the target index by appending "-{date}" | ||
to the end, so if your pattern was "filebeat-*" you would make the index name "filebeat" in filebeat.yml.<br /> | ||
</span> | ||
</li> | ||
|
||
<li> | ||
<span> | ||
<strong>Run Filebeat</strong> on each server | ||
<a target="_blank" ng-href="{{installStep.docLinks.startup}}"> | ||
<i aria-hidden="true" class="fa fa-info-circle"></i> instructions | ||
</a> | ||
</span> | ||
</li> | ||
<li> | ||
<span> | ||
<strong>Verify your filebeat installation below.</strong> We'll poll your new index pattern for documents and let you know when | ||
they show up. If you'd like to skip this step, simply click Done now. | ||
</span> | ||
</li> | ||
</ol> | ||
</div> | ||
|
||
<pattern-checker pattern="installStep.results.indexPattern.id"/> |
23 changes: 23 additions & 0 deletions
23
...management/sections/indices/add_data_steps/install_filebeat_step/install_filebeat_step.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import modules from 'ui/modules'; | ||
import template from './install_filebeat_step.html'; | ||
import 'ui/pattern_checker'; | ||
import { patternToIngest } from '../../../../../../common/lib/convert_pattern_and_ingest_name'; | ||
import { filebeat as docLinks } from '../../../../../../../../ui/public/documentation_links/documentation_links'; | ||
import './styles/_add_data_install_filebeat_step.less'; | ||
|
||
modules.get('apps/management') | ||
.directive('installFilebeatStep', function () { | ||
return { | ||
template: template, | ||
scope: { | ||
results: '=' | ||
}, | ||
bindToController: true, | ||
controllerAs: 'installStep', | ||
controller: function ($scope) { | ||
this.pipelineId = patternToIngest(this.results.indexPattern.id); | ||
this.docLinks = docLinks; | ||
} | ||
}; | ||
}); | ||
|
22 changes: 22 additions & 0 deletions
22
.../indices/add_data_steps/install_filebeat_step/styles/_add_data_install_filebeat_step.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
install-filebeat-step { | ||
|
||
.install-filebeat { | ||
> ol { | ||
padding-left: 1em; | ||
|
||
> li { | ||
padding: 4px 0; | ||
font-weight: bold; | ||
|
||
> span { | ||
font-weight: normal; | ||
|
||
> pre { | ||
margin: 7px 0; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
} |
63 changes: 63 additions & 0 deletions
63
...bana/public/management/sections/indices/add_data_steps/parse_csv_step/parse_csv_step.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<file-upload ng-if="!wizard.file" on-locate="wizard.file = file" upload-selector="button.upload"> | ||
<h2><em>Pick a CSV file to get started.</em> | ||
Please follow the instructions below. | ||
</h2> | ||
|
||
<div class="upload-wizard-file-upload-container"> | ||
<div class="upload-instructions">Drop your file here</div> | ||
<div class="upload-instructions-separator">or</div> | ||
<button class="btn btn-primary btn-lg controls upload" ng-click> | ||
Select File | ||
</button> | ||
<div>Maximum upload file size: 1 GB</div> | ||
</div> | ||
</file-upload> | ||
|
||
<div class="upload-wizard-file-preview-container" ng-if="wizard.file"> | ||
<h2><em>Review the sample below.</em> | ||
Click next if it looks like we parsed your file correctly. | ||
</h2> | ||
|
||
<div ng-if="!!wizard.formattedErrors.length" class="alert alert-danger parse-error"> | ||
<ul> | ||
<li ng-repeat="error in wizard.formattedErrors track by $index">{{ error }}</li> | ||
</ul> | ||
</div> | ||
|
||
<div ng-if="!!wizard.formattedWarnings.length" class="alert alert-warning"> | ||
<ul> | ||
<li ng-repeat="warning in wizard.formattedWarnings track by $index">{{ warning }}</li> | ||
</ul> | ||
</div> | ||
|
||
<div class="advanced-options form-inline"> | ||
<span class="form-group"> | ||
<label>Delimiter</label> | ||
<select ng-model="wizard.parseOptions.delimiter" | ||
ng-options="option.value as option.label for option in wizard.delimiterOptions" | ||
class="form-control"> | ||
</select> | ||
</span> | ||
<span class="form-group"> | ||
<label>Filename:</label> | ||
{{ wizard.file.name }} | ||
</span> | ||
</div> | ||
|
||
<div class="preview"> | ||
<table class="table table-condensed"> | ||
<thead> | ||
<tr> | ||
<th ng-repeat="col in wizard.columns track by $index"> | ||
<span title="{{ col }}">{{ col | limitTo:12 }}{{ col.length > 12 ? '...' : '' }}</span> | ||
</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr ng-repeat="row in wizard.rows"> | ||
<td ng-repeat="cell in row track by $index">{{ cell }}</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> |
Oops, something went wrong.