Skip to content

Commit

Permalink
[7.x] Cleanup geoipRequired and uaRequired (#31173) (#34622)
Browse files Browse the repository at this point in the history
Backports the following commits to 7.x:
 - Cleanup geoipRequired and uaRequired  (#31173)
  • Loading branch information
ycombinator authored Apr 5, 2019
1 parent 840b788 commit 8ad134c
Show file tree
Hide file tree
Showing 18 changed files with 18 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -282,33 +282,6 @@ and {kibanaUrlTemplate} is the URL of Kibana.',
}),
}
},
PLUGINS: {
GEOIP_AND_UA: {
title: i18n.translate('kbn.common.tutorials.filebeatInstructions.plugins.geoipUaTitle', {
defaultMessage: 'Install Elasticsearch GeoIP and user agent plugins',
}),
textPre: i18n.translate('kbn.common.tutorials.filebeatInstructions.plugins.geoipUaTextPre', {
defaultMessage: 'This module requires two Elasticsearch plugins that are not installed by default.\n\n\
From the Elasticsearch installation folder, run:',
}),
commands: [
'bin/elasticsearch-plugin install ingest-geoip',
'bin/elasticsearch-plugin install ingest-user-agent',
],
},
GEOIP: {
title: i18n.translate('kbn.common.tutorials.filebeatInstructions.plugins.geoipTitle', {
defaultMessage: 'Install Elasticsearch GeoIP plugin',
}),
textPre: i18n.translate('kbn.common.tutorials.filebeatInstructions.plugins.geoipTextPre', {
defaultMessage: 'This module requires two Elasticsearch plugins that are not installed by default.\n\n\
From the Elasticsearch installation folder, run:',
}),
commands: [
'bin/elasticsearch-plugin install ingest-geoip'
]
}
}
});

export const createFilebeatCloudInstructions = () => ({
Expand Down Expand Up @@ -489,18 +462,13 @@ export function filebeatStatusCheck(moduleName) {
};
}

export function onPremInstructions(moduleName, platforms, geoipRequired, uaRequired, context) {
export function onPremInstructions(moduleName, platforms, context) {
const FILEBEAT_INSTRUCTIONS = createFilebeatInstructions(context);

const variants = [];
for (let i = 0; i < platforms.length; i++) {
const platform = platforms[i];
const instructions = [];
if (geoipRequired && uaRequired) {
instructions.push(FILEBEAT_INSTRUCTIONS.PLUGINS.GEOIP_AND_UA);
} else if (geoipRequired) {
instructions.push(FILEBEAT_INSTRUCTIONS.PLUGINS.GEOIP);
}
instructions.push(FILEBEAT_INSTRUCTIONS.INSTALL[platform]);
instructions.push(FILEBEAT_INSTRUCTIONS.CONFIG[platform]);
instructions.push(filebeatEnableInstructions(moduleName)[platform]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ export function functionbeatStatusCheck() {
};
}

export function onPremInstructions(platforms, geoipRequired, uaRequired, context) {
export function onPremInstructions(platforms, context) {
const FUNCTIONBEAT_INSTRUCTIONS = createFunctionbeatInstructions(context);

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ export function heartbeatStatusCheck() {
};
}

export function onPremInstructions(platforms, geoipRequired, uaRequired, context) {
export function onPremInstructions(platforms, context) {
const HEARTBEAT_INSTRUCTIONS = createHeartbeatInstructions(context);

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ export function metricbeatStatusCheck(moduleName) {
};
}

export function onPremInstructions(moduleName, platforms, geoipRequired, uaRequired, context) {
export function onPremInstructions(moduleName, platforms, context) {
const METRICBEAT_INSTRUCTIONS = createMetricbeatInstructions(context);

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '

export function apacheLogsSpecProvider(server, context) {
const moduleName = 'apache';
const geoipRequired = true;
const uaRequired = true;
const platforms = ['OSX', 'DEB', 'RPM', 'WINDOWS'];
return {
id: 'apacheLogs',
Expand Down Expand Up @@ -59,7 +57,7 @@ export function apacheLogsSpecProvider(server, context) {
},
completionTimeMinutes: 10,
previewImagePath: '/plugins/kibana/home/tutorial_resources/apache_logs/screenshot.png',
onPrem: onPremInstructions(moduleName, platforms, geoipRequired, uaRequired, context),
onPrem: onPremInstructions(moduleName, platforms, context),
elasticCloud: cloudInstructions(moduleName, platforms),
onPremElasticCloud: onPremCloudInstructions(moduleName, platforms)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '

export function elasticsearchLogsSpecProvider(server, context) {
const moduleName = 'elasticsearch';
const geoipRequired = false;
const uaRequired = false;
const platforms = ['OSX', 'DEB', 'RPM', 'WINDOWS'];
return {
id: 'elasticsearchLogs',
Expand Down Expand Up @@ -57,7 +55,7 @@ export function elasticsearchLogsSpecProvider(server, context) {
}
},
completionTimeMinutes: 10,
onPrem: onPremInstructions(moduleName, platforms, geoipRequired, uaRequired, context),
onPrem: onPremInstructions(moduleName, platforms, context),
elasticCloud: cloudInstructions(moduleName, platforms),
onPremElasticCloud: onPremCloudInstructions(moduleName, platforms)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '

export function iisLogsSpecProvider(server, context) {
const moduleName = 'iis';
const geoipRequired = false;
const uaRequired = false;
const platforms = ['WINDOWS'];
return {
id: 'iisLogs',
Expand Down Expand Up @@ -59,7 +57,7 @@ export function iisLogsSpecProvider(server, context) {
},
completionTimeMinutes: 10,
previewImagePath: '/plugins/kibana/home/tutorial_resources/iis_logs/screenshot.png',
onPrem: onPremInstructions(moduleName, platforms, geoipRequired, uaRequired, context),
onPrem: onPremInstructions(moduleName, platforms, context),
elasticCloud: cloudInstructions(moduleName, platforms),
onPremElasticCloud: onPremCloudInstructions(moduleName, platforms)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '

export function kafkaLogsSpecProvider(server, context) {
const moduleName = 'kafka';
const geoipRequired = false;
const uaRequired = false;
const platforms = ['OSX', 'DEB', 'RPM', 'WINDOWS'];
return {
id: 'kafkaLogs',
Expand Down Expand Up @@ -59,7 +57,7 @@ export function kafkaLogsSpecProvider(server, context) {
},
completionTimeMinutes: 10,
previewImagePath: '/plugins/kibana/home/tutorial_resources/kafka_logs/screenshot.png',
onPrem: onPremInstructions(moduleName, platforms, geoipRequired, uaRequired, context),
onPrem: onPremInstructions(moduleName, platforms, context),
elasticCloud: cloudInstructions(moduleName, platforms),
onPremElasticCloud: onPremCloudInstructions(moduleName, platforms)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '

export function logstashLogsSpecProvider(server, context) {
const moduleName = 'logstash';
const geoipRequired = false;
const uaRequired = false;
const platforms = ['OSX', 'DEB', 'RPM', 'WINDOWS'];
return {
id: 'logstashLogs',
Expand Down Expand Up @@ -59,7 +57,7 @@ export function logstashLogsSpecProvider(server, context) {
},
completionTimeMinutes: 10,
previewImagePath: '/plugins/kibana/home/tutorial_resources/logstash_logs/screenshot.png',
onPrem: onPremInstructions(moduleName, platforms, geoipRequired, uaRequired, context),
onPrem: onPremInstructions(moduleName, platforms, context),
elasticCloud: cloudInstructions(moduleName, platforms),
onPremElasticCloud: onPremCloudInstructions(moduleName, platforms)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '

export function mysqlLogsSpecProvider(server, context) {
const moduleName = 'mysql';
const geoipRequired = false;
const uaRequired = false;
const platforms = ['OSX', 'DEB', 'RPM', 'WINDOWS'];
return {
id: 'mysqlLogs',
Expand Down Expand Up @@ -59,7 +57,7 @@ export function mysqlLogsSpecProvider(server, context) {
},
completionTimeMinutes: 10,
previewImagePath: '/plugins/kibana/home/tutorial_resources/mysql_logs/screenshot.png',
onPrem: onPremInstructions(moduleName, platforms, geoipRequired, uaRequired, context),
onPrem: onPremInstructions(moduleName, platforms, context),
elasticCloud: cloudInstructions(moduleName, platforms),
onPremElasticCloud: onPremCloudInstructions(moduleName, platforms)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '

export function nginxLogsSpecProvider(server, context) {
const moduleName = 'nginx';
const geoipRequired = true;
const uaRequired = true;
const platforms = ['OSX', 'DEB', 'RPM', 'WINDOWS'];
return {
id: 'nginxLogs',
Expand Down Expand Up @@ -59,7 +57,7 @@ export function nginxLogsSpecProvider(server, context) {
},
completionTimeMinutes: 10,
previewImagePath: '/plugins/kibana/home/tutorial_resources/nginx_logs/screenshot.png',
onPrem: onPremInstructions(moduleName, platforms, geoipRequired, uaRequired, context),
onPrem: onPremInstructions(moduleName, platforms, context),
elasticCloud: cloudInstructions(moduleName, platforms),
onPremElasticCloud: onPremCloudInstructions(moduleName, platforms)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '

export function osqueryLogsSpecProvider(server, context) {
const moduleName = 'osquery';
const geoipRequired = false;
const uaRequired = false;
const platforms = ['OSX', 'DEB', 'RPM', 'WINDOWS'];
return {
id: 'osqueryLogs',
Expand Down Expand Up @@ -59,7 +57,7 @@ export function osqueryLogsSpecProvider(server, context) {
},
completionTimeMinutes: 10,
previewImagePath: '/plugins/kibana/home/tutorial_resources/osquery_logs/screenshot.png',
onPrem: onPremInstructions(moduleName, platforms, geoipRequired, uaRequired, context),
onPrem: onPremInstructions(moduleName, platforms, context),
elasticCloud: cloudInstructions(moduleName, platforms),
onPremElasticCloud: onPremCloudInstructions(moduleName, platforms)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '

export function postgresqlLogsSpecProvider(server, context) {
const moduleName = 'postgresql';
const geoipRequired = false;
const uaRequired = false;
const platforms = ['OSX', 'DEB', 'RPM', 'WINDOWS'];
return {
id: 'postgresqlLogs',
Expand Down Expand Up @@ -59,7 +57,7 @@ export function postgresqlLogsSpecProvider(server, context) {
},
completionTimeMinutes: 10,
previewImagePath: '/plugins/kibana/home/tutorial_resources/postgresql_logs/screenshot.png',
onPrem: onPremInstructions(moduleName, platforms, geoipRequired, uaRequired, context),
onPrem: onPremInstructions(moduleName, platforms, context),
elasticCloud: cloudInstructions(moduleName, platforms),
onPremElasticCloud: onPremCloudInstructions(moduleName, platforms)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '

export function redisLogsSpecProvider(server, context) {
const moduleName = 'redis';
const geoipRequired = false;
const uaRequired = false;
const platforms = ['OSX', 'DEB', 'RPM', 'WINDOWS'];
return {
id: 'redisLogs',
Expand Down Expand Up @@ -65,7 +63,7 @@ Note that the `slowlog` fileset is experimental. \
},
completionTimeMinutes: 10,
previewImagePath: '/plugins/kibana/home/tutorial_resources/redis_logs/screenshot.png',
onPrem: onPremInstructions(moduleName, platforms, geoipRequired, uaRequired, context),
onPrem: onPremInstructions(moduleName, platforms, context),
elasticCloud: cloudInstructions(moduleName, platforms),
onPremElasticCloud: onPremCloudInstructions(moduleName, platforms)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '

export function suricataLogsSpecProvider(server, context) {
const moduleName = 'suricata';
const geoipRequired = false;
const uaRequired = false;
const platforms = ['OSX', 'DEB', 'RPM', 'WINDOWS'];
return {
id: 'suricataLogs',
Expand Down Expand Up @@ -60,7 +58,7 @@ export function suricataLogsSpecProvider(server, context) {
},
completionTimeMinutes: 10,
previewImagePath: '/plugins/kibana/home/tutorial_resources/suricata_logs/screenshot.png',
onPrem: onPremInstructions(moduleName, platforms, geoipRequired, uaRequired, context),
onPrem: onPremInstructions(moduleName, platforms, context),
elasticCloud: cloudInstructions(moduleName, platforms),
onPremElasticCloud: onPremCloudInstructions(moduleName, platforms)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '

export function systemLogsSpecProvider(server, context) {
const moduleName = 'system';
const geoipRequired = true;
const uaRequired = false;
const platforms = ['OSX', 'DEB', 'RPM'];
return {
id: 'systemLogs',
Expand Down Expand Up @@ -59,7 +57,7 @@ Unix/Linux based distributions. This module is not available on Windows. \
},
completionTimeMinutes: 10,
previewImagePath: '/plugins/kibana/home/tutorial_resources/system_logs/screenshot.png',
onPrem: onPremInstructions(moduleName, platforms, geoipRequired, uaRequired, context),
onPrem: onPremInstructions(moduleName, platforms, context),
elasticCloud: cloudInstructions(moduleName, platforms),
onPremElasticCloud: onPremCloudInstructions(moduleName, platforms)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '

export function traefikLogsSpecProvider(server, context) {
const moduleName = 'traefik';
const geoipRequired = false;
const uaRequired = false;
const platforms = ['OSX', 'DEB', 'RPM', 'WINDOWS'];
return {
id: 'traefikLogs',
Expand Down Expand Up @@ -59,7 +57,7 @@ export function traefikLogsSpecProvider(server, context) {
},
completionTimeMinutes: 10,
previewImagePath: '/plugins/kibana/home/tutorial_resources/traefik_logs/screenshot.png',
onPrem: onPremInstructions(moduleName, platforms, geoipRequired, uaRequired, context),
onPrem: onPremInstructions(moduleName, platforms, context),
elasticCloud: cloudInstructions(moduleName, platforms),
onPremElasticCloud: onPremCloudInstructions(moduleName, platforms)
};
Expand Down
6 changes: 1 addition & 5 deletions x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -980,10 +980,6 @@
"kbn.common.tutorials.filebeatInstructions.install.windowsTextPost": "在 {filebeatPath} 文件中修改 {propertyName} 下的设置以指向您的 Elasticsearch 安装。",
"kbn.common.tutorials.filebeatInstructions.install.windowsTextPre": "首次使用 Filebeat?请参阅[入门指南]({guideLinkUrl})。\n 1. 从[下载]({filebeatLinkUrl})页面下载 Filebeat Windows zip 文件。\n 2. 将 zip 文件的内容解压缩到 {folderPath}。\n 3. 将 `{directoryName}` 目录重命名为 `Filebeat`。\n 4. 以管理员身份打开 PowerShell 提示符(右键单击 PowerShell 图标,然后选择**以管理员身份运行**)。如果您正在运行 Windows XP,您可能需要下载并安装 PowerShell。\n 5. 从 PowerShell 提示符处,运行以下命令以将 Filebeat 安装为 Windows 服务。",
"kbn.common.tutorials.filebeatInstructions.install.windowsTitle": "下载并安装 Filebeat",
"kbn.common.tutorials.filebeatInstructions.plugins.geoipTextPre": "此模块需要两个未默认安装的 Elasticsearch 插件。\n\n从 Elasticsearch 安装文件夹中,运行:",
"kbn.common.tutorials.filebeatInstructions.plugins.geoipTitle": "安装 Elasticsearch GeoIP 插件",
"kbn.common.tutorials.filebeatInstructions.plugins.geoipUaTextPre": "此模块需要两个未默认安装的 Elasticsearch 插件。\n\n从 Elasticsearch 安装文件夹中,运行:",
"kbn.common.tutorials.filebeatInstructions.plugins.geoipUaTitle": "安装 Elasticsearch GeoIP 和用户代理插件",
"kbn.common.tutorials.filebeatInstructions.start.debTextPre": "`setup` 命令加载 Kibana 仪表板。如果仪表板已设置,请省略此命令。",
"kbn.common.tutorials.filebeatInstructions.start.debTitle": "启动 Filebeat",
"kbn.common.tutorials.filebeatInstructions.start.osxTextPre": "`setup` 命令加载 Kibana 仪表板。如果仪表板已设置,请省略此命令。",
Expand Down Expand Up @@ -8138,4 +8134,4 @@
"xpack.watcher.watchActionsTitle": "满足后将执行 {watchActionsCount, plural, one{# 个操作} other {# 个操作}}",
"xpack.watcher.watcherDescription": "通过创建、管理和监测警报来检测数据中的更改。"
}
}
}

0 comments on commit 8ad134c

Please sign in to comment.