Skip to content

Commit

Permalink
Edits for the existing tutorials (elastic#7)
Browse files Browse the repository at this point in the history
* Implements most edits recommended by @dedemorten
* Extracts common parts of the MB tutorials in a `metricbeat_instructions.js` file
* Adds correct links to the docs by using the variables
  • Loading branch information
tsg authored and ycombinator committed Nov 27, 2017
1 parent 9338b65 commit 4364def
Show file tree
Hide file tree
Showing 11 changed files with 358 additions and 620 deletions.
101 changes: 101 additions & 0 deletions src/core_plugins/kibana/common/tutorials/filebeat_instructions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
export const FILEBEAT_INSTRUCTIONS = {
INSTALL: {
OSX: {
title: 'Download and install Filebeat',
textPre: 'Skip this step if Filebeat is already installed.' +
' First time using Filebeat? See the [Getting Started Guide]' +
'({config.docs.beats.filebeat}/filebeat-getting-started.html).',
commands: [
'curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-{config.kibana.version}-darwin-x86_64.tar.gz',
'tar xzvf filebeat-{config.kibana.version}-darwin-x86_64.tar.gz',
'cd filebeat-{config.kibana.version}-darwin-x86_64/',
],
textPost: 'Modify the settings under `output.elasticsearch` in the ' +
'`filebeat.yml` file to point to your Elasticsearch installation.'
},
DEB: {
title: 'Download and install Filebeat',
textPre: 'Skip this step if Filebeat is already installed.' +
' First time using Filebeat? See the [Getting Started Guide]' +
'({config.docs.beats.filebeat}/filebeat-getting-started.html).',
commands: [
'curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-{config.kibana.version}-amd64.deb',
'sudo dpkg -i filebeat-{config.kibana.version}-amd64.deb'
],
textPost: 'Modify the settings under `output.elasticsearch` in the ' +
'`/etc/filebeat/filebeat.yml` file to point to your Elasticsearch installation.\n\n' +
'Looking for the 32 bits packages? See the [Download page](https://www.elastic.co/downloads/beats/filebeat).'
},
RPM: {
title: 'Download and install Filebeat',
textPre: 'Skip this step if Filebeat is already installed.' +
' First time using Filebeat? See the [Getting Started Guide]' +
'({config.docs.beats.filebeat}/filebeat-getting-started.html).',
commands: [
'curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-{config.kibana.version}-x86_64.rpm',
'sudo rpm -vi filebeat-{config.kibana.version}-x86_64.rpm'
],
textPost: 'Modify the settings under `output.elasticsearch` in the ' +
'`/etc/filebeat/filebeat.yml` file to point to your Elasticsearch installation.\n\n' +
'Looking for the 32 bits packages? See the [Download page](https://www.elastic.co/downloads/beats/filebeat).'
},
WINDOWS: {
title: 'Download and install Filebeat',
textPre: 'Skip this step if Filebeat is already installed.' +
' First time using Filebeat? See the [Getting Started Guide]' +
'({config.docs.beats.filebeat}/filebeat-getting-started.html).\n' +
'1. Download the Filebeat Windows zip file from the [downloads](https://www.elastic.co/downloads/beats/filebeat) page.\n' +
'2. Extract the contents of the zip file into `C:\\Program Files`.\n' +
'3. Rename the `filebeat-{config.kibana.version}-windows` directory to `Filebeat`.\n' +
'4. Open a PowerShell prompt as an Administrator (right-click the PowerShell icon and select' +
' Run As Administrator). If you are running Windows XP, you may need to download and install PowerShell.\n' +
'5. From the PowerShell prompt, run the following commands to install Filebeat as a Windows service.',
commands: [
'PS > cd C:\\Program Files\\Filebeat',
'PS C:\\Program Files\\Filebeat> .\\install-service-filebeat.ps1'
],
textPost: 'Modify the settings under `output.elasticsearch` in the ' +
'`C:\\Program Files\\Filebeat\\filebeat.yml` file to point to your Elasticsearch installation.'
}
},
START: {
OSX: {
title: 'Start Filebeat',
commands: [
'./filebeat setup -e',
'./filebeat -e',
],
textPost: 'The `setup` command loads the Kibana dashboards.' +
' If the dashboards are already set up, omit this command.'
},
DEB: {
title: 'Start Filebeat',
commands: [
'sudo filebeat setup -e',
'sudo service filebeat start',
],
textPost: 'The `setup` command loads the Kibana dashboards. If the dashboards are already set up, ' +
'omit this command.'
},
RPM: {
title: 'Start Filebeat',
commands: [
'sudo filebeat setup -e',
'sudo service filebeat start',
],
textPost: 'The `setup` command loads the Kibana dashboards. If the dashboards are already set up, ' +
'omit this command.'
},
WINDOWS: {
title: 'Start Filebeat',
commands: [
'PS C:\\Program Files\\Filebeat> filebeat.exe setup -e',
'PS C:\\Program Files\\Filebeat> Service-Start filebeat',
],
textPost: 'The `setup` command loads the Kibana dashboards. If the dashboards are already set up, ' +
'omit this command.'
}
}
};


Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
export const METRICBEAT_INSTRUCTIONS = {
INSTALL: {
OSX: {
title: 'Download and install Metricbeat',
textPre: 'Skip this step if Metricbeat is already installed.' +
' First time using Metricbeat? See the [Getting Started Guide]' +
'({config.docs.beats.metricbeat}/metricbeat-getting-started.html).',
commands: [
'curl -L -O https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-{config.kibana.version}-darwin-x86_64.tar.gz',
'tar xzvf metricbeat-{config.kibana.version}-darwin-x86_64.tar.gz',
'cd metricbeat-{config.kibana.version}-darwin-x86_64/',
],
textPost: 'Modify the settings under `output.elasticsearch` in the ' +
'`metricbeat.yml` file to point to your Elasticsearch installation.'
},
DEB: {
title: 'Download and install Metricbeat',
textPre: 'Skip this step if Metricbeat is already installed.' +
' First time using Metricbeat? See the [Getting Started Guide]' +
'({config.docs.beats.metricbeat}/metricbeat-getting-started.html).',
commands: [
'curl -L -O https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-{config.kibana.version}-amd64.deb',
'sudo dpkg -i metricbeat-{config.kibana.version}-amd64.deb'
],
textPost: 'Edit the `/etc/metricbeat/metricbeat.yml` file and ' +
'adjust the `output.elasticsearch` settings if needed.'
},
RPM: {
title: 'Download and install Metricbeat',
textPre: 'Skip this step if Metricbeat is already installed.' +
' First time using Metricbeat? See the [Getting Started Guide]' +
'({config.docs.beats.metricbeat}/metricbeat-getting-started.html).',
commands: [
'curl -L -O https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-{config.kibana.version}-x86_64.rpm',
'sudo rpm -vi metricbeat-{config.kibana.version}-x86_64.rpm'
],
textPost: 'Edit the `/etc/metricbeat/metricbeat.yml` file and ' +
'adjust the `output.elasticsearch` settings if needed.'
},
WINDOWS: {
title: 'Download and install Metricbeat',
textPre: 'Skip this step if Metricbeat is already installed.' +
' First time using Metricbeat? See the [Getting Started Guide]' +
'({config.docs.beats.metricbeat}/metricbeat-getting-started.html).\n' +
'1. Download the Metricbeat Windows zip file from the [downloads](https://www.elastic.co/downloads/beats/metricbeat) page.\n' +
'2. Extract the contents of the zip file into `C:\\Program Files`.\n' +
'3. Rename the `metricbeat-{config.kibana.version}-windows` directory to `Metricbeat`.\n' +
'4. Open a PowerShell prompt as an Administrator (right-click the PowerShell icon and select' +
' Run As Administrator). If you are running Windows XP, you may need to download and install PowerShell.\n' +
'5. From the PowerShell prompt, run the following commands to install Metricbeat as a Windows service.',
commands: [
'PS > cd C:\\Program Files\\Metricbeat',
'PS C:\\Program Files\\Metricbeat> .\\install-service-metricbeat.ps1'
],
textPost: 'Edit the `C:\\Program Files\\Metricbeat\\metricbeat.yml` file and ' +
'adjust the `output.elasticsearch` settings if needed.'
}
},
START: {
OSX: {
title: 'Start Metricbeat',
commands: [
'./metricbeat setup -e',
'./metricbeat -e --setup',
],
textPost: 'The `setup` command loads the Kibana dashboards.' +
' If the dashboards are already set up, omit this command.'
},
DEB: {
title: 'Start Metricbeat',
commands: [
'sudo metricbeat setup -e',
'sudo service metricbeat start',
],
textPost: 'The `setup` command loads the Kibana dashboards. If the dashboards are already installed, ' +
'omit this command.'
},
RPM: {
title: 'Start Metricbeat',
commands: [
'sudo metricbeat setup -e',
'sudo service metricbeat start',
],
textPost: 'The `setup` command loads the Kibana dashboards. If the dashboards are already installed, ' +
'omit this command.'
},
WINDOWS: {
title: 'Start Metricbeat',
commands: [
'PS C:\\Program Files\\Metricbeat> metricbeat.exe setup -e',
'PS C:\\Program Files\\Metricbeat> Service-Start metricbeat',
],
textPost: 'The `setup` command loads the Kibana dashboards. If the dashboards are already installed, ' +
'omit this command.'
}
}
};

This file was deleted.

31 changes: 15 additions & 16 deletions src/core_plugins/kibana/server/tutorials/apacheLogs/index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
import { INSTRUCTION_VARIANT } from '../../../common/tutorials/instruction_variant';
import { FILEBEAT_INSTRUCTIONS } from '../../../common/tutorials/tutorial_beats_instructions';
import { FILEBEAT_INSTRUCTIONS } from '../../../common/tutorials/filebeat_instructions';

export function apacheLogsSpecProvider() {
return {
id: 'apacheLogs',
name: 'Apache logs',
category: TUTORIAL_CATEGORY.LOGGING,
shortDescription: 'This module parses access and error logs created by the Apache HTTP server.',
longDescription: 'This module parses access and error logs created by the Apache 2 HTTP server.' +
' You can read more about the Filebeat Apache module in the [documentation].',
shortDescription: 'Collect and parse access and error logs created by the Apache HTTP server.',
longDescription: 'The apache2 Filebeat module parses access and error logs created by the Apache 2 HTTP server.' +
' [Learn more]({config.docs.beats.filebeat}/filebeat-module-apache2.html)' +
' about the apache2 module.',
//iconPath: '', TODO
completionTimeMinutes: 10,
previewImagePath: '/plugins/kibana/home/tutorial_resources/apacheLogs/kibana-apache2.png',
Expand All @@ -22,12 +23,12 @@ export function apacheLogsSpecProvider() {
instructions: [
FILEBEAT_INSTRUCTIONS.INSTALL.OSX,
{
title: 'Enable and configure the Apache module',
textPre: 'In the Filebeat install directory, run the following commands to enable the Apache module.',
title: 'Enable and configure the apache2 module',
textPre: 'From the installation directory, run:',
commands: [
'./filebeat modules enable apache2',
],
textPost: 'Optional: Modify the module settings in the `modules.d/apache2.yml` file.'
textPost: 'Modify the settings in the `modules.d/apache2.yml` file.'
},
FILEBEAT_INSTRUCTIONS.START.OSX
]
Expand All @@ -37,12 +38,11 @@ export function apacheLogsSpecProvider() {
instructions: [
FILEBEAT_INSTRUCTIONS.INSTALL.DEB,
{
title: 'Enable and configure the Apache module',
textPre: 'Run the following commands to enable the Apache module.',
title: 'Enable and configure the apache2 module',
commands: [
'sudo filebeat modules enable apache2',
],
textPost: 'Optional: Modify the module settings in the `/etc/filebeat/modules.d/apache2.yml` file.'
textPost: 'Modify the settings in the `/etc/filebeat/modules.d/apache2.yml` file.'
},
FILEBEAT_INSTRUCTIONS.START.DEB
]
Expand All @@ -52,12 +52,11 @@ export function apacheLogsSpecProvider() {
instructions: [
FILEBEAT_INSTRUCTIONS.INSTALL.RPM,
{
title: 'Enable and configure the Apache module',
textPre: 'Run the following commands to enable the Apache module.',
title: 'Enable and configure the apache2 module',
commands: [
'sudo filebeat modules enable apache2',
],
textPost: 'Optional: Modify the module settings in the `/etc/filebeat/modules.d/apache2.yml` file.'
textPost: 'Modify the settings in the `/etc/filebeat/modules.d/apache2.yml` file.'
},
FILEBEAT_INSTRUCTIONS.START.RPM
]
Expand All @@ -67,12 +66,12 @@ export function apacheLogsSpecProvider() {
instructions: [
FILEBEAT_INSTRUCTIONS.INSTALL.WINDOWS,
{
title: 'Enable and configure the Apache module',
textPre: 'In the `C:\\Program Files\\Filebeat` folder, run the following commands to enable the Apache module.',
title: 'Enable and configure the apache2 module',
textPre: 'From the `C:\\Program Files\\Filebeat` folder, run:',
commands: [
'PS C:\\Program Files\\Filebeat> filebeat.exe modules enable apache2',
],
textPost: 'Optional: Modify the module settings in the `modules.d/apache2.yml` file.'
textPost: 'Modify the settings in the `modules.d/apache2.yml` file.'
},
FILEBEAT_INSTRUCTIONS.START.WINDOWS
]
Expand Down
Loading

0 comments on commit 4364def

Please sign in to comment.