Skip to content

Commit

Permalink
[Tutorials] Netflow: instructions for onPremCloud (elastic#18)
Browse files Browse the repository at this point in the history
* Extract common on-prem cloud instructions so LS and Beats can share them

* Extracting common instructions; adding onPremCloud instructions
  • Loading branch information
ycombinator authored and nreese committed Jan 3, 2018
1 parent 2e4e4c7 commit c750d50
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 45 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
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 `<es_url>`'
},
CONFIG: {
OSX: {
title: 'Edit the configuration',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export const 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.'

};

export const 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 `<es_url>`'
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import { INSTRUCTION_VARIANT } from '../../../common/tutorials/instruction_varia
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';
import {
TRYCLOUD_OPTION1,
TRYCLOUD_OPTION2
} from '../../../common/tutorials/onprem_cloud_instructions';

export const ON_PREM_ELASTIC_CLOUD_INSTRUCTIONS = {
instructionSets: [
Expand All @@ -11,8 +15,8 @@ export const ON_PREM_ELASTIC_CLOUD_INSTRUCTIONS = {
{
id: INSTRUCTION_VARIANT.OSX,
instructions: [
FILEBEAT_ONPREM_CLOUD_INSTRUCTIONS.TRYCLOUD_OPTION1,
FILEBEAT_ONPREM_CLOUD_INSTRUCTIONS.TRYCLOUD_OPTION2,
TRYCLOUD_OPTION1,
TRYCLOUD_OPTION2,
FILEBEAT_CLOUD_INSTRUCTIONS.INSTALL.OSX,
FILEBEAT_ONPREM_CLOUD_INSTRUCTIONS.CONFIG.OSX,
{
Expand All @@ -29,8 +33,8 @@ export const ON_PREM_ELASTIC_CLOUD_INSTRUCTIONS = {
{
id: INSTRUCTION_VARIANT.DEB,
instructions: [
FILEBEAT_ONPREM_CLOUD_INSTRUCTIONS.TRYCLOUD_OPTION1,
FILEBEAT_ONPREM_CLOUD_INSTRUCTIONS.TRYCLOUD_OPTION2,
TRYCLOUD_OPTION1,
TRYCLOUD_OPTION2,
FILEBEAT_CLOUD_INSTRUCTIONS.INSTALL.DEB,
FILEBEAT_ONPREM_CLOUD_INSTRUCTIONS.CONFIG.DEB,
{
Expand All @@ -46,8 +50,8 @@ export const ON_PREM_ELASTIC_CLOUD_INSTRUCTIONS = {
{
id: INSTRUCTION_VARIANT.RPM,
instructions: [
FILEBEAT_ONPREM_CLOUD_INSTRUCTIONS.TRYCLOUD_OPTION1,
FILEBEAT_ONPREM_CLOUD_INSTRUCTIONS.TRYCLOUD_OPTION2,
TRYCLOUD_OPTION1,
TRYCLOUD_OPTION2,
FILEBEAT_CLOUD_INSTRUCTIONS.INSTALL.RPM,
FILEBEAT_ONPREM_CLOUD_INSTRUCTIONS.CONFIG.RPM,
{
Expand All @@ -63,8 +67,8 @@ export const ON_PREM_ELASTIC_CLOUD_INSTRUCTIONS = {
{
id: INSTRUCTION_VARIANT.WINDOWS,
instructions: [
FILEBEAT_ONPREM_CLOUD_INSTRUCTIONS.TRYCLOUD_OPTION1,
FILEBEAT_ONPREM_CLOUD_INSTRUCTIONS.TRYCLOUD_OPTION2,
TRYCLOUD_OPTION1,
TRYCLOUD_OPTION2,
FILEBEAT_CLOUD_INSTRUCTIONS.INSTALL.WINDOWS,
FILEBEAT_ONPREM_CLOUD_INSTRUCTIONS.CONFIG.WINDOWS,
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
export const COMMON_NETFLOW_INSTRUCTIONS = {
CONFIG: {
OSX: [
{
title: 'Edit the configuration',
textPre: 'While in the Logstash install directory, modify `config/logstash.yml` to set the'
+ ' configuration parameters for the Netflow module:',
commands: [
'modules:',
' - name: netflow',
' var.input.udp.port: <udp_port_for_receving_netflow_data>',
' var.elasticsearch.hosts: [ "<es_url>" ]',
' var.kibana.host: "<kibana_hostname>:<kibana_port>"'
]
}
]
},
SETUP: {
OSX: [
{
title: 'Set up and run the Netflow module',
textPre: 'In the Logstash install directory, run the following command to set up the Netflow module.',
commands: [
'./bin/logstash --modules netflow --setup',
],
textPost: 'The `--setup` option creates a `netflow-*` index pattern in Elasticsearch and imports' +
' Kibana dashboards and visualizations. Omit this option for subsequent runs of the module to avoid' +
' overwriting existing Kibana dashboards.'
}
]
}
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { INSTRUCTION_VARIANT } from '../../../common/tutorials/instruction_variant';

// TODO: compare with onPremElasticCloud and onPrem scenarios and extract out common bits
export const ELASTIC_CLOUD_INSTRUCTIONS = {
instructionSets: [
{
Expand Down
23 changes: 4 additions & 19 deletions src/core_plugins/kibana/server/tutorials/netflow/on_prem.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
import { PARAM_TYPES } from '../../../common/tutorials/param_types';
import { INSTRUCTION_VARIANT } from '../../../common/tutorials/instruction_variant';
import { LOGSTASH_INSTRUCTIONS } from '../../../common/tutorials/logstash_instructions';
import { COMMON_NETFLOW_INSTRUCTIONS } from './common_instructions';

// TODO: compare with onPremElasticCloud and elasticCloud scenarios and extract out common bits
export const ON_PREM_INSTRUCTIONS = {
params: [
{
id: 'netflow_var_input_udp_port',
label: 'netflow.var.input.udp.port',
type: PARAM_TYPES.NUMBER,
defaultValue: 2055
}
],
instructionSets: [
{
title: 'Getting Started',
Expand All @@ -19,16 +12,8 @@ export const ON_PREM_INSTRUCTIONS = {
id: INSTRUCTION_VARIANT.OSX,
instructions: [
...LOGSTASH_INSTRUCTIONS.INSTALL.OSX,
{
title: 'Set up and run the Netflow module',
textPre: 'In the Logstash install directory, run the following command to set up the Netflow module.',
commands: [
'./bin/logstash --modules netflow -M netflow.var.input.udp.port={params.netflow_var_input_udp_port} --setup',
],
textPost: 'The `--setup` option creates a `netflow-*` index pattern in Elasticsearch and imports' +
' Kibana dashboards and visualizations. Omit this option for subsequent runs of the module to avoid' +
' overwriting existing Kibana dashboards.'
}
...COMMON_NETFLOW_INSTRUCTIONS.CONFIG.OSX,
...COMMON_NETFLOW_INSTRUCTIONS.SETUP.OSX
]
}
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import { INSTRUCTION_VARIANT } from '../../../common/tutorials/instruction_variant';
import { LOGSTASH_INSTRUCTIONS } from '../../../common/tutorials/logstash_instructions';
import {
TRYCLOUD_OPTION1,
TRYCLOUD_OPTION2
} from '../../../common/tutorials/onprem_cloud_instructions';
import { COMMON_NETFLOW_INSTRUCTIONS } from './common_instructions';

// TODO: compare with onPrem and elasticCloud scenarios and extract out common bits
export const ON_PREM_ELASTIC_CLOUD_INSTRUCTIONS = {
instructionSets: [
{
Expand All @@ -8,9 +15,11 @@ export const ON_PREM_ELASTIC_CLOUD_INSTRUCTIONS = {
{
id: INSTRUCTION_VARIANT.OSX,
instructions: [
{
title: 'onPremElasticCloud instructions - TBD',
}
TRYCLOUD_OPTION1,
TRYCLOUD_OPTION2,
...LOGSTASH_INSTRUCTIONS.INSTALL.OSX,
...COMMON_NETFLOW_INSTRUCTIONS.CONFIG.OSX,
...COMMON_NETFLOW_INSTRUCTIONS.SETUP.OSX
]
}
]
Expand Down

0 comments on commit c750d50

Please sign in to comment.