From e6cc7abfb6e090ded258852170e516909aea0b34 Mon Sep 17 00:00:00 2001 From: Tudor Golubenco Date: Tue, 19 Dec 2017 16:37:35 +0100 Subject: [PATCH] Add cloud version of the apache_logs tutorial (#16) * Add cloud version of the apache_logs tutorial * Added onprem-cloud version as well --- .../tutorials/filebeat_cloud_instructions.js | 91 +++++++++++++++++++ .../filebeat_onprem_cloud_instructions.js | 71 +++++++++++++++ .../tutorials/metricbeat_instructions.js | 2 +- .../tutorials/apache_logs/elastic_cloud.js | 60 +++++++++++- .../server/tutorials/apache_logs/index.js | 11 ++- .../apache_logs/on_prem_elastic_cloud.js | 69 +++++++++++++- 6 files changed, 298 insertions(+), 6 deletions(-) create mode 100644 src/core_plugins/kibana/common/tutorials/filebeat_cloud_instructions.js create mode 100644 src/core_plugins/kibana/common/tutorials/filebeat_onprem_cloud_instructions.js diff --git a/src/core_plugins/kibana/common/tutorials/filebeat_cloud_instructions.js b/src/core_plugins/kibana/common/tutorials/filebeat_cloud_instructions.js new file mode 100644 index 0000000000000..3321fe379567c --- /dev/null +++ b/src/core_plugins/kibana/common/tutorials/filebeat_cloud_instructions.js @@ -0,0 +1,91 @@ +export const FILEBEAT_CLOUD_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/', + ] + }, + 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: '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: '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' + ] + } + }, + CONFIG: { + OSX: { + title: 'Edit the configuration', + textPre: 'Modify `filebeat.yml` to set the connection information for Elastic Cloud:', + commands: [ + 'cloud.id: "{config.cloud.id}"', + 'cloud.auth: "elastic:"' + ], + textPost: 'Where `` is the password of the `elastic` user.' + }, + DEB: { + title: 'Edit the configuration', + textPre: 'Modify `/etc/filebeat/filebeat.yml` to set the connection information for Elastic Cloud:', + commands: [ + 'cloud.id: "{config.cloud.id}"', + 'cloud.auth: "elastic:"' + ], + textPost: 'Where `` is the password of the `elastic` user.' + }, + RPM: { + title: 'Edit the configuration', + textPre: 'Modify `/etc/filebeat/filebeat.yml` to set the connection information for Elastic Cloud:', + commands: [ + 'cloud.id: "{config.cloud.id}"', + 'cloud.auth: "elastic:"' + ], + textPost: 'Where `` is the password of the `elastic` user.' + }, + WINDOWS: { + title: 'Edit the configuration', + textPre: 'Modify `C:\\Program Files\\Filebeat\\filebeat.yml` to set the connection information for Elastic Cloud:', + commands: [ + 'cloud.id: "{config.cloud.id}"', + 'cloud.auth: "elastic:"' + ], + textPost: 'Where `` is the password of the `elastic` user.' + } + } +}; diff --git a/src/core_plugins/kibana/common/tutorials/filebeat_onprem_cloud_instructions.js b/src/core_plugins/kibana/common/tutorials/filebeat_onprem_cloud_instructions.js new file mode 100644 index 0000000000000..c940202259586 --- /dev/null +++ b/src/core_plugins/kibana/common/tutorials/filebeat_onprem_cloud_instructions.js @@ -0,0 +1,71 @@ +export const FILEBEAT_ONPREM_CLOUD_INSTRUCTIONS = { + TRYCLOUD_OPTION1: { + title: 'Option 1: Try module in Elastic Cloud', + textPre: 'Go to [Elastic Cloud](https://cloud.elastic.co/). Register if you ' + + 'don\'t have an account.\n' + + ' * Select **Create Cluster**, leave size slider at 4 GB RAM, and click **Create**\n' + + ' * Wait for the cluster plan to complete.\n' + + ' * Go to the new Cloud Kibana instance and follow the Kibana Home instructions.' + + }, + TRYCLOUD_OPTION2: { + title: 'Option 2: Local Kibana connected to a Cloud instance', + textPre: 'If you are running this Kibana instance against a hosted Elasticsearch instance,' + + ' proceed with manual setup.\n' + + ' * In **Overview >> Endpoints** note **Elasticsearch** as ``' + }, + CONFIG: { + OSX: { + title: 'Edit the configuration', + textPre: 'Modify `filebeat.yml` to set the connection information:', + commands: [ + 'setup.kibana:', + ' host: "<>:5601"', + 'output.elasticsearch:', + ' hosts: [":9200"]', + ' username: "elastic"', + ' password: ""' + ], + textPost: 'Where `` is the password of the `elastic` user.' + }, + DEB: { + title: 'Edit the configuration', + textPre: 'Modify `/etc/filebeat/filebeat.yml` to set the connection information:', + commands: [ + 'setup.kibana:', + ' host: "<>:5601"', + 'output.elasticsearch:', + ' hosts: [":9200"]', + ' username: "elastic"', + ' password: ""' + ], + textPost: 'Where `` is the password of the `elastic` user.' + }, + RPM: { + title: 'Edit the configuration', + textPre: 'Modify `/etc/filebeat/filebeat.yml` to set the connection information:', + commands: [ + 'setup.kibana:', + ' host: "<>:5601"', + 'output.elasticsearch:', + ' hosts: [":9200"]', + ' username: "elastic"', + ' password: ""' + ], + textPost: 'Where `` is the password of the `elastic` user.' + }, + WINDOWS: { + title: 'Edit the configuration', + textPre: 'Modify `C:\\Program Files\\Filebeat\\filebeat.yml` to set the connection information:', + commands: [ + 'setup.kibana:', + ' host: "<>:5601"', + 'output.elasticsearch:', + ' hosts: [":9200"]', + ' username: "elastic"', + ' password: ""' + ], + textPost: 'Where `` is the password of the `elastic` user.' + } + } +}; diff --git a/src/core_plugins/kibana/common/tutorials/metricbeat_instructions.js b/src/core_plugins/kibana/common/tutorials/metricbeat_instructions.js index 365b42a0837f9..cd866a237a4ab 100644 --- a/src/core_plugins/kibana/common/tutorials/metricbeat_instructions.js +++ b/src/core_plugins/kibana/common/tutorials/metricbeat_instructions.js @@ -61,7 +61,7 @@ export const METRICBEAT_INSTRUCTIONS = { title: 'Start Metricbeat', commands: [ './metricbeat setup -e', - './metricbeat -e --setup', + './metricbeat -e', ], textPost: 'The `setup` command loads the Kibana dashboards.' + ' If the dashboards are already set up, omit this command.' diff --git a/src/core_plugins/kibana/server/tutorials/apache_logs/elastic_cloud.js b/src/core_plugins/kibana/server/tutorials/apache_logs/elastic_cloud.js index 058a16196e394..8af57351c556e 100644 --- a/src/core_plugins/kibana/server/tutorials/apache_logs/elastic_cloud.js +++ b/src/core_plugins/kibana/server/tutorials/apache_logs/elastic_cloud.js @@ -1,4 +1,6 @@ import { INSTRUCTION_VARIANT } from '../../../common/tutorials/instruction_variant'; +import { FILEBEAT_INSTRUCTIONS } from '../../../common/tutorials/filebeat_instructions'; +import { FILEBEAT_CLOUD_INSTRUCTIONS } from '../../../common/tutorials/filebeat_cloud_instructions'; export const ELASTIC_CLOUD_INSTRUCTIONS = { instructionSets: [ @@ -8,9 +10,63 @@ export const ELASTIC_CLOUD_INSTRUCTIONS = { { id: INSTRUCTION_VARIANT.OSX, instructions: [ + FILEBEAT_CLOUD_INSTRUCTIONS.INSTALL.OSX, + FILEBEAT_CLOUD_INSTRUCTIONS.CONFIG.OSX, { - title: 'elastiCloud instructions - TBD', - } + title: 'Enable and configure the apache2 module', + textPre: 'From the installation directory, run:', + commands: [ + './filebeat modules enable apache2', + ], + textPost: 'Modify the settings in the `modules.d/apache2.yml` file.' + }, + FILEBEAT_INSTRUCTIONS.START.OSX + ] + }, + { + id: INSTRUCTION_VARIANT.DEB, + instructions: [ + FILEBEAT_CLOUD_INSTRUCTIONS.INSTALL.DEB, + FILEBEAT_CLOUD_INSTRUCTIONS.CONFIG.DEB, + { + title: 'Enable and configure the apache2 module', + commands: [ + 'sudo filebeat modules enable apache2', + ], + textPost: 'Modify the settings in the `/etc/filebeat/modules.d/apache2.yml` file.' + }, + FILEBEAT_INSTRUCTIONS.START.DEB + ] + }, + { + id: INSTRUCTION_VARIANT.RPM, + instructions: [ + FILEBEAT_CLOUD_INSTRUCTIONS.INSTALL.RPM, + FILEBEAT_CLOUD_INSTRUCTIONS.CONFIG.RPM, + { + title: 'Enable and configure the apache2 module', + commands: [ + 'sudo filebeat modules enable apache2', + ], + textPost: 'Modify the settings in the `/etc/filebeat/modules.d/apache2.yml` file.' + }, + FILEBEAT_INSTRUCTIONS.START.RPM + ] + }, + { + id: INSTRUCTION_VARIANT.WINDOWS, + instructions: [ + FILEBEAT_CLOUD_INSTRUCTIONS.INSTALL.WINDOWS, + FILEBEAT_CLOUD_INSTRUCTIONS.CONFIG.WINDOWS, + { + 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: 'Modify the settings in the `modules.d/apache2.yml` file.' + }, + FILEBEAT_INSTRUCTIONS.START.WINDOWS ] } ] diff --git a/src/core_plugins/kibana/server/tutorials/apache_logs/index.js b/src/core_plugins/kibana/server/tutorials/apache_logs/index.js index c894d1da2ae5c..b08edd72b8e41 100644 --- a/src/core_plugins/kibana/server/tutorials/apache_logs/index.js +++ b/src/core_plugins/kibana/server/tutorials/apache_logs/index.js @@ -13,10 +13,19 @@ export function apacheLogsSpecProvider() { ' [Learn more]({config.docs.beats.filebeat}/filebeat-module-apache2.html)' + ' about the apache2 module.', //iconPath: '', TODO + /*artifacts: { + dashboards: [ + { + id: 'Filebeat-Apache2-Dashboard', + linkLabel: 'Apache2 logs dashboard', + isOverview: true + } + ] + },*/ completionTimeMinutes: 10, previewImagePath: '/plugins/kibana/home/tutorial_resources/apacheLogs/kibana-apache2.png', onPrem: ON_PREM_INSTRUCTIONS, elasticCloud: ELASTIC_CLOUD_INSTRUCTIONS, - onPremElasticCloud: ON_PREM_ELASTIC_CLOUD_INSTRUCTIONS + onPremElasticCloud: ON_PREM_ELASTIC_CLOUD_INSTRUCTIONS, }; } diff --git a/src/core_plugins/kibana/server/tutorials/apache_logs/on_prem_elastic_cloud.js b/src/core_plugins/kibana/server/tutorials/apache_logs/on_prem_elastic_cloud.js index e01007c368606..7a9a65dbe462d 100644 --- a/src/core_plugins/kibana/server/tutorials/apache_logs/on_prem_elastic_cloud.js +++ b/src/core_plugins/kibana/server/tutorials/apache_logs/on_prem_elastic_cloud.js @@ -1,4 +1,7 @@ import { INSTRUCTION_VARIANT } from '../../../common/tutorials/instruction_variant'; +import { FILEBEAT_INSTRUCTIONS } from '../../../common/tutorials/filebeat_instructions'; +import { FILEBEAT_CLOUD_INSTRUCTIONS } from '../../../common/tutorials/filebeat_cloud_instructions'; +import { FILEBEAT_ONPREM_CLOUD_INSTRUCTIONS } from '../../../common/tutorials/filebeat_onprem_cloud_instructions'; export const ON_PREM_ELASTIC_CLOUD_INSTRUCTIONS = { instructionSets: [ @@ -8,9 +11,71 @@ export const ON_PREM_ELASTIC_CLOUD_INSTRUCTIONS = { { id: INSTRUCTION_VARIANT.OSX, instructions: [ + FILEBEAT_ONPREM_CLOUD_INSTRUCTIONS.TRYCLOUD_OPTION1, + FILEBEAT_ONPREM_CLOUD_INSTRUCTIONS.TRYCLOUD_OPTION2, + FILEBEAT_CLOUD_INSTRUCTIONS.INSTALL.OSX, + FILEBEAT_ONPREM_CLOUD_INSTRUCTIONS.CONFIG.OSX, { - title: 'onPremElasticCloud instructions - TBD', - } + title: 'Enable and configure the apache2 module', + textPre: 'From the installation directory, run:', + commands: [ + './filebeat modules enable apache2', + ], + textPost: 'Modify the settings in the `modules.d/apache2.yml` file.' + }, + FILEBEAT_INSTRUCTIONS.START.OSX + ] + }, + { + id: INSTRUCTION_VARIANT.DEB, + instructions: [ + FILEBEAT_ONPREM_CLOUD_INSTRUCTIONS.TRYCLOUD_OPTION1, + FILEBEAT_ONPREM_CLOUD_INSTRUCTIONS.TRYCLOUD_OPTION2, + FILEBEAT_CLOUD_INSTRUCTIONS.INSTALL.DEB, + FILEBEAT_ONPREM_CLOUD_INSTRUCTIONS.CONFIG.DEB, + { + title: 'Enable and configure the apache2 module', + commands: [ + 'sudo filebeat modules enable apache2', + ], + textPost: 'Modify the settings in the `/etc/filebeat/modules.d/apache2.yml` file.' + }, + FILEBEAT_INSTRUCTIONS.START.DEB + ] + }, + { + id: INSTRUCTION_VARIANT.RPM, + instructions: [ + FILEBEAT_ONPREM_CLOUD_INSTRUCTIONS.TRYCLOUD_OPTION1, + FILEBEAT_ONPREM_CLOUD_INSTRUCTIONS.TRYCLOUD_OPTION2, + FILEBEAT_CLOUD_INSTRUCTIONS.INSTALL.RPM, + FILEBEAT_ONPREM_CLOUD_INSTRUCTIONS.CONFIG.RPM, + { + title: 'Enable and configure the apache2 module', + commands: [ + 'sudo filebeat modules enable apache2', + ], + textPost: 'Modify the settings in the `/etc/filebeat/modules.d/apache2.yml` file.' + }, + FILEBEAT_INSTRUCTIONS.START.RPM + ] + }, + { + id: INSTRUCTION_VARIANT.WINDOWS, + instructions: [ + FILEBEAT_ONPREM_CLOUD_INSTRUCTIONS.TRYCLOUD_OPTION1, + FILEBEAT_ONPREM_CLOUD_INSTRUCTIONS.TRYCLOUD_OPTION2, + FILEBEAT_CLOUD_INSTRUCTIONS.INSTALL.WINDOWS, + FILEBEAT_ONPREM_CLOUD_INSTRUCTIONS.CONFIG.WINDOWS, + { + 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: 'Modify the settings in the `modules.d/apache2.yml` file.' + }, + FILEBEAT_INSTRUCTIONS.START.WINDOWS ] } ]