Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add translations for Netflow tutorial #22138

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
237 changes: 197 additions & 40 deletions src/core_plugins/kibana/server/tutorials/netflow/common_instructions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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>"',
Expand All @@ -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>"',
Expand All @@ -108,32 +235,62 @@ 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>`',
},
}
),
},
],
},
},
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-*`',
},
}),
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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,
Expand Down
22 changes: 16 additions & 6 deletions src/core_plugins/kibana/server/tutorials/netflow/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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',
},
}),
completionTimeMinutes: 10,
//previewImagePath: 'kibana-apache.png', TODO
onPrem: createOnPremInstructions(),
Expand Down
6 changes: 5 additions & 1 deletion src/core_plugins/kibana/server/tutorials/netflow/on_prem.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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,
Expand Down
Loading