Add translations for Netflow tutorial (#22138) (#22493)

This commit is contained in:
Leanid Shutau 2018-08-29 18:51:56 +03:00 committed by GitHub
parent c1374b0bfe
commit 9cb4404c2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 228 additions and 49 deletions

View file

@ -17,34 +17,90 @@
* under the License.
*/
/* eslint-disable no-multi-str */
import { i18n } from '@kbn/i18n';
export function createCommonNetflowInstructions() {
return {
CONFIG: {
ON_PREM: {
OSX: [
{
title: 'Edit the configuration',
textPre: 'Modify `config/logstash.yml` to set the configuration parameters:',
title: i18n.translate('kbn.server.tutorials.netflow.common.config.onPrem.osxTitle', {
defaultMessage: 'Edit the configuration',
}),
textPre: i18n.translate(
'kbn.server.tutorials.netflow.common.config.onPrem.osxTextPre',
{
defaultMessage: 'Modify {logstashConfigPath} to set the configuration parameters:',
values: {
logstashConfigPath: '`config/logstash.yml`',
},
}
),
commands: ['modules:', ' - name: netflow', ' var.input.udp.port: <udp_port>'],
textPost:
'Where `<udp_port>` is the UDP port on which Logstash will receive Netflow data.',
textPost: i18n.translate(
'kbn.server.tutorials.netflow.common.config.onPrem.osxTextPost',
{
defaultMessage:
'Where {udpPort} is the UDP port on which Logstash will receive Netflow data.',
values: {
udpPort: '`<udp_port>`',
},
}
),
},
],
WINDOWS: [
{
title: 'Edit the configuration',
textPre: 'Modify `config\\logstash.yml` to set the configuration parameters:',
title: i18n.translate(
'kbn.server.tutorials.netflow.common.config.onPrem.windowsTitle',
{
defaultMessage: 'Edit the configuration',
}
),
textPre: i18n.translate(
'kbn.server.tutorials.netflow.common.config.onPrem.windowsTextPre',
{
defaultMessage: 'Modify {logstashConfigPath} to set the configuration parameters:',
values: {
logstashConfigPath: '`config\\logstash.yml`',
},
}
),
commands: ['modules:', ' - name: netflow', ' var.input.udp.port: <udp_port>'],
textPost:
'Where `<udp_port>` is the UDP port on which Logstash will receive Netflow data.',
textPost: i18n.translate(
'kbn.server.tutorials.netflow.common.config.onPrem.windowsTextPost',
{
defaultMessage:
'Where {udpPort} is the UDP port on which Logstash will receive Netflow data.',
values: {
udpPort: '`<udp_port>`',
},
}
),
},
],
},
ON_PREM_ELASTIC_CLOUD: {
OSX: [
{
title: 'Edit the configuration',
textPre: 'Modify `config/logstash.yml` to set the configuration parameters:',
title: i18n.translate(
'kbn.server.tutorials.netflow.common.config.onPremElasticCloud.osxTitle',
{
defaultMessage: 'Edit the configuration',
}
),
textPre: i18n.translate(
'kbn.server.tutorials.netflow.common.config.onPremElasticCloud.osxTextPre',
{
defaultMessage: 'Modify {logstashConfigPath} to set the configuration parameters:',
values: {
logstashConfigPath: '`config/logstash.yml`',
},
}
),
commands: [
'modules:',
' - name: netflow',
@ -53,16 +109,40 @@ export function createCommonNetflowInstructions() {
' var.elasticsearch.username: elastic',
' var.elasticsearch.password: <password>',
],
textPost:
'Where `<udp_port>` is the UDP port on which Logstash will receive Netflow data, ' +
'`<es_url>` is the URL of Elasticsearch running on Elastic Cloud, and ' +
'`<password>` is the password of the `elastic` user.',
textPost: i18n.translate(
'kbn.server.tutorials.netflow.common.config.onPremElasticCloud.osxTextPost',
{
defaultMessage:
'Where {udpPort} is the UDP port on which Logstash will receive Netflow data, \
{esUrl} is the URL of Elasticsearch running on Elastic Cloud, and \
{password} is the password of the {elastic} user.',
values: {
elastic: '`elastic`',
esUrl: '`<es_url>`',
password: '`<password>`',
udpPort: '`<udp_port>`',
},
}
),
},
],
WINDOWS: [
{
title: 'Edit the configuration',
textPre: 'Modify `config\\logstash.yml` to set the configuration parameters:',
title: i18n.translate(
'kbn.server.tutorials.netflow.common.config.onPremElasticCloud.windowsTitle',
{
defaultMessage: 'Edit the configuration',
}
),
textPre: i18n.translate(
'kbn.server.tutorials.netflow.common.config.onPremElasticCloud.windowsTextPre',
{
defaultMessage: 'Modify {logstashConfigPath} to set the configuration parameters:',
values: {
logstashConfigPath: '`config\\logstash.yml`',
},
}
),
commands: [
'modules:',
' - name: netflow',
@ -71,18 +151,42 @@ export function createCommonNetflowInstructions() {
' var.elasticsearch.username: elastic',
' var.elasticsearch.password: <password>',
],
textPost:
'Where `<udp_port>` is the UDP port on which Logstash will receive Netflow data, ' +
'`<es_url>` is the URL of Elasticsearch running on Elastic Cloud, and ' +
'`<password>` is the password of the `elastic` user.',
textPost: i18n.translate(
'kbn.server.tutorials.netflow.common.config.onPremElasticCloud.windowsTextPost',
{
defaultMessage:
'Where {udpPort} is the UDP port on which Logstash will receive Netflow data, \
{esUrl} is the URL of Elasticsearch running on Elastic Cloud, and \
{password} is the password of the {elastic} user.',
values: {
elastic: '`elastic`',
esUrl: '`<es_url>`',
password: '`<password>`',
udpPort: '`<udp_port>`',
},
}
),
},
],
},
ELASTIC_CLOUD: {
OSX: [
{
title: 'Edit the configuration',
textPre: 'Modify `config/logstash.yml` to set the configuration parameters:',
title: i18n.translate(
'kbn.server.tutorials.netflow.common.config.elasticCloud.osxTitle',
{
defaultMessage: 'Edit the configuration',
}
),
textPre: i18n.translate(
'kbn.server.tutorials.netflow.common.config.elasticCloud.osxTextPre',
{
defaultMessage: 'Modify {logstashConfigPath} to set the configuration parameters:',
values: {
logstashConfigPath: '`config/logstash.yml`',
},
}
),
commands: [
'cloud.id: "{config.cloud.id}"',
'cloud.auth: "elastic:<password>"',
@ -91,15 +195,38 @@ export function createCommonNetflowInstructions() {
' - name: netflow',
' var.input.udp.port: <udp_port>',
],
textPost:
'Where `<udp_port>` is the UDP port on which Logstash will receive Netflow data and ' +
'`<password>` is the password of the `elastic` user.',
textPost: i18n.translate(
'kbn.server.tutorials.netflow.common.config.elasticCloud.osxTextPost',
{
defaultMessage:
'Where {udpPort} is the UDP port on which Logstash will receive Netflow data and \
{password} is the password of the {elastic} user.',
values: {
elastic: '`elastic`',
password: '`<password>`',
udpPort: '`<udp_port>`',
},
}
),
},
],
WINDOWS: [
{
title: 'Edit the configuration',
textPre: 'Modify `config\\logstash.yml` to set the configuration parameters:',
title: i18n.translate(
'kbn.server.tutorials.netflow.common.config.elasticCloud.windowsTitle',
{
defaultMessage: 'Edit the configuration',
}
),
textPre: i18n.translate(
'kbn.server.tutorials.netflow.common.config.elasticCloud.windowsTextPre',
{
defaultMessage: 'Modify {logstashConfigPath} to set the configuration parameters:',
values: {
logstashConfigPath: '`config\\logstash.yml`',
},
}
),
commands: [
'cloud.id: "{config.cloud.id}"',
'cloud.auth: "elastic:<password>"',
@ -108,9 +235,19 @@ export function createCommonNetflowInstructions() {
' - name: netflow',
' var.input.udp.port: <udp_port>',
],
textPost:
'Where `<udp_port>` is the UDP port on which Logstash will receive Netflow data and ' +
'`<password>` is the password of the `elastic` user.',
textPost: i18n.translate(
'kbn.server.tutorials.netflow.common.config.elasticCloud.windowsTextPost',
{
defaultMessage:
'Where {udpPort} is the UDP port on which Logstash will receive Netflow data and \
{password} is the password of the {elastic} user.',
values: {
elastic: '`elastic`',
password: '`<password>`',
udpPort: '`<udp_port>`',
},
}
),
},
],
},
@ -118,22 +255,42 @@ export function createCommonNetflowInstructions() {
SETUP: {
OSX: [
{
title: 'Run the Netflow module',
textPre: 'Run:',
title: i18n.translate('kbn.server.tutorials.netflow.common.setup.osxTitle', {
defaultMessage: 'Run the Netflow module',
}),
textPre: i18n.translate('kbn.server.tutorials.netflow.common.setup.osxTextPre', {
defaultMessage: 'Run:',
}),
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 to avoid overwriting existing dashboards.',
textPost: i18n.translate('kbn.server.tutorials.netflow.common.setup.osxTextPost', {
defaultMessage:
'The {setupOption} option creates a {netflowPrefix} index pattern in Elasticsearch and imports \
Kibana dashboards and visualizations. Omit this option for subsequent runs to avoid overwriting existing dashboards.',
values: {
setupOption: '`--setup`',
netflowPrefix: '`netflow-*`',
},
}),
},
],
WINDOWS: [
{
title: 'Run the Netflow module',
textPre: 'Run:',
title: i18n.translate('kbn.server.tutorials.netflow.common.setup.windowsTitle', {
defaultMessage: 'Run the Netflow module',
}),
textPre: i18n.translate('kbn.server.tutorials.netflow.common.setup.windowsTextPre', {
defaultMessage: 'Run:',
}),
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 to avoid overwriting existing dashboards.',
textPost: i18n.translate('kbn.server.tutorials.netflow.common.setup.windowsTextPost', {
defaultMessage:
'The {setupOption} option creates a {netflowPrefix} index pattern in Elasticsearch and imports \
Kibana dashboards and visualizations. Omit this option for subsequent runs to avoid overwriting existing dashboards.',
values: {
setupOption: '`--setup`',
netflowPrefix: '`netflow-*`',
},
}),
},
],
},

View file

@ -17,6 +17,8 @@
* under the License.
*/
import { i18n } from '@kbn/i18n';
import { INSTRUCTION_VARIANT } from '../../../common/tutorials/instruction_variant';
import { createLogstashInstructions } from '../../../common/tutorials/logstash_instructions';
import { createCommonNetflowInstructions } from './common_instructions';
@ -29,7 +31,9 @@ export function createElasticCloudInstructions() {
return {
instructionSets: [
{
title: 'Getting Started',
title: i18n.translate('kbn.server.tutorials.netflow.elasticCloudInstructions.title', {
defaultMessage: 'Getting Started',
}),
instructionVariants: [
{
id: INSTRUCTION_VARIANT.OSX,

View file

@ -17,6 +17,10 @@
* under the License.
*/
/* eslint-disable no-multi-str */
import { i18n } from '@kbn/i18n';
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
import { createOnPremInstructions } from './on_prem';
import { createElasticCloudInstructions } from './elastic_cloud';
@ -27,12 +31,18 @@ export function netflowSpecProvider() {
id: 'netflow',
name: 'Netflow',
category: TUTORIAL_CATEGORY.SECURITY,
shortDescription: 'Collect Netflow records sent by a Netflow exporter.',
longDescription:
'The Logstash Netflow module collects and parses network flow data, ' +
' indexes the events into Elasticsearch, and installs a suite of Kibana dashboards.' +
' This module support Netflow Version 5 and 9.' +
' [Learn more]({config.docs.logstash}/netflow-module.html).',
shortDescription: i18n.translate('kbn.server.tutorials.netflow.tutorialShortDescription', {
defaultMessage: 'Collect Netflow records sent by a Netflow exporter.',
}),
longDescription: i18n.translate('kbn.server.tutorials.netflow.tutorialLongDescription', {
defaultMessage:
'The Logstash Netflow module collects and parses network flow data, \
indexes the events into Elasticsearch, and installs a suite of Kibana dashboards. \
This module support Netflow Version 5 and 9. [Learn more]({linkUrl}).',
values: {
linkUrl: '{config.docs.logstash}/netflow-module.html',
},
}),
artifacts: {
dashboards: [
{

View file

@ -17,6 +17,8 @@
* under the License.
*/
import { i18n } from '@kbn/i18n';
import { INSTRUCTION_VARIANT } from '../../../common/tutorials/instruction_variant';
import { createLogstashInstructions } from '../../../common/tutorials/logstash_instructions';
import { createCommonNetflowInstructions } from './common_instructions';
@ -29,7 +31,9 @@ export function createOnPremInstructions() {
return {
instructionSets: [
{
title: 'Getting Started',
title: i18n.translate('kbn.server.tutorials.netflow.onPremInstructions.title', {
defaultMessage: 'Getting Started',
}),
instructionVariants: [
{
id: INSTRUCTION_VARIANT.OSX,

View file

@ -17,6 +17,8 @@
* under the License.
*/
import { i18n } from '@kbn/i18n';
import { INSTRUCTION_VARIANT } from '../../../common/tutorials/instruction_variant';
import { createLogstashInstructions } from '../../../common/tutorials/logstash_instructions';
import {
@ -35,7 +37,9 @@ export function createOnPremElasticCloudInstructions() {
return {
instructionSets: [
{
title: 'Getting Started',
title: i18n.translate('kbn.server.tutorials.netflow.onPremElasticCloudInstructions.title', {
defaultMessage: 'Getting Started',
}),
instructionVariants: [
{
id: INSTRUCTION_VARIANT.OSX,