diff --git a/ansible/provision.yml b/ansible/provision.yml index 80b12aae2b..d5c2adb6c1 100644 --- a/ansible/provision.yml +++ b/ansible/provision.yml @@ -19,7 +19,7 @@ es_instance_name: "{% for servername in play_hosts %}{% if inventory_hostname==servername %}es-{{ loop.index }}{% endif %}{% endfor %}" roles: - openjdk - - { role: es6, + - { role: es7.17, es_config: { cluster.name: "{{ app_es_etc_cluster_name }}", discovery.zen.ping.unicast.hosts: "{{ groups['es'] }}", diff --git a/ansible/roles/es7.17/LICENSE b/ansible/roles/es7.17/LICENSE new file mode 100644 index 0000000000..0455cacdf6 --- /dev/null +++ b/ansible/roles/es7.17/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2012-2016 Elasticsearch + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/ansible/roles/es7.17/README.md b/ansible/roles/es7.17/README.md new file mode 100644 index 0000000000..47e93f3c66 --- /dev/null +++ b/ansible/roles/es7.17/README.md @@ -0,0 +1,415 @@ +# ansible-elasticsearch +[![Ansible Galaxy](https://img.shields.io/badge/ansible--galaxy-elastic.elasticsearch-blue.svg)](https://galaxy.ansible.com/elastic/elasticsearch/) + +**THIS ROLE IS FOR 7.x.** + +Ansible role for 7.x Elasticsearch. Currently this works on Debian and RedHat based linux systems. Tested platforms are: + +* Ubuntu 14.04/16.04 +* Debian 8 +* Centos 7 + +The latest Elasticsearch versions of 7.x are actively tested. **Only Ansible versions > 2.3.2 are supported, as this is currently the only version tested.** + +##### Dependency +This role uses the json_query filter which [requires jmespath](https://github.com/ansible/ansible/issues/24319) on the local machine. + +## Usage + +Create your Ansible playbook with your own tasks, and include the role elasticsearch. You will have to have this repository accessible within the context of playbook, e.g. + +e.g. + +``` +cd /my/repos/ +git clone https://github.com/elastic/ansible-elasticsearch.git +cd /my/ansible/playbook +mkdir -p roles +ln -s /my/repos/ansible-elasticsearch ./roles/elasticsearch +``` + +Then create your playbook yaml adding the role elasticsearch. By default, the user is only required to specify a unique es_instance_name per role application. This should be unique per node. +The application of the elasticsearch role results in the installation of a node on a host. + +The simplest configuration therefore consists of: + +``` +- name: Simple Example + hosts: localhost + roles: + - { role: elasticsearch, es_instance_name: "node1" } + vars: +``` + +The above installs a single node 'node1' on the hosts 'localhost'. + +This role also uses [Ansible tags](http://docs.ansible.com/ansible/playbooks_tags.html). Run your playbook with the `--list-tasks` flag for more information. + +### Basic Elasticsearch Configuration + +All Elasticsearch configuration parameters are supported. This is achieved using a configuration map parameter 'es_config' which is serialized into the elasticsearch.yml file. +The use of a map ensures the Ansible playbook does not need to be updated to reflect new/deprecated/plugin configuration parameters. + +In addition to the es_config map, several other parameters are supported for additional functions e.g. script installation. These can be found in the role's defaults/main.yml file. + +The following illustrates applying configuration parameters to an Elasticsearch instance. By default, Elasticsearch 5.1.2is installed. + +``` +- name: Elasticsearch with custom configuration + hosts: localhost + roles: + #expand to all available parameters + - { role: elasticsearch, es_instance_name: "node1", es_data_dirs: "/opt/elasticsearch/data", es_log_dir: "/opt/elasticsearch/logs", + es_config: { + node.name: "node1", + cluster.name: "custom-cluster", + discovery.zen.ping.unicast.hosts: "localhost:9301", + http.port: 9201, + transport.tcp.port: 9301, + node.data: false, + node.master: true, + bootstrap.memory_lock: true, + } + } + vars: + es_scripts: false + es_templates: false + es_version_lock: false + es_heap_size: 1g + es_api_port: 9201 +``` + +Whilst the role installs Elasticsearch with the default configuration parameters, the following should be configured to ensure a cluster successfully forms: + +* ```es_config['http.port']``` - the http port for the node +* ```es_config['transport.tcp.port']``` - the transport port for the node +* ```es_config['discovery.zen.ping.unicast.hosts']``` - the unicast discovery list, in the comma separated format ```":,:"``` (typically the clusters dedicated masters) +* ```es_config['network.host']``` - sets both network.bind_host and network.publish_host to the same host value. The network.bind_host setting allows to control the host different network components will bind on. + +The network.publish_host setting allows to control the host the node will publish itself within the cluster so other nodes will be able to connect to it. + +See https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html for further details on default binding behaviour and available options. +The role makes no attempt to enforce the setting of these are requires users to specify them appropriately. IT is recommended master nodes are listed and thus deployed first where possible. + +A more complex example: + +``` +- name: Elasticsearch with custom configuration + hosts: localhost + roles: + #expand to all available parameters + - { role: elasticsearch, es_instance_name: "node1", es_data_dirs: "/opt/elasticsearch/data", es_log_dir: "/opt/elasticsearch/logs", + es_config: { + node.name: "node1", + cluster.name: "custom-cluster", + discovery.zen.ping.unicast.hosts: "localhost:9301", + http.port: 9201, + transport.tcp.port: 9301, + node.data: false, + node.master: true, + bootstrap.memory_lock: true, + } + } + vars: + es_scripts: false + es_templates: false + es_version_lock: false + es_heap_size: 1g + es_start_service: false + es_plugins_reinstall: false + es_api_port: 9201 + es_plugins: + - plugin: ingest-geoip + proxy_host: proxy.example.com + proxy_port: 8080 +``` + +#### Important Note + +**The role uses es_api_host and es_api_port to communicate with the node for actions only achievable via http e.g. to install templates and to check the NODE IS ACTIVE. These default to "localhost" and 9200 respectively. +If the node is deployed to bind on either a different host or port, these must be changed.** + +### Multi Node Server Installations + +The application of the elasticsearch role results in the installation of a node on a host. Specifying the role multiple times for a host therefore results in the installation of multiple nodes for the host. + +An example of a two server deployment is shown below. The first server holds the master and is thus declared first. Whilst not mandatory, this is recommended in any multi node cluster configuration. The second server hosts two data nodes. + +**Note the structure of the below playbook for the data nodes. Whilst a more succinct structures are possible which allow the same role to be applied to a host multiple times, we have found the below structure to be the most reliable with respect to var behaviour. This is the tested approach.** + +``` +- hosts: master_nodes + roles: + - { role: elasticsearch, es_instance_name: "node1", es_heap_size: "1g", + es_config: { + cluster.name: "test-cluster", + discovery.zen.ping.unicast.hosts: "elastic02:9300", + http.port: 9200, + transport.tcp.port: 9300, + node.data: false, + node.master: true, + bootstrap.memory_lock: false, + } + } + vars: + es_scripts: false + es_templates: false + es_version_lock: false + ansible_user: ansible + es_plugins: + - plugin: ingest-geoip + + + +- hosts: data_nodes + roles: + - { role: elasticsearch, es_instance_name: "node1", es_data_dirs: "/opt/elasticsearch", + es_config: { + discovery.zen.ping.unicast.hosts: "elastic02:9300", + http.port: 9200, + transport.tcp.port: 9300, + node.data: true, + node.master: false, + bootstrap.memory_lock: false, + cluster.name: "test-cluster" + } + } + vars: + es_scripts: false + es_templates: false + es_version_lock: false + ansible_user: ansible + es_api_port: 9200 + es_plugins: + - plugin: ingest-geoip + + +- hosts: data_nodes + roles: + - { role: elasticsearch, es_instance_name: "node2", es_api_port:9201, + es_config: { + discovery.zen.ping.unicast.hosts: "elastic02:9300", + http.port: 9201, + transport.tcp.port: 9301, + node.data: true, + node.master: false, + bootstrap.memory_lock: false, + cluster.name: "test-cluster", + } + } + vars: + es_scripts: false + es_templates: false + es_version_lock: false + es_api_port: 9201 + ansible_user: ansible + es_plugins: + - plugin: ingest-geoip + +``` + +Parameters can additionally be assigned to hosts using the inventory file if desired. + +Make sure your hosts are defined in your ```inventory``` file with the appropriate ```ansible_ssh_host```, ```ansible_ssh_user``` and ```ansible_ssh_private_key_file``` values. + +Then run it: + +``` +ansible-playbook -i hosts ./your-playbook.yml +``` + +### Installing X-Pack Features + +X-Pack features, such as Security, are supported. This feature is currently experimental. To enable X-Pack set the parameter `es_enable_xpack` to true and list the required features in the parameter `es_xpack_features`. + +The parameter `es_xpack_features` by default enables all features i.e. it defaults to ["alerting","monitoring","graph","security","ml"] + +The following additional parameters allow X-Pack to be configured: + +* ```es_message_auth_file``` System Key field to allow message authentication. This file should be placed in the 'files' directory. +* ```es_xpack_custom_url``` Url from which X-Pack can be downloaded. This can be used for installations in isolated environments where the elastic.co repo is not accessible. e.g. ```es_xpack_custom_url: "https://artifacts.elastic.co/downloads/packs/x-pack/x-pack-5.5.1.zip"``` +* ```es_role_mapping``` Role mappings file declared as yml as described [here](https://www.elastic.co/guide/en/x-pack/current/mapping-roles.html) + + +``` +es_role_mapping: + power_user: + - "cn=admins,dc=example,dc=com" + user: + - "cn=users,dc=example,dc=com" + - "cn=admins,dc=example,dc=com" +``` + +* ```es_users``` - Users can be declared here as yml. Two sub keys 'native' and 'file' determine the realm under which realm the user is created. Beneath each of these keys users should be declared as yml entries. e.g. + +``` +es_users: + native: + kibana4_server: + password: changeMe + roles: + - kibana4_server + file: + es_admin: + password: changeMe + roles: + - admin + testUser: + password: changeMeAlso! + roles: + - power_user + - user +``` + + +* ```es_roles``` - Elasticsearch roles can be declared here as yml. Two sub keys 'native' and 'file' determine how the role is created i.e. either through a file or http(native) call. Beneath each key list the roles with appropriate permissions, using the file based format described [here] (https://www.elastic.co/guide/en/x-pack/current/file-realm.html) e.g. + +``` +es_roles: + file: + admin: + cluster: + - all + indices: + - names: '*' + privileges: + - all + power_user: + cluster: + - monitor + indices: + - names: '*' + privileges: + - all + user: + indices: + - names: '*' + privileges: + - read + kibana4_server: + cluster: + - monitor + indices: + - names: '.kibana' + privileges: + - all + native: + logstash: + cluster: + - manage_index_templates + indices: + - names: 'logstash-*' + privileges: + - write + - delete + - create_index +``` + +* ```es_xpack_license``` - X-Pack license. The license is a json blob. Set the variable directly (possibly protected by Ansible vault) or from a file in the Ansible project on the control machine via a lookup: + +``` +es_xpack_license: "{{ lookup('file', playbook_dir + '/files/' + es_cluster_name + '/license.json') }}" +``` + +X-Pack configuration parameters can be added to the elasticsearch.yml file using the normal `es_config` parameter. + +For a full example see [here](https://github.com/elastic/ansible-elasticsearch/blob/master/test/integration/xpack.yml) + +#### Important Note for Native Realm Configuration + +In order for native users and roles to be configured, the role calls the Elasticsearch API. Given security is installed this requires definition of two parameters: + +* ```es_api_basic_auth_username``` - admin username +* ```es_api_basic_auth_password``` - admin password + +These can either be set to a user declared in the file based realm, with admin permissions, or the default "elastic" superuser (default password is changeme). + + +### Additional Configuration + +In addition to es_config, the following parameters allow the customization of the Java and Elasticsearch versions as well as the role behaviour. Options include: + +* ```es_major_version``` Should be consistent with es_version. For versions 7.0 this must be "7.x". +* ```es_version``` (e.g. "7.17.13"). +* ```es_api_host``` The host name used for actions requiring HTTP e.g. installing templates. Defaults to "localhost". +* ```es_api_port``` The port used for actions requiring HTTP e.g. installing templates. Defaults to 9200. **CHANGE IF THE HTTP PORT IS NOT 9200** +* ```es_api_basic_auth_username``` The Elasticsearch username for making admin changing actions. Used if Security is enabled. Ensure this user is admin. +* ```es_api_basic_auth_password``` The password associated with the user declared in `es_api_basic_auth_username` +* ```es_start_service``` (true (default) or false) +* ```es_plugins_reinstall``` (true or false (default) ) +* ```es_plugins``` an array of plugin definitions e.g.: +```yml + es_plugins: + - plugin: ingest-geoip +``` +* ```es_allow_downgrades``` For development purposes only. (true or false (default) ) +* ```es_java_install``` If set to false, Java will not be installed. (true (default) or false) +* ```update_java``` Updates Java to the latest version. (true or false (default)) +* ```es_max_map_count``` maximum number of VMA (Virtual Memory Areas) a process can own. Defaults to 262144. +* ```es_max_open_files``` the maximum file descriptor number that can be opened by this process. Defaults to 65536. +* ```es_max_threads``` the maximum number of threads the process can start. Defaults to 2048 (the minimum required by elasticsearch). +* ```es_debian_startup_timeout``` how long Debian-family SysV init scripts wait for the service to start, in seconds. Defaults to 10 seconds. + +Earlier examples illustrate the installation of plugins using `es_plugins`. For officially supported plugins no version or source delimiter is required. The plugin script will determine the appropriate plugin version based on the target Elasticsearch version. For community based plugins include the full url. This approach should NOT be used for the X-Pack plugin. See X-Pack below for details here. + +If installing Monitoring or Alerting, ensure the license plugin is also specified. Security configuration is currently not supported but planned for later versions. + +* ```es_user``` - defaults to elasticsearch. +* ```es_group``` - defaults to elasticsearch. +* ```es_user_id``` - default is undefined. +* ```es_group_id``` - default is undefined. + +Both ```es_user_id``` and ```es_group_id``` must be set for the user and group ids to be set. + +By default, each node on a host will be installed to use unique pid, plugin, work, data and log directories. These directories are created, using the instance and host name, beneath default locations ] +controlled by the following parameters: + +* ```es_pid_dir``` - defaults to "/var/run/elasticsearch". +* ```es_data_dirs``` - defaults to "/var/lib/elasticsearch". This can be a list or comma separated string e.g. ["/opt/elasticsearch/data-1","/opt/elasticsearch/data-2"] or "/opt/elasticsearch/data-1,/opt/elasticsearch/data-2" +* ```es_log_dir``` - defaults to "/var/log/elasticsearch". +* ```es_restart_on_change``` - defaults to true. If false, changes will not result in Elasticsearch being restarted. +* ```es_plugins_reinstall``` - defaults to false. If true, all currently installed plugins will be removed from a node. Listed plugins will then be re-installed. + +This role ships with sample scripts and templates located in the [files/scripts/](files/scripts) and [files/templates/](files/templates) directories, respectively. These variables are used with the Ansible [with_fileglob](http://docs.ansible.com/ansible/playbooks_loops.html#id4) loop. When setting the globs, be sure to use an absolute path. +* ```es_scripts_fileglob``` - defaults to `/files/scripts/`. +* ```es_templates_fileglob``` - defaults to `/files/templates/`. + +### Proxy + +To define proxy globaly, set the following variables: + +* ```es_proxy_host``` - global proxy host +* ```es_proxy_port``` - global proxy port + +To define proxy only for a particular plugin during its installation: + +``` + es_plugins: + - plugin: ingest-geoip + proxy_host: proxy.example.com + proxy_port: 8080 +``` + +> For plugins installation, proxy_host and proxy_port are used first if they are defined and fallback to the global proxy settings if not. The same values are currently used for both the http and https proxy settings. + +## Notes + +* The role assumes the user/group exists on the server. The elasticsearch packages create the default elasticsearch user. If this needs to be changed, ensure the user exists. +* The playbook relies on the inventory_name of each host to ensure its directories are unique +* Changing an instance_name for a role application will result in the installation of a new component. The previous component will remain. +* KitchenCI has been used for testing. This is used to confirm images reach the correct state after a play is first applied. We currently test only the latest version of 6.x on +all supported platforms. +* The role aims to be idempotent. Running the role multiple times, with no changes, should result in no state change on the server. If the configuration is changed, these will be applied and +Elasticsearch restarted where required. +* Systemd is used for Ubuntu versions >= 15, Debian >=8, Centos >=7. All other versions use init for service scripts. +* In order to run x-pack tests a license file with security enabled is required. A trial license is appropriate. Set the environment variable `ES_XPACK_LICENSE_FILE` to the full path of the license file prior to running tests. + +## IMPORTANT NOTES RE PLUGIN MANAGEMENT + +* If the ES version is changed, all plugins will be removed. Those listed in the playbook will be re-installed. This is behaviour is required in ES 6.x. +* If no plugins are listed in the playbook for a node, all currently installed plugins will be removed. +* The role supports automatic detection of differences between installed and listed plugins - installing those listed but not installed, and removing those installed but not listed. Should users wish to re-install plugins they should set es_plugins_reinstall to true. This will cause all currently installed plugins to be removed and those listed to be installed. + +## Questions on Usage + +We welcome questions on how to use the role. However, in order to keep the github issues list focused on "issues" we ask the community to raise questions at https://discuss.elastic.co/c/elasticsearch. This is monitored by the maintainers. diff --git a/ansible/roles/es7.17/ansible.cfg b/ansible/roles/es7.17/ansible.cfg new file mode 100644 index 0000000000..d9a8c50195 --- /dev/null +++ b/ansible/roles/es7.17/ansible.cfg @@ -0,0 +1 @@ +[defaults] \ No newline at end of file diff --git a/ansible/roles/es7.17/defaults/main.yml b/ansible/roles/es7.17/defaults/main.yml new file mode 100644 index 0000000000..39a5775ae8 --- /dev/null +++ b/ansible/roles/es7.17/defaults/main.yml @@ -0,0 +1,48 @@ +--- +es_major_version: "7.x" +es_version: "7.17.21" +es_version_lock: false +es_use_repository: true +es_templates_fileglob: "files/templates/*.json" +es_apt_key: "https://artifacts.elastic.co/GPG-KEY-elasticsearch" +es_apt_url: "deb https://artifacts.elastic.co/packages/{{ es_major_version }}/apt stable main" +es_apt_url_old: "deb http://packages.elastic.co/elasticsearch/{{ es_major_version }}/debian stable main" +es_start_service: true +es_java_install: true +update_java: false +es_restart_on_change: true +es_scripts: false +es_templates: true +es_user: elasticsearch +es_group: elasticsearch +es_config_log4j2: log4j2.properties.j2 +#Need to provide default directories +es_pid_dir: "/var/run/elasticsearch" +es_data_dirs: "/var/lib/elasticsearch" +es_log_dir: "/var/log/elasticsearch" +es_max_open_files: 65536 +es_max_threads: "{{ 2048 if ( es_version is version('6.0.0', '<')) else 8192 }}" +es_max_map_count: 262144 +es_allow_downgrades: false +es_enable_xpack: false +es_xpack_features: ["alerting","monitoring","graph","ml"] +#These are used for internal operations performed by ansible. +#They do not affect the current configuration +es_api_host: "localhost" +es_api_port: 9200 +es_debian_startup_timeout: 10 + +# Since ansible 2.2 the following variables need to be defined +# to allow the role to be conditionally played with a when condition. +pid_dir: '' +log_dir: '' +conf_dir: '' +data_dirs: '' +# JVM custom parameters +es_jvm_custom_parameters: '' +es_heap_size: "1g" +es_plugins_reinstall: true +es_plugins: +- plugin: "repository-azure" +- plugin: "repository-s3" +- plugin: "repository-gcs" \ No newline at end of file diff --git a/ansible/roles/es7.17/files/logging/log4j2.properties.custom.j2 b/ansible/roles/es7.17/files/logging/log4j2.properties.custom.j2 new file mode 100644 index 0000000000..9a2a60f885 --- /dev/null +++ b/ansible/roles/es7.17/files/logging/log4j2.properties.custom.j2 @@ -0,0 +1,76 @@ +#CUSTOM LOG4J FILE + +status = error + +# log action execution errors for easier debugging +logger.action.name = org.elasticsearch.action +logger.action.level = info + +appender.console.type = Console +appender.console.name = console +appender.console.layout.type = PatternLayout +appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%m%n + +appender.rolling.type = RollingFile +appender.rolling.name = rolling +appender.rolling.fileName = ${sys:es.logs}.log +appender.rolling.layout.type = PatternLayout +appender.rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%.-10000m%n +appender.rolling.filePattern = ${sys:es.logs}-%d{yyyy-MM-dd}.log +appender.rolling.policies.type = Policies +appender.rolling.policies.time.type = TimeBasedTriggeringPolicy +appender.rolling.policies.time.interval = 1 +appender.rolling.policies.time.modulate = true + +rootLogger.level = debug +rootLogger.appenderRef.console.ref = console +rootLogger.appenderRef.rolling.ref = rolling + +appender.deprecation_rolling.type = RollingFile +appender.deprecation_rolling.name = deprecation_rolling +appender.deprecation_rolling.fileName = ${sys:es.logs}_deprecation.log +appender.deprecation_rolling.layout.type = PatternLayout +appender.deprecation_rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%.-10000m%n +appender.deprecation_rolling.filePattern = ${sys:es.logs}_deprecation-%i.log.gz +appender.deprecation_rolling.policies.type = Policies +appender.deprecation_rolling.policies.size.type = SizeBasedTriggeringPolicy +appender.deprecation_rolling.policies.size.size = 10mb +appender.deprecation_rolling.strategy.type = DefaultRolloverStrategy +appender.deprecation_rolling.strategy.max = 4 + +logger.deprecation.name = org.elasticsearch.deprecation +logger.deprecation.level = debug +logger.deprecation.appenderRef.deprecation_rolling.ref = deprecation_rolling +logger.deprecation.additivity = false + +appender.index_search_slowlog_rolling.type = RollingFile +appender.index_search_slowlog_rolling.name = index_search_slowlog_rolling +appender.index_search_slowlog_rolling.fileName = ${sys:es.logs}_index_search_slowlog.log +appender.index_search_slowlog_rolling.layout.type = PatternLayout +appender.index_search_slowlog_rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c] %marker%.-10000m%n +appender.index_search_slowlog_rolling.filePattern = ${sys:es.logs}_index_search_slowlog-%d{yyyy-MM-dd}.log +appender.index_search_slowlog_rolling.policies.type = Policies +appender.index_search_slowlog_rolling.policies.time.type = TimeBasedTriggeringPolicy +appender.index_search_slowlog_rolling.policies.time.interval = 1 +appender.index_search_slowlog_rolling.policies.time.modulate = true + +logger.index_search_slowlog_rolling.name = index.search.slowlog +logger.index_search_slowlog_rolling.level = debug +logger.index_search_slowlog_rolling.appenderRef.index_search_slowlog_rolling.ref = index_search_slowlog_rolling +logger.index_search_slowlog_rolling.additivity = false + +appender.index_indexing_slowlog_rolling.type = RollingFile +appender.index_indexing_slowlog_rolling.name = index_indexing_slowlog_rolling +appender.index_indexing_slowlog_rolling.fileName = ${sys:es.logs}_index_indexing_slowlog.log +appender.index_indexing_slowlog_rolling.layout.type = PatternLayout +appender.index_indexing_slowlog_rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c] %marker%.-10000m%n +appender.index_indexing_slowlog_rolling.filePattern = ${sys:es.logs}_index_indexing_slowlog-%d{yyyy-MM-dd}.log +appender.index_indexing_slowlog_rolling.policies.type = Policies +appender.index_indexing_slowlog_rolling.policies.time.type = TimeBasedTriggeringPolicy +appender.index_indexing_slowlog_rolling.policies.time.interval = 1 +appender.index_indexing_slowlog_rolling.policies.time.modulate = true + +logger.index_indexing_slowlog.name = index.indexing.slowlog.index +logger.index_indexing_slowlog.level = debug +logger.index_indexing_slowlog.appenderRef.index_indexing_slowlog_rolling.ref = index_indexing_slowlog_rolling +logger.index_indexing_slowlog.additivity = false diff --git a/ansible/roles/es7.17/files/mappings/learning.json b/ansible/roles/es7.17/files/mappings/learning.json new file mode 100644 index 0000000000..c5991a3d59 --- /dev/null +++ b/ansible/roles/es7.17/files/mappings/learning.json @@ -0,0 +1,783 @@ +{ + "index_patterns": "learning-*", + "settings": { + "number_of_shards": 5 + }, + "mappings": { + "events_v1": { + "dynamic": false, + "properties": { + "eid": { + "type": "keyword" + }, + "ets": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "mid": { + "type": "keyword" + }, + "uid": { + "type": "keyword" + }, + "ts": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "syncts": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "ver": { + "type": "keyword" + }, + "context":{ + "properties": { + "pdata": { + "properties": { + "id": { + "type": "keyword" + }, + "model": { + "type": "keyword" + }, + "ver": { + "type": "keyword" + } + } + }, + "granularity": { + "type": "keyword" + }, + "date_range": { + "properties": { + "from": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "to": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + } + } + } + } + }, + "dimensions": { + "properties": { + "did": { + "type": "keyword" + }, + "pdata": { + "properties": { + "id": { + "type": "keyword" + }, + "pid": { + "type": "keyword" + }, + "ver": { + "type": "keyword" + } + } + }, + "gdata": { + "properties": { + "id": { + "type": "keyword" + }, + "ver": { + "type": "keyword" + } + } + }, + "sid": { + "type": "keyword" + }, + "channel": { + "type": "keyword" + }, + "group_user": { + "type": "boolean" + }, + "anonymous_user": { + "type": "boolean" + }, + "uid": { + "type": "keyword" + }, + "ss_mid": { + "type": "keyword" + }, + "tag": { + "type": "keyword" + }, + "period": { + "type": "integer" + }, + "content_id": { + "type": "keyword" + }, + "item_id": { + "type": "keyword" + }, + "author_id": { + "type": "keyword" + }, + "loc": { + "type": "keyword" + }, + "type": { + "type": "keyword" + }, + "mode": { + "type": "keyword" + }, + "context_rollup": { + "properties": { + "l1": { + "type": "keyword" + }, + "l2": { + "type": "keyword" + }, + "l3": { + "type": "keyword" + }, + "l4": { + "type": "keyword" + } + } + }, + "object_rollup": { + "properties": { + "l1": { + "type": "keyword" + }, + "l2": { + "type": "keyword" + }, + "l3": { + "type": "keyword" + }, + "l4": { + "type": "keyword" + } + } + } + } + }, + "edata": { + "properties": { + "eks": { + "properties": { + "total_users_count": { + "type": "long" + }, + "total_devices_count": { + "type": "long" + }, + "total_content_count": { + "type": "long" + }, + "content_ids": { + "type": "keyword" + }, + "device_ids": { + "type": "keyword" + }, + "user_ids": { + "type": "keyword" + }, + "contents": { + "type": "keyword" + }, + "unique_users": { + "type": "keyword" + }, + "avg_ts_session": { + "type": "double" + }, + "total_sessions": { + "type": "long" + }, + "avg_interactions_min": { + "type": "double" + }, + "total_interactions": { + "type": "long" + }, + "avg_pageviews": { + "type": "double" + }, + "total_ts": { + "type": "double" + }, + "time_diff": { + "type": "double" + }, + "time_spent": { + "type": "double" + }, + "interact_events_per_min": { + "type": "double" + }, + "interact_events_count": { + "type": "long" + }, + "total_pageviews_count": { + "type": "long" + }, + "page_views_count": { + "type": "long" + }, + "ce_visits": { + "type": "long" + }, + "start_time": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "end_time": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "syncDate": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "timeSpent": { + "type": "double" + }, + "interactEventsPerMin": { + "type": "double" + }, + "mimeType": { + "type": "keyword" + }, + "contentType": { + "type": "keyword" + }, + "timeDiff": { + "type": "double" + }, + "mode": { + "type": "keyword" + }, + "telemetryVersion": { + "type": "keyword" + }, + "noOfInteractEvents": { + "type": "long" + }, + "interruptTime": { + "type": "double" + }, + "contentCount": { + "type": "long" + }, + "content": { + "type": "keyword" + }, + "time_stamp": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "first_visit": { + "type": "boolean" + }, + "noOfAttempts": { + "type": "integer" + }, + "m_side_loads": { + "type": "integer" + }, + "m_downloads": { + "type": "integer" + }, + "m_avg_rating": { + "type": "double" + }, + "m_ratings": { + "type": "nested", + "properties": { + "rating": { + "type": "integer" + }, + "time": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + } + } + }, + "m_comments": { + "type": "object" + }, + "ce_total_ts": { + "type": "double" + }, + "ce_percent_sessions": { + "type": "double" + }, + "ce_visits_count": { + "type": "long" + }, + "ce_total_visits": { + "type": "long" + }, + "ce_percent_ts": { + "type": "double" + }, + "avg_ts": { + "type": "double" + }, + "inc_res_count": { + "type": "long" + }, + "incorrect_res": { + "type": "nested", + "properties": { + "resp": { + "type": "keyword" + }, + "mmc": { + "type": "keyword" + }, + "count": { + "type": "long" + } + } + }, + "total_count": { + "type": "long" + }, + "correct_res_count": { + "type": "long" + }, + "correct_res": { + "type": "keyword" + }, + "itemId": { + "type": "keyword" + }, + "exTimeSpent": { + "type": "double" + }, + "score": { + "type": "integer" + }, + "pass": { + "type": "keyword" + }, + "qtitle": { + "type": "keyword" + }, + "qdesc": { + "type": "keyword" + }, + "new_user_count": { + "type": "long" + }, + "anon_total_sessions": { + "type": "long" + }, + "anon_total_ts": { + "type": "double" + }, + "anon_avg_ts_session": { + "type": "double" + }, + "percent_new_users_count": { + "type": "double" + }, + "ce_total_sessions": { + "type": "long" + }, + "unique_users_count": { + "type": "long" + }, + "stageVisitCount": { + "type": "long" + }, + "interactEventsCount": { + "type": "long" + }, + "interactEvents": { + "type": "nested", + "properties": { + "type": { + "type": "keyword" + }, + "subtype": { + "type": "keyword" + } + } + }, + "stageId": { + "type": "keyword" + }, + "visitCount": { + "type": "long" + }, + "num_downloads": { + "type": "long" + }, + "num_sideloads": { + "type": "long" + }, + "avg_depth": { + "type": "double" + }, + "publish_pipeline_summary": { + "type": "nested", + "properties": { + "type": { + "type": "keyword" + }, + "state": { + "type": "keyword" + }, + "subtype": { + "type": "keyword" + }, + "count": { + "type": "long" + } + } + }, + "events_summary": { + "type": "nested", + "properties": { + "id": { + "type": "keyword" + }, + "count": { + "type": "long" + } + } + }, + "eventsSummary": { + "type": "nested", + "properties": { + "id": { + "type": "keyword" + }, + "count": { + "type": "long" + } + } + }, + "screenSummary": { + "type": "nested", + "properties": { + "id": { + "type": "keyword" + }, + "timeSpent": { + "type": "double" + }, + "visitCount": { + "type": "long" + } + } + }, + "activitySummary": { + "type": "nested", + "properties": { + "actType": { + "type": "keyword" + }, + "timeSpent": { + "type": "double" + }, + "count": { + "type": "long" + } + } + }, + "page_summary": { + "type": "nested", + "properties": { + "id": { + "type": "keyword" + }, + "type": { + "type": "keyword" + }, + "env": { + "type": "keyword" + }, + "time_spent": { + "type": "double" + }, + "visit_count": { + "type": "long" + } + } + }, + "env_summary": { + "type": "nested", + "properties": { + "env": { + "type": "keyword" + }, + "time_spent": { + "type": "double" + }, + "count": { + "type": "long" + } + } + }, + "itemResponses": { + "type": "nested", + "properties": { + "itemId": { + "type": "keyword" + }, + "timeSpent": { + "type": "double" + }, + "exTimeSpent": { + "type": "double" + }, + "score": { + "type": "integer" + }, + "time_stamp": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "pass": { + "type": "keyword" + }, + "qtitle": { + "type": "keyword" + }, + "qdesc": { + "type": "keyword" + } + } + } + } + } + } + }, + "etags": { + "properties": { + "app": { + "type": "keyword" + }, + "partner": { + "type": "keyword" + }, + "dims": { + "type": "keyword" + } + } + }, + "geoip": { + "properties": { + "location": { + "type": "geo_point" + } + }, + "type": "object" + }, + "contentdata": { + "properties": { + "ageGroup": { + "type": "keyword" + }, + "author": { + "type": "keyword" + }, + "audience": { + "type": "keyword" + }, + "code": { + "type": "keyword" + }, + "collaborators": { + "type": "keyword" + }, + "collections": { + "type": "keyword" + }, + "concepts": { + "type": "keyword" + }, + "contentType": { + "type": "keyword" + }, + "curriculum": { + "type": "keyword" + }, + "developer": { + "type": "keyword" + }, + "domain": { + "type": "keyword" + }, + "downloadUrl": { + "type": "keyword" + }, + "downloads": { + "type": "long" + }, + "edition": { + "type": "keyword" + }, + "genre": { + "type": "keyword" + }, + "gradeLevel": { + "type": "keyword" + }, + "keywords": { + "type": "keyword" + }, + "me_totalDevices": { + "type": "long" + }, + "me_totalDownloads": { + "type": "long" + }, + "me_totalInteractions": { + "type": "long" + }, + "me_totalRatings": { + "type": "long" + }, + "me_totalSessionsCount": { + "type": "long" + }, + "me_totalSideloads": { + "type": "long" + }, + "me_totalTimespent": { + "type": "long" + }, + "me_totalUsage": { + "type": "long" + }, + "medium": { + "type": "keyword" + }, + "methods": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "owner": { + "type": "keyword" + }, + "popularity": { + "type": "long" + }, + "portalOwner": { + "type": "keyword" + }, + "publication": { + "type": "keyword" + }, + "publisher": { + "type": "keyword" + }, + "rating": { + "type": "long" + }, + "size": { + "type": "long" + }, + "source": { + "type": "keyword" + }, + "status": { + "type": "keyword" + }, + "subject": { + "type": "keyword" + }, + "templateType": { + "type": "keyword" + }, + "theme": { + "type": "keyword" + }, + "words": { + "type": "keyword" + } + } + }, + "itemdata": { + "properties": { + "concepts": { + "type": "keyword" + }, + "createdBy": { + "type": "keyword" + }, + "createdOn": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "keywords": { + "type": "keyword" + }, + "language": { + "type": "keyword" + }, + "lastUpdatedBy": { + "type": "keyword" + }, + "lastUpdatedOn": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "media": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "num_answers": { + "type": "long" + }, + "owner": { + "type": "keyword" + }, + "qlevel": { + "type": "keyword" + }, + "question": { + "type": "keyword" + }, + "source": { + "type": "keyword" + }, + "status": { + "type": "keyword" + }, + "template": { + "type": "keyword" + }, + "title": { + "type": "keyword" + }, + "type": { + "type": "keyword" + }, + "version": { + "type": "long" + } + } + }, + "@version": { + "type": "keyword" + } + } + } + } +} \ No newline at end of file diff --git a/ansible/roles/es7.17/files/scripts/calculate-score.groovy b/ansible/roles/es7.17/files/scripts/calculate-score.groovy new file mode 100644 index 0000000000..442c25ca6c --- /dev/null +++ b/ansible/roles/es7.17/files/scripts/calculate-score.groovy @@ -0,0 +1 @@ +log(_score * 2) + my_modifier \ No newline at end of file diff --git a/ansible/roles/es7.17/files/system_key b/ansible/roles/es7.17/files/system_key new file mode 100644 index 0000000000..91962910d2 Binary files /dev/null and b/ansible/roles/es7.17/files/system_key differ diff --git a/ansible/roles/es7.17/files/templates/backend.json b/ansible/roles/es7.17/files/templates/backend.json new file mode 100644 index 0000000000..07161ca348 --- /dev/null +++ b/ansible/roles/es7.17/files/templates/backend.json @@ -0,0 +1,411 @@ +{ + "index_patterns" : "backend-*", + "settings" : { + "number_of_shards" : 5 + }, + "mappings" : { + "events" : { + "dynamic": false, + "properties": { + "@timestamp": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "@version": { + "type": "keyword" + }, + "eid": { + "type": "keyword" + }, + "ets": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "mid": { + "type": "keyword" + }, + "ts": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "ver": { + "type": "keyword" + }, + "actor": { + "properties": { + "id": { + "type": "keyword" + }, + "type": { + "type": "keyword" + } + } + }, + "edata": { + "properties": { + "comments": { + "type": "keyword" + }, + "correlationid": { + "type": "keyword" + }, + "duration": { + "type": "double" + }, + "data": { + "type": "keyword" + }, + "dir": { + "type": "keyword" + }, + "errtype": { + "type": "keyword" + }, + "id": { + "type": "keyword" + }, + "level": { + "type": "keyword" + }, + "loc": { + "type": "keyword" + }, + "message": { + "type": "keyword" + }, + "mode": { + "type": "keyword" + }, + "pass": { + "type": "keyword" + }, + "prevstate": { + "type": "keyword" + }, + "pageid": { + "type": "keyword" + }, + "query": { + "type": "keyword" + }, + "rating": { + "type": "double" + }, + "score": { + "type": "double" + }, + "size": { + "type": "double" + }, + "state": { + "type": "keyword" + }, + "subtype": { + "type": "keyword" + }, + "type": { + "type": "keyword" + }, + "uri": { + "type": "keyword" + }, + "items": { + "type": "nested", + "properties": { + "id": { + "type": "keyword" + }, + "ver": { + "type": "keyword" + }, + "type": { + "type": "keyword" + }, + "origin": { + "properties": { + "id": { + "type": "keyword" + }, + "type": { + "type": "keyword" + } + } + } + } + }, + "item": { + "properties": { + "id": { + "type": "keyword" + }, + "maxscore": { + "type": "long" + }, + "exlength": { + "type": "long" + }, + "uri": { + "type": "keyword" + }, + "desc": { + "type": "keyword" + }, + "title": { + "type": "keyword" + } + } + }, + "target": { + "properties": { + "id": { + "type": "keyword" + }, + "ver": { + "type": "keyword" + }, + "type": { + "type": "keyword" + }, + "category": { + "type": "keyword" + }, + "parent": { + "properties": { + "id": { + "type": "keyword" + }, + "type": { + "type": "keyword" + } + } + } + } + }, + "visits": { + "type": "nested", + "properties": { + "objid": { + "type": "keyword" + }, + "objtype": { + "type": "keyword" + } + } + }, + "plugin": { + "properties": { + "id": { + "type": "keyword" + }, + "ver": { + "type": "keyword" + }, + "category": { + "type": "keyword" + } + } + }, + "object": { + "properties": { + "id": { + "type": "keyword" + }, + "type": { + "type": "keyword" + }, + "subtype": { + "type": "keyword" + }, + "ver": { + "type": "keyword" + } + } + }, + "uaspec": { + "properties": { + "agent": { + "type": "keyword" + }, + "ver": { + "type": "keyword" + }, + "system": { + "type": "keyword" + }, + "platform": { + "type": "keyword" + }, + "raw": { + "type": "keyword" + } + } + }, + "dspec": { + "properties": { + "camera": { + "type": "keyword" + }, + "cpu": { + "type": "keyword" + }, + "edisk": { + "type": "double" + }, + "id": { + "type": "keyword" + }, + "idisk": { + "type": "double" + }, + "make": { + "type": "keyword" + }, + "mem": { + "type": "double" + }, + "os": { + "type": "keyword" + }, + "scrn": { + "type": "double" + }, + "sims": { + "type": "double" + } + } + } + } + }, + "context": { + "properties": { + "channel": { + "type": "keyword" + }, + "env": { + "type": "keyword" + }, + "sid": { + "type": "keyword" + }, + "did": { + "type": "keyword" + }, + "pdata": { + "properties": { + "id": { + "type": "keyword" + }, + "pid": { + "type": "keyword" + }, + "ver": { + "type": "keyword" + } + } + }, + "rollup": { + "properties": { + "l1": { + "type": "keyword" + }, + "l2": { + "type": "keyword" + }, + "l3": { + "type": "keyword" + }, + "l4": { + "type": "keyword" + } + } + }, + "cdata": { + "type": "nested", + "properties": { + "type": { + "type": "keyword" + }, + "id": { + "type": "keyword" + } + } + } + } + }, + "object": { + "properties": { + "id": { + "type": "keyword" + }, + "type": { + "type": "keyword" + }, + "subtype": { + "type": "keyword" + }, + "parentid": { + "type": "keyword" + }, + "parenttype": { + "type": "keyword" + }, + "ver": { + "type": "keyword" + }, + "rollup": { + "properties": { + "l1": { + "type": "keyword" + }, + "l2": { + "type": "keyword" + }, + "l3": { + "type": "keyword" + }, + "l4": { + "type": "keyword" + } + } + } + } + }, + "metadata": { + "properties": { + "source": { + "type": "keyword" + }, + "index_name": { + "type": "keyword" + }, + "index_type": { + "type": "keyword" + }, + "source_eid": { + "type": "keyword" + }, + "source_mid": { + "type": "keyword" + }, + "pump": { + "type": "keyword" + } + } + }, + "flags": { + "properties": { + "v2_converted": { + "type": "boolean" + }, + "dd_processed": { + "type": "boolean" + }, + "tv_processed": { + "type": "boolean" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/ansible/roles/es7.17/files/templates/cbatch-assessment.json b/ansible/roles/es7.17/files/templates/cbatch-assessment.json new file mode 100644 index 0000000000..0dd91aa4af --- /dev/null +++ b/ansible/roles/es7.17/files/templates/cbatch-assessment.json @@ -0,0 +1,269 @@ +{ + "index_patterns": "cbatch-assessment-*", + "settings": { + "index": { + "number_of_shards": "5", + "analysis": { + "filter": { + "mynGram": { + "token_chars": [ + "letter", + "digit", + "whitespace", + "punctuation", + "symbol" + ], + "min_gram": "1", + "type": "ngram", + "max_gram": "20" + } + }, + "analyzer": { + "cs_index_analyzer": { + "filter": [ + "lowercase", + "mynGram" + ], + "type": "custom", + "tokenizer": "standard" + }, + "keylower": { + "filter": "lowercase", + "type": "custom", + "tokenizer": "keyword" + }, + "cs_search_analyzer": { + "filter": [ + "lowercase", + "standard" + ], + "type": "custom", + "tokenizer": "standard" + } + } + }, + "number_of_replicas": "1" + }, + "blocks": { + "read_only_allow_delete": "false" + } + }, + "mappings": { + "_doc": { + "dynamic": "false", + "properties": { + "all_fields": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower" + } + }, + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "batchId": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "userId": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "courseId": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "contentName": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "externalId": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "districtName": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "maskedEmail": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "maskedPhone": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "userName": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "rootOrgName": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "subOrgName": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "score": { + "type": "text", + "fields": { + "raw": { + "type": "text" + } + } + }, + "totalScore": { + "type": "text", + "fields": { + "raw": { + "type": "text" + } + } + }, + "reportUrl": { + "type": "text", + "fields": { + "raw": { + "type": "text" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/ansible/roles/es7.17/files/templates/cbatchstatsindex.json b/ansible/roles/es7.17/files/templates/cbatchstatsindex.json new file mode 100644 index 0000000000..0af8ac7bed --- /dev/null +++ b/ansible/roles/es7.17/files/templates/cbatchstatsindex.json @@ -0,0 +1,309 @@ +{ + "index_patterns": "cbatchstats-*", + "settings": { + "index": { + "number_of_shards": "5", + "analysis": { + "filter": { + "mynGram": { + "token_chars": [ + "letter", + "digit", + "whitespace", + "punctuation", + "symbol" + ], + "min_gram": "1", + "type": "ngram", + "max_gram": "20" + } + }, + "analyzer": { + "cs_index_analyzer": { + "filter": [ + "lowercase", + "mynGram" + ], + "type": "custom", + "tokenizer": "standard" + }, + "keylower": { + "filter": "lowercase", + "type": "custom", + "tokenizer": "keyword" + }, + "cs_search_analyzer": { + "filter": [ + "lowercase", + "standard" + ], + "type": "custom", + "tokenizer": "standard" + } + } + }, + "number_of_replicas": "1" + }, + "blocks": { + "read_only_allow_delete": "false" + } + }, + "mappings": { + "_doc": { + "dynamic": "false", + "properties": { + "all_fields": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower" + } + }, + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "batchId": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "completedPercent": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "courseId": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "districtName": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "enrolledOn": { + "type": "date", + "fields": { + "raw": { + "type": "date" + } + } + }, + "id": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "lastUpdatedOn": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "maskedEmail": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "maskedPhone": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "name": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "rootOrgName": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "subOrgName": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "userId": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "completedOn": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "blockName": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "externalId": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + } + } + } + } +} \ No newline at end of file diff --git a/ansible/roles/es7.17/files/templates/compositeindex.json b/ansible/roles/es7.17/files/templates/compositeindex.json new file mode 100644 index 0000000000..cd588b8598 --- /dev/null +++ b/ansible/roles/es7.17/files/templates/compositeindex.json @@ -0,0 +1,5112 @@ +{ + "index_patterns": "compositesearch", + "settings": { + "index": { + "max_ngram_diff" : "29", + "analysis": { + "filter": { + "mynGram": { + "token_chars": [ + "letter", + "digit", + "whitespace", + "punctuation", + "symbol" + ], + "min_gram": "1", + "type": "nGram", + "max_gram": "30" + } + }, + "analyzer": { + "cs_index_analyzer": { + "filter": [ + "lowercase", + "mynGram" + ], + "type": "custom", + "tokenizer": "standard" + }, + "keylower": { + "filter": "lowercase", + "tokenizer": "keyword" + }, + "cs_search_analyzer": { + "filter": [ + "standard", + "lowercase" + ], + "type": "custom", + "tokenizer": "standard" + } + } + } + }, + "number_of_shards": 5 + }, + "mappings": { + "cs": { + "dynamic_templates": [ + { + "longs": { + "mapping": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "match_mapping_type": "long" + } + }, + { + "booleans": { + "mapping": { + "type": "boolean", + "fields": { + "raw": { + "type": "boolean" + } + } + }, + "match_mapping_type": "boolean" + } + }, + { + "doubles": { + "mapping": { + "type": "double", + "fields": { + "raw": { + "type": "double" + } + } + }, + "match_mapping_type": "double" + } + }, + { + "dates": { + "mapping": { + "type": "date", + "fields": { + "raw": { + "type": "date" + } + } + }, + "match_mapping_type": "date" + } + }, + { + "strings": { + "mapping": { + "type": "text", + "copy_to": "all_fields", + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + } + }, + "match_mapping_type": "string" + } + }, + { + "nested": { + "mapping": { + "type": "nested", + "fields": { + "type": "nested" + } + }, + "match_mapping_type": "object" + } + } + ], + "properties": { + "Audio": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "IL_FUNC_OBJECT_TYPE": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "IL_INDEXABLE_METADATA_KEY": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "IL_IN_RELATIONS_KEY": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "IL_NON_INDEXABLE_METADATA_KEY": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "IL_OUT_RELATIONS_KEY": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "IL_REQUIRED_PROPERTIES": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "IL_SYSTEM_TAGS_KEY": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "IL_SYS_NODE_TYPE": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "IL_UNIQUE_ID": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "Link": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "RhymingSound": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "SET_OBJECT_TYPE_KEY": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "SET_TYPE": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "TemplateType": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "actions": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "activityType": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "activity_class": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "ageGroup": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "all_fields": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "allowupdate_status": { + "type": "boolean", + "fields": { + "raw": { + "type": "boolean" + } + } + }, + "altIsoSymbol": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "answer": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "antonyms": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "apiId": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "appIcon": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "appIconLabel": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "appId": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "applicability": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "artifactUrl": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "attribution": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "attributions": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "audience": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "author": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "authoringScore": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "averageComplexity": { + "type": "double", + "fields": { + "raw": { + "type": "double" + } + } + }, + "avgGamingTime": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "badgeAssertions": { + "properties": { + "assertionId": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "badgeClassId": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "badgeClassName": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "createdTS": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "issuerId": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + } + } + }, + "baseUrl": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "bloomsTaxonomyLevel": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "board": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "body": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "c_null_open_batch_count": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "c_null_private_batch_count": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "c_test_name_open_batch_count": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "cases": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "categories": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "category": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "categoryinstances": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "channel": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "channels": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "chapterName": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "chapterNumber": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "childNodes": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "children": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "class": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "code": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "collaborators": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "collections": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "communication_scheme": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "compatibilityLevel": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "conceptData": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "conceptIds": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "concepts": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "consumerGroups": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "consumerId": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "contentDisposition": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "contentEncoding": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "contentFilter": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "contentMeta": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "contentType": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "contentTypesCount": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "contents": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "converse": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "copyType": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "copyright": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "cost": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "count_grade_1": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "count_grade_2": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "count_grade_3": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "count_pos_CC": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "count_pos_DEM": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "count_pos_ECH": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "count_pos_INJ": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "count_pos_INTF": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "count_pos_JJ": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "count_pos_NEG": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "count_pos_NN": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "count_pos_NST": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "count_pos_PRP": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "count_pos_PSP": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "count_pos_QC": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "count_pos_QF": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "count_pos_QO": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "count_pos_RB": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "count_pos_RDP": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "count_pos_RP": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "count_pos_VAUX": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "count_pos_VM": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "count_pos_WQ": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "count_source_Karnataka_Govt_Textbooks": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "count_source_Rajasthan_Textbooks": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "count_textbooks": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "createdBy": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "createdFor": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "createdOn": { + "type": "date", + "fields": { + "raw": { + "type": "date", + "format": "strict_date_optional_time||epoch_millis" + } + }, + "format": "strict_date_optional_time||epoch_millis" + }, + "creator": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "curriculum": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "defaultFramework": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "defaultRes": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "description": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "developer": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "dialcodes": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "dimensions": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "domain": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "downloadUrl": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "duration": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "edition": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "editorState": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "ekstepWordnet": { + "type": "boolean", + "fields": { + "raw": { + "type": "boolean" + } + } + }, + "endPoint": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "endsWithAkshara": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "example": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "exampleSentences": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "externalValidation": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "faculty": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "failPopup": { + "type": "boolean", + "fields": { + "raw": { + "type": "boolean" + } + } + }, + "feedback": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "fields": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "filter": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "flagReasons": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "flaggedBy": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "flags": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "follows": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "format": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "foundation": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "framework": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "frameworkId": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "frameworks": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "fw_hierarchy": { + "type": "text", + "index": false + }, + "gender": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "genders": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "genieScore": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "genre": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "gloss": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "grade": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "gradeLevel": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "graph_id": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "grayScaleAppIcon": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "hasAntonyms": { + "type": "boolean", + "fields": { + "raw": { + "type": "boolean" + } + } + }, + "hasConnotative": { + "type": "boolean", + "fields": { + "raw": { + "type": "boolean" + } + } + }, + "hasSynonyms": { + "type": "boolean", + "fields": { + "raw": { + "type": "boolean" + } + } + }, + "hints": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "holonyms": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "hypernyms": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "hyponyms": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "i18n": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "idealScreenDensity": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "idealScreenSize": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "identifier": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "illustrator": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "illustrators": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "image": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "imageCredits": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "index": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "indowordnetId": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "inflections": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "instruction": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "instructions": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "interactivityLevel": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "internalValidation": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "ipaSymbol": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "isConnotative": { + "type": "boolean", + "fields": { + "raw": { + "type": "boolean" + } + } + }, + "isLoanWord": { + "type": "boolean", + "fields": { + "raw": { + "type": "boolean" + } + } + }, + "isPhrase": { + "type": "boolean", + "fields": { + "raw": { + "type": "boolean" + } + } + }, + "isoCode": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "isoSymbol": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "itemType": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "item_sets": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "items": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "keywords": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "keywords_bkp": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "label": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "langid": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "language": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "languageCode": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "languageId": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "languageLevel": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "lastFlaggedOn": { + "type": "date", + "fields": { + "raw": { + "type": "date", + "format": "strict_date_optional_time||epoch_millis" + } + }, + "format": "strict_date_optional_time||epoch_millis" + }, + "lastPublishDate": { + "type": "date", + "fields": { + "raw": { + "type": "date", + "format": "strict_date_optional_time||epoch_millis" + } + }, + "format": "strict_date_optional_time||epoch_millis" + }, + "lastPublishedBy": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "lastPublishedOn": { + "type": "date", + "fields": { + "raw": { + "type": "date", + "format": "strict_date_optional_time||epoch_millis" + } + }, + "format": "strict_date_optional_time||epoch_millis" + }, + "lastSubmittedOn": { + "type": "date", + "fields": { + "raw": { + "type": "date", + "format": "strict_date_optional_time||epoch_millis" + } + }, + "format": "strict_date_optional_time||epoch_millis" + }, + "lastUpdatedBy": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "lastUpdatedOn": { + "type": "date", + "fields": { + "raw": { + "type": "date", + "format": "strict_date_optional_time||epoch_millis" + } + }, + "format": "strict_date_optional_time||epoch_millis" + }, + "launchUrl": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "leafNodesCount": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "learnerLevel": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "learningObjective": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "lemma": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "level": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "lhs_options": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "license": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "limit": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "liveWords": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "material": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "maxChainLength": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "maxWords": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "max_score": { + "type": "double", + "fields": { + "raw": { + "type": "double" + } + } + }, + "me_audiosCount": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "me_averageInteractionsPerMin": { + "type": "double", + "fields": { + "raw": { + "type": "double" + } + } + }, + "me_averageRating": { + "type": "double", + "fields": { + "raw": { + "type": "double" + } + } + }, + "me_averageSessionsPerDevice": { + "type": "double", + "fields": { + "raw": { + "type": "double" + } + } + }, + "me_averageTimespentPerSession": { + "type": "double", + "fields": { + "raw": { + "type": "double" + } + } + }, + "me_avgCreationTsPerSession": { + "type": "double", + "fields": { + "raw": { + "type": "double" + } + } + }, + "me_creationSessions": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "me_creationTimespent": { + "type": "double", + "fields": { + "raw": { + "type": "double" + } + } + }, + "me_imagesCount": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "me_timespentDraft": { + "type": "double", + "fields": { + "raw": { + "type": "double" + } + } + }, + "me_timespentReview": { + "type": "double", + "fields": { + "raw": { + "type": "double" + } + } + }, + "me_totalComments": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "me_totalDevices": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "me_totalDownloads": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "me_totalInteractions": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "me_totalRatings": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "me_totalSessionsCount": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "me_totalSideloads": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "me_totalTimespent": { + "type": "double", + "fields": { + "raw": { + "type": "double" + } + } + }, + "me_videosCount": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "meaning": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "media": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "mediaType": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "mediatype": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "medium": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "meronyms": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "method": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "methods": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "mimeType": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "mimeTypesCount": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "minChainLength": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "model": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "model_sample": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "morphology": { + "type": "boolean", + "fields": { + "raw": { + "type": "boolean" + } + } + }, + "name": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "nodeType": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "node_id": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "notes": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "num_answers": { + "type": "double", + "fields": { + "raw": { + "type": "double" + } + } + }, + "objectType": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "objects": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "objectsUsed": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "occurrenceCount": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "oldContentBody": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "optStatus": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "options": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "organization": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "origin": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "orthographic_complexity": { + "type": "double", + "fields": { + "raw": { + "type": "double" + } + } + }, + "os": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "osId": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "owner": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "pageNumber": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "parent": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "partial_scoring": { + "type": "boolean", + "fields": { + "raw": { + "type": "boolean" + } + } + }, + "person": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "phonologic_complexity": { + "type": "double", + "fields": { + "raw": { + "type": "double" + } + } + }, + "pictures": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "pkgVersion": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "plurality": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "popularity": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "portalOwner": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "pos": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "posTags": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "pos_categories": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "posterImage": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "pragma": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "prevState": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "previewUrl": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "primaryMeaning": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "primaryMeaningId": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "product": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "pronunciations": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "publication": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "publishError": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "publish_type": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "publisher": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "purpose": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "qid": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "qlevel": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "qtype": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "question": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "questionImage": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "question_audio": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "question_count": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "question_image": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "references": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "renderingHints": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "resourceType": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "resources": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "responses": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "rhs_options": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "rownum": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "ruleId": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "ruleObjectType": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "ruleScript": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "s3Key": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "SYS_INTERNAL_LAST_UPDATED_ON": { + "type": "date", + "fields": { + "raw": { + "type": "date", + "format": "strict_date_optional_time||epoch_millis" + } + }, + "format": "strict_date_optional_time||epoch_millis" + }, + "sampleUsages": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "savingPopup": { + "type": "boolean", + "fields": { + "raw": { + "type": "boolean" + } + } + }, + "screenshots": { + "type": "text", + "index": false + }, + "semanticVersion": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "showNotification": { + "type": "boolean", + "fields": { + "raw": { + "type": "boolean" + } + } + }, + "shuffle": { + "type": "boolean", + "fields": { + "raw": { + "type": "boolean" + } + } + }, + "size": { + "type": "double", + "fields": { + "raw": { + "type": "double" + } + } + }, + "skills": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "softConstraints": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "soundCredits": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "source": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "sourceTypes": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "sources": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "startWordsSize": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "startsWithAkshara": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "state": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "status": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "strict_sequencing": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "subject": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "sublevel": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "successPopup": { + "type": "boolean", + "fields": { + "raw": { + "type": "boolean" + } + } + }, + "syllableCount": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "syllableNotation": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "syllables": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "synonyms": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "synsetCount": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "synsets": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "tags": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "tempData": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "template": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "templateName": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "templateType": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "template_id": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "terms": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "text": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "textbookName": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "theme": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "themes": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "thumbnail": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "title": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "toc_url": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "tools": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "totalGamingTime": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "total_items": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "translations": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "ttl": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "tutor": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "type": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "unicode": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "unicodeNotation": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "usedByContent": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "used_for": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "usesContent": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "variants": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "varna": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "version": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "versionCheckMode": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "versionKey": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "visibility": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "voiceCredits": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "vowel": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "weightages": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "wordImages": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "wordListIds": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "wordLists": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "word_complexity": { + "type": "double", + "fields": { + "raw": { + "type": "double" + } + } + }, + "words": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "wordsets": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "workers": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "year": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + } + } + } + } +} diff --git a/ansible/roles/es7.17/files/templates/dialcode.json b/ansible/roles/es7.17/files/templates/dialcode.json new file mode 100644 index 0000000000..12e600ad94 --- /dev/null +++ b/ansible/roles/es7.17/files/templates/dialcode.json @@ -0,0 +1,269 @@ +{ + "index_patterns": "dialcode", + "settings": { + "index": { + "analysis": { + "filter": { + "mynGram": { + "token_chars": [ + "letter", + "digit", + "whitespace", + "punctuation", + "symbol" + ], + "min_gram": "1", + "type": "nGram", + "max_gram": "20" + } + }, + "analyzer": { + "dc_search_analyzer": { + "filter": [ + "standard", + "lowercase" + ], + "type": "custom", + "tokenizer": "standard" + }, + "dc_index_analyzer": { + "filter": [ + "lowercase", + "mynGram" + ], + "type": "custom", + "tokenizer": "standard" + }, + "keylower": { + "filter": "lowercase", + "tokenizer": "keyword" + } + } + } + }, + "number_of_shards": 5 + }, + "mappings": { + "dc": { + "dynamic_templates": [ + { + "longs": { + "mapping": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "match_mapping_type": "long" + } + }, + { + "booleans": { + "mapping": { + "type": "boolean", + "fields": { + "raw": { + "type": "boolean" + } + } + }, + "match_mapping_type": "boolean" + } + }, + { + "doubles": { + "mapping": { + "type": "double", + "fields": { + "raw": { + "type": "double" + } + } + }, + "match_mapping_type": "double" + } + }, + { + "dates": { + "mapping": { + "type": "date", + "fields": { + "raw": { + "type": "date" + } + } + }, + "match_mapping_type": "date" + } + }, + { + "strings": { + "mapping": { + "type": "text", + "copy_to": "all_fields", + "analyzer": "dc_index_analyzer", + "search_analyzer": "dc_search_analyzer", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + } + }, + "match_mapping_type": "string" + } + } + ], + "properties": { + "all_fields": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "analyzer": "dc_index_analyzer", + "search_analyzer": "dc_search_analyzer" + }, + "batchCode": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "dc_index_analyzer", + "search_analyzer": "dc_search_analyzer" + }, + "batchcode": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "dc_index_analyzer", + "search_analyzer": "dc_search_analyzer" + }, + "channel": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "dc_index_analyzer", + "search_analyzer": "dc_search_analyzer" + }, + "dialcode_index": { + "type": "double", + "fields": { + "raw": { + "type": "double" + } + } + }, + "generated_on": { + "type": "date", + "fields": { + "raw": { + "type": "date", + "format": "strict_date_optional_time||epoch_millis" + } + }, + "format": "strict_date_optional_time||epoch_millis" + }, + "identifier": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "dc_index_analyzer", + "search_analyzer": "dc_search_analyzer" + }, + "objectType": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "dc_index_analyzer", + "search_analyzer": "dc_search_analyzer" + }, + "published_on": { + "type": "date", + "fields": { + "raw": { + "type": "date", + "format": "strict_date_optional_time||epoch_millis" + } + }, + "format": "strict_date_optional_time||epoch_millis" + }, + "publisher": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "dc_index_analyzer", + "search_analyzer": "dc_search_analyzer" + }, + "status": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "dc_index_analyzer", + "search_analyzer": "dc_search_analyzer" + } + } + } + } +} \ No newline at end of file diff --git a/ansible/roles/es7.17/files/templates/failed-telemetry.json b/ansible/roles/es7.17/files/templates/failed-telemetry.json new file mode 100644 index 0000000000..5d474e7231 --- /dev/null +++ b/ansible/roles/es7.17/files/templates/failed-telemetry.json @@ -0,0 +1,106 @@ +{ + "index_patterns" : "failed-telemetry-*", + "settings" : { + "number_of_shards" : 5 + }, + "mappings" : { + "events" : { + "dynamic": false, + "properties": { + "@timestamp": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "@version": { + "type": "keyword" + }, + "channel": { + "type": "keyword" + }, + "eid": { + "type": "keyword" + }, + "ets": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "mid": { + "type": "keyword" + }, + "ts": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "metadata": { + "properties": { + "source": { + "type": "keyword" + }, + "index_name": { + "type": "keyword" + }, + "index_type": { + "type": "keyword" + } + } + }, + "context": { + "properties": { + "channel": { + "type": "keyword" + }, + "env": { + "type": "keyword" + }, + "sid": { + "type": "keyword" + }, + "did": { + "type": "keyword" + }, + "pdata": { + "properties": { + "id": { + "type": "keyword" + }, + "pid": { + "type": "keyword" + }, + "ver": { + "type": "keyword" + } + } + }, + "rollup": { + "properties": { + "l1": { + "type": "keyword" + }, + "l2": { + "type": "keyword" + }, + "l3": { + "type": "keyword" + }, + "l4": { + "type": "keyword" + } + } + }, + "cdata": { + "type": "nested", + "properties": { + "type": { + "type": "keyword" + }, + "id": { + "type": "keyword" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/ansible/roles/es7.17/files/templates/lp_audit_log.json b/ansible/roles/es7.17/files/templates/lp_audit_log.json new file mode 100644 index 0000000000..b33cf788b0 --- /dev/null +++ b/ansible/roles/es7.17/files/templates/lp_audit_log.json @@ -0,0 +1,314 @@ +{ + "index_patterns": "lp_audit_log", + "settings": { + "index": { + "analysis": { + "filter": { + "mynGram": { + "token_chars": [ + "letter", + "digit", + "whitespace", + "punctuation", + "symbol" + ], + "min_gram": "1", + "type": "nGram", + "max_gram": "20" + } + }, + "analyzer": { + "ah_search_analyzer": { + "filter": [ + "standard", + "lowercase" + ], + "type": "custom", + "tokenizer": "standard" + }, + "keylower": { + "filter": "lowercase", + "tokenizer": "keyword" + }, + "ah_index_analyzer": { + "filter": [ + "lowercase", + "mynGram" + ], + "type": "custom", + "tokenizer": "standard" + } + } + } + }, + "number_of_shards": 5 + }, + "mappings": { + "ah": { + "dynamic_templates": [ + { + "longs": { + "mapping": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "match_mapping_type": "long" + } + }, + { + "booleans": { + "mapping": { + "type": "boolean", + "fields": { + "raw": { + "type": "boolean" + } + } + }, + "match_mapping_type": "boolean" + } + }, + { + "doubles": { + "mapping": { + "type": "double", + "fields": { + "raw": { + "type": "double" + } + } + }, + "match_mapping_type": "double" + } + }, + { + "dates": { + "mapping": { + "type": "date", + "fields": { + "raw": { + "type": "date" + } + } + }, + "match_mapping_type": "date" + } + }, + { + "strings": { + "mapping": { + "type": "text", + "copy_to": "all_fields", + "analyzer": "ah_index_analyzer", + "search_analyzer": "ah_search_analyzer", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + } + }, + "match_mapping_type": "string" + } + } + ], + "properties": { + "@timestamp": { + "type": "date", + "fields": { + "raw": { + "type": "date", + "format": "strict_date_optional_time||epoch_millis" + } + }, + "format": "strict_date_optional_time||epoch_millis" + }, + "@version": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "ah_index_analyzer", + "search_analyzer": "ah_search_analyzer" + }, + "all_fields": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "analyzer": "ah_index_analyzer", + "search_analyzer": "ah_search_analyzer" + }, + "audit_id": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "createdOn": { + "type": "date", + "fields": { + "raw": { + "type": "date", + "format": "strict_date_optional_time||epoch_millis" + } + }, + "format": "strict_date_optional_time||epoch_millis" + }, + "graphId": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "ah_index_analyzer", + "search_analyzer": "ah_search_analyzer" + }, + "label": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "ah_index_analyzer", + "search_analyzer": "ah_search_analyzer" + }, + "logRecord": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "ah_index_analyzer", + "search_analyzer": "ah_search_analyzer" + }, + "objectId": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "ah_index_analyzer", + "search_analyzer": "ah_search_analyzer" + }, + "objectType": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "ah_index_analyzer", + "search_analyzer": "ah_search_analyzer" + }, + "operation": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "ah_index_analyzer", + "search_analyzer": "ah_search_analyzer" + }, + "requestId": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "ah_index_analyzer", + "search_analyzer": "ah_search_analyzer" + }, + "summary": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "ah_index_analyzer", + "search_analyzer": "ah_search_analyzer" + }, + "userId": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "ah_index_analyzer", + "search_analyzer": "ah_search_analyzer" + } + } + } + } +} diff --git a/ansible/roles/es7.17/files/templates/suggestionindex.json b/ansible/roles/es7.17/files/templates/suggestionindex.json new file mode 100644 index 0000000000..cb32559b1b --- /dev/null +++ b/ansible/roles/es7.17/files/templates/suggestionindex.json @@ -0,0 +1,784 @@ +{ + "index_patterns": "lp_suggestion_index_v1", + "settings": { + "index": { + "analysis": { + "filter": { + "mynGram": { + "token_chars": [ + "letter", + "digit", + "whitespace", + "punctuation", + "symbol" + ], + "min_gram": "1", + "type": "nGram", + "max_gram": "20" + } + }, + "analyzer": { + "keylower": { + "filter": "lowercase", + "tokenizer": "keyword" + }, + "sg_index_analyzer": { + "filter": [ + "lowercase", + "mynGram" + ], + "type": "custom", + "tokenizer": "standard" + }, + "sg_search_analyzer": { + "filter": [ + "standard", + "lowercase" + ], + "type": "custom", + "tokenizer": "standard" + } + } + } + }, + "number_of_shards": 5 + }, + "aliases": { + "lp_suggestion_index_alias": {} + }, + "mappings": { + "sg": { + "dynamic_templates": [ + { + "longs": { + "mapping": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "match_mapping_type": "long" + } + }, + { + "booleans": { + "mapping": { + "type": "boolean", + "fields": { + "raw": { + "type": "boolean" + } + } + }, + "match_mapping_type": "boolean" + } + }, + { + "doubles": { + "mapping": { + "type": "double", + "fields": { + "raw": { + "type": "double" + } + } + }, + "match_mapping_type": "double" + } + }, + { + "dates": { + "mapping": { + "type": "date", + "fields": { + "raw": { + "type": "date" + } + } + }, + "match_mapping_type": "date" + } + }, + { + "strings": { + "mapping": { + "copy_to": "all_fields", + "search_analyzer": "sg_search_analyzer", + "analyzer": "sg_index_analyzer", + "type": "text", + "fields": { + "raw": { + "analyzer": "keylower", + "type": "text", + "fielddata": true + } + } + }, + "match_mapping_type": "string" + } + } + ], + "properties": { + "all_fields": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "command": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "comment": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "comments": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "createdOn": { + "type": "date", + "fields": { + "raw": { + "type": "date", + "format": "strict_date_optional_time||epoch_millis" + } + }, + "format": "strict_date_optional_time||epoch_millis" + }, + "es_metadata_id": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "lastUpdatedBy": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "objectId": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "objectType": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "params": { + "properties": { + "Language": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "ageGroup": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "ageGrups": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "attributions": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "audience": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "code": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "concepts": { + "properties": { + "description": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "identifier": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "name": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "objectType": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "relation": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "relationName": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + } + } + }, + "description": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "domain": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "domains": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "genre": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "gradeLevel": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "language": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "medium": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "methods": { + "properties": { + "description": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "identifier": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "name": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "objectType": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "relation": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "relationName": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + } + } + }, + "name": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "subject": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "tags": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "templateType": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + } + } + }, + "request": { + "properties": { + "content": { + "properties": { + "comments": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "status": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + } + } + } + } + }, + "status": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "suggestedBy": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + }, + "suggestion_id": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "sg_index_analyzer", + "search_analyzer": "sg_search_analyzer" + } + } + } + } +} \ No newline at end of file diff --git a/ansible/roles/es7.17/files/templates/summary.json b/ansible/roles/es7.17/files/templates/summary.json new file mode 100644 index 0000000000..016f450b7e --- /dev/null +++ b/ansible/roles/es7.17/files/templates/summary.json @@ -0,0 +1,802 @@ +{ + "index_patterns": "summary-*", + "settings": { + "number_of_shards": 5 + }, + "mappings": { + "events": { + "dynamic": false, + "properties": { + "eid": { + "type": "keyword" + }, + "ets": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "mid": { + "type": "keyword" + }, + "uid": { + "type": "keyword" + }, + "ts": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "syncts": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "ver": { + "type": "keyword" + }, + "channel": { + "type": "keyword" + }, + "context":{ + "properties": { + "pdata": { + "properties": { + "id": { + "type": "keyword" + }, + "model": { + "type": "keyword" + }, + "ver": { + "type": "keyword" + } + } + }, + "granularity": { + "type": "keyword" + }, + "date_range": { + "properties": { + "from": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "to": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + } + } + } + } + }, + "dimensions": { + "properties": { + "did": { + "type": "keyword" + }, + "pdata": { + "properties": { + "id": { + "type": "keyword" + }, + "pid": { + "type": "keyword" + }, + "ver": { + "type": "keyword" + } + } + }, + "gdata": { + "properties": { + "id": { + "type": "keyword" + }, + "ver": { + "type": "keyword" + } + } + }, + "sid": { + "type": "keyword" + }, + "channel": { + "type": "keyword" + }, + "group_user": { + "type": "boolean" + }, + "anonymous_user": { + "type": "boolean" + }, + "uid": { + "type": "keyword" + }, + "ss_mid": { + "type": "keyword" + }, + "tag": { + "type": "keyword" + }, + "period": { + "type": "integer" + }, + "content_id": { + "type": "keyword" + }, + "item_id": { + "type": "keyword" + }, + "author_id": { + "type": "keyword" + }, + "loc": { + "type": "keyword" + }, + "type": { + "type": "keyword" + }, + "mode": { + "type": "keyword" + }, + "context_rollup": { + "properties": { + "l1": { + "type": "keyword" + }, + "l2": { + "type": "keyword" + }, + "l3": { + "type": "keyword" + }, + "l4": { + "type": "keyword" + } + } + }, + "object_rollup": { + "properties": { + "l1": { + "type": "keyword" + }, + "l2": { + "type": "keyword" + }, + "l3": { + "type": "keyword" + }, + "l4": { + "type": "keyword" + } + } + } + } + }, + "edata": { + "properties": { + "eks": { + "properties": { + "total_users_count": { + "type": "long" + }, + "total_devices_count": { + "type": "long" + }, + "total_content_count": { + "type": "long" + }, + "content_ids": { + "type": "keyword" + }, + "device_ids": { + "type": "keyword" + }, + "user_ids": { + "type": "keyword" + }, + "contents": { + "type": "keyword" + }, + "unique_users": { + "type": "keyword" + }, + "avg_ts_session": { + "type": "double" + }, + "total_sessions": { + "type": "long" + }, + "avg_interactions_min": { + "type": "double" + }, + "total_interactions": { + "type": "long" + }, + "avg_pageviews": { + "type": "double" + }, + "total_ts": { + "type": "double" + }, + "time_diff": { + "type": "double" + }, + "time_spent": { + "type": "double" + }, + "interact_events_per_min": { + "type": "double" + }, + "interact_events_count": { + "type": "long" + }, + "total_pageviews_count": { + "type": "long" + }, + "page_views_count": { + "type": "long" + }, + "ce_visits": { + "type": "long" + }, + "start_time": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "end_time": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "syncDate": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "timeSpent": { + "type": "double" + }, + "interactEventsPerMin": { + "type": "double" + }, + "mimeType": { + "type": "keyword" + }, + "contentType": { + "type": "keyword" + }, + "timeDiff": { + "type": "double" + }, + "mode": { + "type": "keyword" + }, + "telemetryVersion": { + "type": "keyword" + }, + "noOfInteractEvents": { + "type": "long" + }, + "interruptTime": { + "type": "double" + }, + "contentCount": { + "type": "long" + }, + "content": { + "type": "keyword" + }, + "time_stamp": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "first_visit": { + "type": "boolean" + }, + "noOfAttempts": { + "type": "integer" + }, + "m_side_loads": { + "type": "integer" + }, + "m_downloads": { + "type": "integer" + }, + "m_avg_rating": { + "type": "double" + }, + "m_ratings": { + "type": "nested", + "properties": { + "rating": { + "type": "integer" + }, + "time": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + } + } + }, + "m_comments": { + "type": "object" + }, + "ce_total_ts": { + "type": "double" + }, + "ce_percent_sessions": { + "type": "double" + }, + "ce_visits_count": { + "type": "long" + }, + "ce_total_visits": { + "type": "long" + }, + "ce_percent_ts": { + "type": "double" + }, + "avg_ts": { + "type": "double" + }, + "inc_res_count": { + "type": "long" + }, + "incorrect_res": { + "type": "nested", + "properties": { + "resp": { + "type": "keyword" + }, + "mmc": { + "type": "keyword" + }, + "count": { + "type": "long" + } + } + }, + "total_count": { + "type": "long" + }, + "correct_res_count": { + "type": "long" + }, + "correct_res": { + "type": "keyword" + }, + "itemId": { + "type": "keyword" + }, + "exTimeSpent": { + "type": "double" + }, + "score": { + "type": "integer" + }, + "pass": { + "type": "keyword" + }, + "qtitle": { + "type": "keyword" + }, + "qdesc": { + "type": "keyword" + }, + "new_user_count": { + "type": "long" + }, + "anon_total_sessions": { + "type": "long" + }, + "anon_total_ts": { + "type": "double" + }, + "anon_avg_ts_session": { + "type": "double" + }, + "percent_new_users_count": { + "type": "double" + }, + "ce_total_sessions": { + "type": "long" + }, + "unique_users_count": { + "type": "long" + }, + "stageVisitCount": { + "type": "long" + }, + "interactEventsCount": { + "type": "long" + }, + "interactEvents": { + "type": "nested", + "properties": { + "type": { + "type": "keyword" + }, + "subtype": { + "type": "keyword" + } + } + }, + "stageId": { + "type": "keyword" + }, + "visitCount": { + "type": "long" + }, + "num_downloads": { + "type": "long" + }, + "num_sideloads": { + "type": "long" + }, + "avg_depth": { + "type": "double" + }, + "publish_pipeline_summary": { + "type": "nested", + "properties": { + "type": { + "type": "keyword" + }, + "state": { + "type": "keyword" + }, + "subtype": { + "type": "keyword" + }, + "count": { + "type": "long" + } + } + }, + "events_summary": { + "type": "nested", + "properties": { + "id": { + "type": "keyword" + }, + "count": { + "type": "long" + } + } + }, + "eventsSummary": { + "type": "nested", + "properties": { + "id": { + "type": "keyword" + }, + "count": { + "type": "long" + } + } + }, + "screenSummary": { + "type": "nested", + "properties": { + "id": { + "type": "keyword" + }, + "timeSpent": { + "type": "double" + }, + "visitCount": { + "type": "long" + } + } + }, + "activitySummary": { + "type": "nested", + "properties": { + "actType": { + "type": "keyword" + }, + "timeSpent": { + "type": "double" + }, + "count": { + "type": "long" + } + } + }, + "page_summary": { + "type": "nested", + "properties": { + "id": { + "type": "keyword" + }, + "type": { + "type": "keyword" + }, + "env": { + "type": "keyword" + }, + "time_spent": { + "type": "double" + }, + "visit_count": { + "type": "long" + } + } + }, + "env_summary": { + "type": "nested", + "properties": { + "env": { + "type": "keyword" + }, + "time_spent": { + "type": "double" + }, + "count": { + "type": "long" + } + } + }, + "itemResponses": { + "type": "nested", + "properties": { + "itemId": { + "type": "keyword" + }, + "timeSpent": { + "type": "double" + }, + "exTimeSpent": { + "type": "double" + }, + "score": { + "type": "integer" + }, + "time_stamp": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "pass": { + "type": "keyword" + }, + "qtitle": { + "type": "keyword" + }, + "qdesc": { + "type": "keyword" + } + } + } + } + } + } + }, + "etags": { + "properties": { + "app": { + "type": "keyword" + }, + "partner": { + "type": "keyword" + }, + "dims": { + "type": "keyword" + } + } + }, + "geoip": { + "properties": { + "location": { + "type": "geo_point" + } + }, + "type": "object" + }, + "contentdata": { + "properties": { + "ageGroup": { + "type": "keyword" + }, + "author": { + "type": "keyword" + }, + "audience": { + "type": "keyword" + }, + "code": { + "type": "keyword" + }, + "collaborators": { + "type": "keyword" + }, + "collections": { + "type": "keyword" + }, + "concepts": { + "type": "keyword" + }, + "contentType": { + "type": "keyword" + }, + "curriculum": { + "type": "keyword" + }, + "developer": { + "type": "keyword" + }, + "domain": { + "type": "keyword" + }, + "downloadUrl": { + "type": "keyword" + }, + "downloads": { + "type": "long" + }, + "edition": { + "type": "keyword" + }, + "genre": { + "type": "keyword" + }, + "gradeLevel": { + "type": "keyword" + }, + "keywords": { + "type": "keyword" + }, + "me_totalDevices": { + "type": "long" + }, + "me_totalDownloads": { + "type": "long" + }, + "me_totalInteractions": { + "type": "long" + }, + "me_totalRatings": { + "type": "long" + }, + "me_totalSessionsCount": { + "type": "long" + }, + "me_totalSideloads": { + "type": "long" + }, + "me_totalTimespent": { + "type": "long" + }, + "me_totalUsage": { + "type": "long" + }, + "medium": { + "type": "keyword" + }, + "methods": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "owner": { + "type": "keyword" + }, + "popularity": { + "type": "long" + }, + "portalOwner": { + "type": "keyword" + }, + "publication": { + "type": "keyword" + }, + "publisher": { + "type": "keyword" + }, + "rating": { + "type": "long" + }, + "size": { + "type": "long" + }, + "source": { + "type": "keyword" + }, + "status": { + "type": "keyword" + }, + "subject": { + "type": "keyword" + }, + "templateType": { + "type": "keyword" + }, + "theme": { + "type": "keyword" + }, + "words": { + "type": "keyword" + } + } + }, + "itemdata": { + "properties": { + "concepts": { + "type": "keyword" + }, + "createdBy": { + "type": "keyword" + }, + "createdOn": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "keywords": { + "type": "keyword" + }, + "language": { + "type": "keyword" + }, + "lastUpdatedBy": { + "type": "keyword" + }, + "lastUpdatedOn": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "media": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "num_answers": { + "type": "long" + }, + "owner": { + "type": "keyword" + }, + "qlevel": { + "type": "keyword" + }, + "question": { + "type": "keyword" + }, + "source": { + "type": "keyword" + }, + "status": { + "type": "keyword" + }, + "template": { + "type": "keyword" + }, + "title": { + "type": "keyword" + }, + "type": { + "type": "keyword" + }, + "version": { + "type": "long" + } + } + }, + "ldata": { + "properties": { + "country": { + "type": "keyword" + }, + "state": { + "type": "keyword" + }, + "district": { + "type": "keyword" + }, + "city": { + "type": "keyword" + } + } + }, + "@version": { + "type": "keyword" + } + } + } + } +} diff --git a/ansible/roles/es7.17/files/templates/summary_cumulative.json b/ansible/roles/es7.17/files/templates/summary_cumulative.json new file mode 100644 index 0000000000..99e01b8bdf --- /dev/null +++ b/ansible/roles/es7.17/files/templates/summary_cumulative.json @@ -0,0 +1,802 @@ +{ + "index_patterns": "summary-cumulative-*", + "settings": { + "number_of_shards": 5 + }, + "mappings": { + "events": { + "dynamic": false, + "properties": { + "eid": { + "type": "keyword" + }, + "ets": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "mid": { + "type": "keyword" + }, + "uid": { + "type": "keyword" + }, + "ts": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "syncts": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "ver": { + "type": "keyword" + }, + "channel": { + "type": "keyword" + }, + "context":{ + "properties": { + "pdata": { + "properties": { + "id": { + "type": "keyword" + }, + "model": { + "type": "keyword" + }, + "ver": { + "type": "keyword" + } + } + }, + "granularity": { + "type": "keyword" + }, + "date_range": { + "properties": { + "from": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "to": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + } + } + } + } + }, + "dimensions": { + "properties": { + "did": { + "type": "keyword" + }, + "pdata": { + "properties": { + "id": { + "type": "keyword" + }, + "pid": { + "type": "keyword" + }, + "ver": { + "type": "keyword" + } + } + }, + "gdata": { + "properties": { + "id": { + "type": "keyword" + }, + "ver": { + "type": "keyword" + } + } + }, + "sid": { + "type": "keyword" + }, + "channel": { + "type": "keyword" + }, + "group_user": { + "type": "boolean" + }, + "anonymous_user": { + "type": "boolean" + }, + "uid": { + "type": "keyword" + }, + "ss_mid": { + "type": "keyword" + }, + "tag": { + "type": "keyword" + }, + "period": { + "type": "integer" + }, + "content_id": { + "type": "keyword" + }, + "item_id": { + "type": "keyword" + }, + "author_id": { + "type": "keyword" + }, + "loc": { + "type": "keyword" + }, + "type": { + "type": "keyword" + }, + "mode": { + "type": "keyword" + }, + "context_rollup": { + "properties": { + "l1": { + "type": "keyword" + }, + "l2": { + "type": "keyword" + }, + "l3": { + "type": "keyword" + }, + "l4": { + "type": "keyword" + } + } + }, + "object_rollup": { + "properties": { + "l1": { + "type": "keyword" + }, + "l2": { + "type": "keyword" + }, + "l3": { + "type": "keyword" + }, + "l4": { + "type": "keyword" + } + } + } + } + }, + "edata": { + "properties": { + "eks": { + "properties": { + "total_users_count": { + "type": "long" + }, + "total_devices_count": { + "type": "long" + }, + "total_content_count": { + "type": "long" + }, + "content_ids": { + "type": "keyword" + }, + "device_ids": { + "type": "keyword" + }, + "user_ids": { + "type": "keyword" + }, + "contents": { + "type": "keyword" + }, + "unique_users": { + "type": "keyword" + }, + "avg_ts_session": { + "type": "double" + }, + "total_sessions": { + "type": "long" + }, + "avg_interactions_min": { + "type": "double" + }, + "total_interactions": { + "type": "long" + }, + "avg_pageviews": { + "type": "double" + }, + "total_ts": { + "type": "double" + }, + "time_diff": { + "type": "double" + }, + "time_spent": { + "type": "double" + }, + "interact_events_per_min": { + "type": "double" + }, + "interact_events_count": { + "type": "long" + }, + "total_pageviews_count": { + "type": "long" + }, + "page_views_count": { + "type": "long" + }, + "ce_visits": { + "type": "long" + }, + "start_time": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "end_time": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "syncDate": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "timeSpent": { + "type": "double" + }, + "interactEventsPerMin": { + "type": "double" + }, + "mimeType": { + "type": "keyword" + }, + "contentType": { + "type": "keyword" + }, + "timeDiff": { + "type": "double" + }, + "mode": { + "type": "keyword" + }, + "telemetryVersion": { + "type": "keyword" + }, + "noOfInteractEvents": { + "type": "long" + }, + "interruptTime": { + "type": "double" + }, + "contentCount": { + "type": "long" + }, + "content": { + "type": "keyword" + }, + "time_stamp": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "first_visit": { + "type": "boolean" + }, + "noOfAttempts": { + "type": "integer" + }, + "m_side_loads": { + "type": "integer" + }, + "m_downloads": { + "type": "integer" + }, + "m_avg_rating": { + "type": "double" + }, + "m_ratings": { + "type": "nested", + "properties": { + "rating": { + "type": "integer" + }, + "time": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + } + } + }, + "m_comments": { + "type": "object" + }, + "ce_total_ts": { + "type": "double" + }, + "ce_percent_sessions": { + "type": "double" + }, + "ce_visits_count": { + "type": "long" + }, + "ce_total_visits": { + "type": "long" + }, + "ce_percent_ts": { + "type": "double" + }, + "avg_ts": { + "type": "double" + }, + "inc_res_count": { + "type": "long" + }, + "incorrect_res": { + "type": "nested", + "properties": { + "resp": { + "type": "keyword" + }, + "mmc": { + "type": "keyword" + }, + "count": { + "type": "long" + } + } + }, + "total_count": { + "type": "long" + }, + "correct_res_count": { + "type": "long" + }, + "correct_res": { + "type": "keyword" + }, + "itemId": { + "type": "keyword" + }, + "exTimeSpent": { + "type": "double" + }, + "score": { + "type": "integer" + }, + "pass": { + "type": "keyword" + }, + "qtitle": { + "type": "keyword" + }, + "qdesc": { + "type": "keyword" + }, + "new_user_count": { + "type": "long" + }, + "anon_total_sessions": { + "type": "long" + }, + "anon_total_ts": { + "type": "double" + }, + "anon_avg_ts_session": { + "type": "double" + }, + "percent_new_users_count": { + "type": "double" + }, + "ce_total_sessions": { + "type": "long" + }, + "unique_users_count": { + "type": "long" + }, + "stageVisitCount": { + "type": "long" + }, + "interactEventsCount": { + "type": "long" + }, + "interactEvents": { + "type": "nested", + "properties": { + "type": { + "type": "keyword" + }, + "subtype": { + "type": "keyword" + } + } + }, + "stageId": { + "type": "keyword" + }, + "visitCount": { + "type": "long" + }, + "num_downloads": { + "type": "long" + }, + "num_sideloads": { + "type": "long" + }, + "avg_depth": { + "type": "double" + }, + "publish_pipeline_summary": { + "type": "nested", + "properties": { + "type": { + "type": "keyword" + }, + "state": { + "type": "keyword" + }, + "subtype": { + "type": "keyword" + }, + "count": { + "type": "long" + } + } + }, + "events_summary": { + "type": "nested", + "properties": { + "id": { + "type": "keyword" + }, + "count": { + "type": "long" + } + } + }, + "eventsSummary": { + "type": "nested", + "properties": { + "id": { + "type": "keyword" + }, + "count": { + "type": "long" + } + } + }, + "screenSummary": { + "type": "nested", + "properties": { + "id": { + "type": "keyword" + }, + "timeSpent": { + "type": "double" + }, + "visitCount": { + "type": "long" + } + } + }, + "activitySummary": { + "type": "nested", + "properties": { + "actType": { + "type": "keyword" + }, + "timeSpent": { + "type": "double" + }, + "count": { + "type": "long" + } + } + }, + "page_summary": { + "type": "nested", + "properties": { + "id": { + "type": "keyword" + }, + "type": { + "type": "keyword" + }, + "env": { + "type": "keyword" + }, + "time_spent": { + "type": "double" + }, + "visit_count": { + "type": "long" + } + } + }, + "env_summary": { + "type": "nested", + "properties": { + "env": { + "type": "keyword" + }, + "time_spent": { + "type": "double" + }, + "count": { + "type": "long" + } + } + }, + "itemResponses": { + "type": "nested", + "properties": { + "itemId": { + "type": "keyword" + }, + "timeSpent": { + "type": "double" + }, + "exTimeSpent": { + "type": "double" + }, + "score": { + "type": "integer" + }, + "time_stamp": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "pass": { + "type": "keyword" + }, + "qtitle": { + "type": "keyword" + }, + "qdesc": { + "type": "keyword" + } + } + } + } + } + } + }, + "etags": { + "properties": { + "app": { + "type": "keyword" + }, + "partner": { + "type": "keyword" + }, + "dims": { + "type": "keyword" + } + } + }, + "geoip": { + "properties": { + "location": { + "type": "geo_point" + } + }, + "type": "object" + }, + "contentdata": { + "properties": { + "ageGroup": { + "type": "keyword" + }, + "author": { + "type": "keyword" + }, + "audience": { + "type": "keyword" + }, + "code": { + "type": "keyword" + }, + "collaborators": { + "type": "keyword" + }, + "collections": { + "type": "keyword" + }, + "concepts": { + "type": "keyword" + }, + "contentType": { + "type": "keyword" + }, + "curriculum": { + "type": "keyword" + }, + "developer": { + "type": "keyword" + }, + "domain": { + "type": "keyword" + }, + "downloadUrl": { + "type": "keyword" + }, + "downloads": { + "type": "long" + }, + "edition": { + "type": "keyword" + }, + "genre": { + "type": "keyword" + }, + "gradeLevel": { + "type": "keyword" + }, + "keywords": { + "type": "keyword" + }, + "me_totalDevices": { + "type": "long" + }, + "me_totalDownloads": { + "type": "long" + }, + "me_totalInteractions": { + "type": "long" + }, + "me_totalRatings": { + "type": "long" + }, + "me_totalSessionsCount": { + "type": "long" + }, + "me_totalSideloads": { + "type": "long" + }, + "me_totalTimespent": { + "type": "long" + }, + "me_totalUsage": { + "type": "long" + }, + "medium": { + "type": "keyword" + }, + "methods": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "owner": { + "type": "keyword" + }, + "popularity": { + "type": "long" + }, + "portalOwner": { + "type": "keyword" + }, + "publication": { + "type": "keyword" + }, + "publisher": { + "type": "keyword" + }, + "rating": { + "type": "long" + }, + "size": { + "type": "long" + }, + "source": { + "type": "keyword" + }, + "status": { + "type": "keyword" + }, + "subject": { + "type": "keyword" + }, + "templateType": { + "type": "keyword" + }, + "theme": { + "type": "keyword" + }, + "words": { + "type": "keyword" + } + } + }, + "itemdata": { + "properties": { + "concepts": { + "type": "keyword" + }, + "createdBy": { + "type": "keyword" + }, + "createdOn": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "keywords": { + "type": "keyword" + }, + "language": { + "type": "keyword" + }, + "lastUpdatedBy": { + "type": "keyword" + }, + "lastUpdatedOn": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "media": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "num_answers": { + "type": "long" + }, + "owner": { + "type": "keyword" + }, + "qlevel": { + "type": "keyword" + }, + "question": { + "type": "keyword" + }, + "source": { + "type": "keyword" + }, + "status": { + "type": "keyword" + }, + "template": { + "type": "keyword" + }, + "title": { + "type": "keyword" + }, + "type": { + "type": "keyword" + }, + "version": { + "type": "long" + } + } + }, + "ldata": { + "properties": { + "country": { + "type": "keyword" + }, + "state": { + "type": "keyword" + }, + "district": { + "type": "keyword" + }, + "city": { + "type": "keyword" + } + } + }, + "@version": { + "type": "keyword" + } + } + } + } +} diff --git a/ansible/roles/es7.17/files/templates/telemetry.json b/ansible/roles/es7.17/files/templates/telemetry.json new file mode 100644 index 0000000000..afe9522328 --- /dev/null +++ b/ansible/roles/es7.17/files/templates/telemetry.json @@ -0,0 +1,430 @@ +{ + "index_patterns" : "telemetry-*", + "settings" : { + "number_of_shards" : 5 + }, + "mappings" : { + "events" : { + "dynamic": false, + "properties": { + "@timestamp": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "@version": { + "type": "keyword" + }, + "eid": { + "type": "keyword" + }, + "ets": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "mid": { + "type": "keyword" + }, + "ts": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "ver": { + "type": "keyword" + }, + "actor": { + "properties": { + "id": { + "type": "keyword" + }, + "type": { + "type": "keyword" + } + } + }, + "edata": { + "properties": { + "comments": { + "type": "keyword" + }, + "correlationid": { + "type": "keyword" + }, + "duration": { + "type": "double" + }, + "data": { + "type": "keyword" + }, + "dir": { + "type": "keyword" + }, + "errtype": { + "type": "keyword" + }, + "id": { + "type": "keyword" + }, + "level": { + "type": "keyword" + }, + "loc": { + "type": "keyword" + }, + "message": { + "type": "keyword" + }, + "mode": { + "type": "keyword" + }, + "pass": { + "type": "keyword" + }, + "prevstate": { + "type": "keyword" + }, + "pageid": { + "type": "keyword" + }, + "query": { + "type": "keyword" + }, + "rating": { + "type": "double" + }, + "score": { + "type": "double" + }, + "size": { + "type": "double" + }, + "state": { + "type": "keyword" + }, + "subtype": { + "type": "keyword" + }, + "type": { + "type": "keyword" + }, + "uri": { + "type": "keyword" + }, + "items": { + "type": "nested", + "properties": { + "id": { + "type": "keyword" + }, + "ver": { + "type": "keyword" + }, + "type": { + "type": "keyword" + }, + "origin": { + "properties": { + "id": { + "type": "keyword" + }, + "type": { + "type": "keyword" + } + } + } + } + }, + "item": { + "properties": { + "id": { + "type": "keyword" + }, + "maxscore": { + "type": "long" + }, + "exlength": { + "type": "long" + }, + "uri": { + "type": "keyword" + }, + "desc": { + "type": "keyword" + }, + "title": { + "type": "keyword" + } + } + }, + "target": { + "properties": { + "id": { + "type": "keyword" + }, + "ver": { + "type": "keyword" + }, + "type": { + "type": "keyword" + }, + "category": { + "type": "keyword" + }, + "parent": { + "properties": { + "id": { + "type": "keyword" + }, + "type": { + "type": "keyword" + } + } + } + } + }, + "visits": { + "type": "nested", + "properties": { + "objid": { + "type": "keyword" + }, + "objtype": { + "type": "keyword" + } + } + }, + "plugin": { + "properties": { + "id": { + "type": "keyword" + }, + "ver": { + "type": "keyword" + }, + "category": { + "type": "keyword" + } + } + }, + "object": { + "properties": { + "id": { + "type": "keyword" + }, + "type": { + "type": "keyword" + }, + "subtype": { + "type": "keyword" + }, + "ver": { + "type": "keyword" + } + } + }, + "uaspec": { + "properties": { + "agent": { + "type": "keyword" + }, + "ver": { + "type": "keyword" + }, + "system": { + "type": "keyword" + }, + "platform": { + "type": "keyword" + }, + "raw": { + "type": "keyword" + } + } + }, + "dspec": { + "properties": { + "camera": { + "type": "keyword" + }, + "cpu": { + "type": "keyword" + }, + "edisk": { + "type": "double" + }, + "id": { + "type": "keyword" + }, + "idisk": { + "type": "double" + }, + "make": { + "type": "keyword" + }, + "mem": { + "type": "double" + }, + "os": { + "type": "keyword" + }, + "scrn": { + "type": "double" + }, + "sims": { + "type": "double" + } + } + } + } + }, + "context": { + "properties": { + "channel": { + "type": "keyword" + }, + "env": { + "type": "keyword" + }, + "sid": { + "type": "keyword" + }, + "did": { + "type": "keyword" + }, + "pdata": { + "properties": { + "id": { + "type": "keyword" + }, + "pid": { + "type": "keyword" + }, + "ver": { + "type": "keyword" + } + } + }, + "rollup": { + "properties": { + "l1": { + "type": "keyword" + }, + "l2": { + "type": "keyword" + }, + "l3": { + "type": "keyword" + }, + "l4": { + "type": "keyword" + } + } + }, + "cdata": { + "type": "nested", + "properties": { + "type": { + "type": "keyword" + }, + "id": { + "type": "keyword" + } + } + } + } + }, + "object": { + "properties": { + "id": { + "type": "keyword" + }, + "type": { + "type": "keyword" + }, + "subtype": { + "type": "keyword" + }, + "parentid": { + "type": "keyword" + }, + "parenttype": { + "type": "keyword" + }, + "ver": { + "type": "keyword" + }, + "rollup": { + "properties": { + "l1": { + "type": "keyword" + }, + "l2": { + "type": "keyword" + }, + "l3": { + "type": "keyword" + }, + "l4": { + "type": "keyword" + } + } + } + } + }, + "ldata": { + "properties": { + "country": { + "type": "keyword" + }, + "state": { + "type": "keyword" + }, + "district": { + "type": "keyword" + }, + "city": { + "type": "keyword" + } + } + }, + "metadata": { + "properties": { + "source": { + "type": "keyword" + }, + "index_name": { + "type": "keyword" + }, + "index_type": { + "type": "keyword" + }, + "source_eid": { + "type": "keyword" + }, + "source_mid": { + "type": "keyword" + }, + "pump": { + "type": "keyword" + } + } + }, + "flags": { + "properties": { + "v2_converted": { + "type": "boolean" + }, + "dd_processed": { + "type": "boolean" + }, + "tv_processed": { + "type": "boolean" + }, + "ldata_retrieved": { + "type": "boolean" + } + } + } + } + } + } +} diff --git a/ansible/roles/es7.17/files/templates/vocabulary.json b/ansible/roles/es7.17/files/templates/vocabulary.json new file mode 100644 index 0000000000..d50cc7ec0e --- /dev/null +++ b/ansible/roles/es7.17/files/templates/vocabulary.json @@ -0,0 +1,130 @@ +{ + "index_patterns": "vocabularyterm", + "settings": { + "index": { + "analysis": { + "filter": { + "mynGram": { + "token_chars": [ + "letter", + "digit", + "whitespace", + "punctuation", + "symbol" + ], + "min_gram": "1", + "type": "edge_ngram", + "max_gram": "20" + } + }, + "analyzer": { + "keylower": { + "filter": "lowercase", + "tokenizer": "keyword" + }, + "vt_index_analyzer": { + "filter": [ + "lowercase", + "mynGram" + ], + "type": "custom", + "tokenizer": "standard" + }, + "vt_search_analyzer": { + "filter": [ + "standard", + "lowercase" + ], + "type": "custom", + "tokenizer": "standard" + } + } + } + }, + "number_of_shards": 5 + }, + "mappings": { + "vt": { + "dynamic_templates": [ + { + "longs": { + "mapping": { + "type": "long", + "fields": { + "raw": { + "type": "long" + } + } + }, + "match_mapping_type": "long" + } + }, + { + "booleans": { + "mapping": { + "type": "boolean", + "fields": { + "raw": { + "type": "boolean" + } + } + }, + "match_mapping_type": "boolean" + } + }, + { + "doubles": { + "mapping": { + "type": "double", + "fields": { + "raw": { + "type": "double" + } + } + }, + "match_mapping_type": "double" + } + }, + { + "dates": { + "mapping": { + "type": "date", + "fields": { + "raw": { + "type": "date" + } + } + }, + "match_mapping_type": "date" + } + }, + { + "strings": { + "mapping": { + "type": "text", + "copy_to": "all_fields", + "analyzer": "vt_index_analyzer", + "search_analyzer": "vt_search_analyzer", + "fields": { + "raw": { + "type": "text", + "fielddata": true, + "analyzer": "keylower" + } + } + }, + "match_mapping_type": "string" + } + } + ], + "properties": { + "all_fields": { + "type": "text", + "fielddata": true, + "analyzer": "vt_index_analyzer", + "search_analyzer": "vt_search_analyzer" + } + } + } + } +} \ No newline at end of file diff --git a/ansible/roles/es7.17/filter_plugins/custom.py b/ansible/roles/es7.17/filter_plugins/custom.py new file mode 100644 index 0000000000..22177cdd19 --- /dev/null +++ b/ansible/roles/es7.17/filter_plugins/custom.py @@ -0,0 +1,57 @@ +__author__ = 'dale mcdiarmid' + +import re +import os.path +from six import string_types + +def modify_list(values=[], pattern='', replacement='', ignorecase=False): + ''' Perform a `re.sub` on every item in the list''' + if ignorecase: + flags = re.I + else: + flags = 0 + _re = re.compile(pattern, flags=flags) + return [_re.sub(replacement, value) for value in values] + +def append_to_list(values=[], suffix=''): + if isinstance(values, string_types): + values = values.split(',') + return [str(value+suffix) for value in values] + +def array_to_str(values=[],separator=','): + return separator.join(values) + +def extract_role_users(users={},exclude_users=[]): + role_users=[] + for user,details in users.iteritems(): + if user not in exclude_users and "roles" in details: + for role in details["roles"]: + role_users.append(role+":"+user) + return role_users + +def filename(filename=''): + return os.path.splitext(os.path.basename(filename))[0] + +def remove_reserved(user_roles={}): + not_reserved = [] + for user_role,details in user_roles.items(): + if not "metadata" in details or not "_reserved" in details["metadata"] or not details["metadata"]["_reserved"]: + not_reserved.append(user_role) + return not_reserved + +def filter_reserved(users_role={}): + reserved = [] + for user_role,details in users_role.items(): + if "metadata" in details and "_reserved" in details["metadata"] and details["metadata"]["_reserved"]: + reserved.append(user_role) + return reserved + +class FilterModule(object): + def filters(self): + return {'modify_list': modify_list, + 'append_to_list':append_to_list, + 'filter_reserved':filter_reserved, + 'array_to_str':array_to_str, + 'extract_role_users':extract_role_users, + 'remove_reserved':remove_reserved, + 'filename':filename} \ No newline at end of file diff --git a/ansible/roles/es7.17/handlers/main.yml b/ansible/roles/es7.17/handlers/main.yml new file mode 100644 index 0000000000..d71397a395 --- /dev/null +++ b/ansible/roles/es7.17/handlers/main.yml @@ -0,0 +1,14 @@ + +- name: reload systemd configuration + become: yes + command: systemctl daemon-reload + +# Restart service and ensure it is enabled + +- name: restart elasticsearch + become: yes + service: name={{instance_init_script | basename}} state=restarted enabled=yes + when: + - es_restart_on_change + - es_start_service + register: es_restarted diff --git a/ansible/roles/es7.17/meta/main.yml b/ansible/roles/es7.17/meta/main.yml new file mode 100644 index 0000000000..aeecec7767 --- /dev/null +++ b/ansible/roles/es7.17/meta/main.yml @@ -0,0 +1,25 @@ +--- + +allow_duplicates: yes + +galaxy_info: + author: Robin Clarke, Jakob Reiter, Dale McDiarmid + description: Elasticsearch for Linux + company: "Elastic.co" + license: "license (Apache)" + min_ansible_version: 2.3.2 + platforms: + - name: EL + versions: + - 6 + - 7 + - name: Debian + versions: + - all + - name: Ubuntu + versions: + - all + categories: + - system + +dependencies: [] diff --git a/ansible/roles/es7.17/tasks/elasticsearch-Debian-version-lock.yml b/ansible/roles/es7.17/tasks/elasticsearch-Debian-version-lock.yml new file mode 100644 index 0000000000..d9fdd698bc --- /dev/null +++ b/ansible/roles/es7.17/tasks/elasticsearch-Debian-version-lock.yml @@ -0,0 +1,6 @@ +--- +- name: Debian - hold elasticsearch version + become: yes + command: apt-mark hold elasticsearch + register: hold_elasticsearch_result + changed_when: "hold_elasticsearch_result.stdout != 'elasticsearch was already set on hold.'" diff --git a/ansible/roles/es7.17/tasks/elasticsearch-Debian.yml b/ansible/roles/es7.17/tasks/elasticsearch-Debian.yml new file mode 100644 index 0000000000..ebaaa61744 --- /dev/null +++ b/ansible/roles/es7.17/tasks/elasticsearch-Debian.yml @@ -0,0 +1,48 @@ +--- + +- name: set fact force_install to no + set_fact: force_install=no + +- name: set fact force_install to yes + set_fact: force_install=yes + when: es_allow_downgrades + +- name: Debian - Install apt-transport-https to support https APT downloads + become: yes + apt: name=apt-transport-https state=present + when: es_use_repository + +- name: Debian - Add Elasticsearch repository key + become: yes + apt_key: url="{{ es_apt_key }}" state=present + when: es_use_repository and es_apt_key + +- name: Debian - Add elasticsearch repository + become: yes + apt_repository: repo={{ item.repo }} state={{ item.state}} + with_items: + - { repo: "{{ es_apt_url_old }}", state: "absent" } + - { repo: "{{ es_apt_url }}", state: "present" } + when: es_use_repository + +- name: Debian - Include versionlock + include: elasticsearch-Debian-version-lock.yml + when: es_version_lock + +- name: Debian - Ensure elasticsearch is installed + become: yes + apt: name=elasticsearch{% if es_version is defined and es_version != "" %}={{ es_version }}{% endif %} state=present force={{force_install}} allow_unauthenticated={{ 'no' if es_apt_key else 'yes' }} cache_valid_time=86400 + when: es_use_repository + register: debian_elasticsearch_install_from_repo + notify: restart elasticsearch + +- name: Debian - Download elasticsearch from url + get_url: url={% if es_custom_package_url is defined %}{{ es_custom_package_url }}{% else %}{{ es_package_url }}-{{ es_version }}.deb{% endif %} dest=/tmp/elasticsearch-{{ es_version }}.deb validate_certs=no + when: not es_use_repository + +- name: Debian - Ensure elasticsearch is installed from downloaded package + become: yes + apt: deb=/tmp/elasticsearch-{{ es_version }}.deb + when: not es_use_repository + register: elasticsearch_install_from_package + notify: restart elasticsearch diff --git a/ansible/roles/es7.17/tasks/elasticsearch-RedHat-version-lock.yml b/ansible/roles/es7.17/tasks/elasticsearch-RedHat-version-lock.yml new file mode 100644 index 0000000000..b5711a2f3b --- /dev/null +++ b/ansible/roles/es7.17/tasks/elasticsearch-RedHat-version-lock.yml @@ -0,0 +1,7 @@ +--- +- name: RedHat - install yum-version-lock + become: yes + yum: name=yum-plugin-versionlock state=present update_cache=yes +- name: RedHat - lock elasticsearch version + become: yes + shell: yum versionlock delete 0:elasticsearch* ; yum versionlock add elasticsearch{% if es_version is defined and es_version != "" %}-{{ es_version }}{% endif %} diff --git a/ansible/roles/es7.17/tasks/elasticsearch-RedHat.yml b/ansible/roles/es7.17/tasks/elasticsearch-RedHat.yml new file mode 100644 index 0000000000..588f0cec04 --- /dev/null +++ b/ansible/roles/es7.17/tasks/elasticsearch-RedHat.yml @@ -0,0 +1,31 @@ +--- +- name: Ensure libselinux-python on CentOS 6.x + become: yes + yum: name=libselinux-python state=present update_cache=yes + when: ( ansible_distribution == "CentOS" ) and ( ansible_distribution_major_version == "6" ) + +- name: RedHat - add Elasticsearch repo + become: yes + template: src=elasticsearch.repo dest=/etc/yum.repos.d/elasticsearch-{{ es_major_version }}.repo + when: es_use_repository + +- name: RedHat - include versionlock + include: elasticsearch-RedHat-version-lock.yml + when: es_version_lock + +- name: RedHat - Install Elasticsearch + become: yes + yum: name=elasticsearch{% if es_version is defined and es_version != "" %}-{{ es_version }}{% endif %} state=present update_cache=yes + when: es_use_repository + register: redhat_elasticsearch_install_from_repo + notify: restart elasticsearch + until: '"failed" not in redhat_elasticsearch_install_from_repo' + retries: 5 + delay: 10 + +- name: RedHat - Install Elasticsearch from url + become: yes + yum: name={% if es_custom_package_url is defined %}{{ es_custom_package_url }}{% else %}{{ es_package_url }}-{{ es_version }}.noarch.rpm{% endif %} state=present + when: not es_use_repository + register: elasticsearch_install_from_package + notify: restart elasticsearch diff --git a/ansible/roles/es7.17/tasks/elasticsearch-config.yml b/ansible/roles/es7.17/tasks/elasticsearch-config.yml new file mode 100644 index 0000000000..4f8ecc672d --- /dev/null +++ b/ansible/roles/es7.17/tasks/elasticsearch-config.yml @@ -0,0 +1,111 @@ +--- +# Configure Elasticsearch Node + +#Create required directories +- name: Create Directories + become: yes + file: path={{ item }} state=directory owner={{ es_user }} group={{ es_group }} + with_items: + - "{{pid_dir}}" + - "{{log_dir}}" + - "{{conf_dir}}" + +- name: Create Data Directories + become: yes + file: path={{ item }} state=directory owner={{ es_user }} group={{ es_group }} + with_items: + - "{{data_dirs}}" + +#Copy the config template +- name: Copy Configuration File + become: yes + template: src=elasticsearch.yml.j2 dest={{conf_dir}}/elasticsearch.yml owner={{ es_user }} group={{ es_group }} mode=0644 force=yes + register: system_change + notify: restart elasticsearch + +#Copy the instance specific default file +- name: Copy Default File for Instance + become: yes + template: src=elasticsearch.j2 dest={{instance_default_file}} mode=0644 force=yes + notify: restart elasticsearch + +#Copy the instance specific init file +- name: Copy Debian Init File for Instance + become: yes + template: src=init/debian/elasticsearch.j2 dest={{instance_init_script}} mode=0755 force=yes + when: ansible_os_family == 'Debian' and not use_system_d + notify: restart elasticsearch + +#Copy the instance specific init file +- name: Copy Redhat Init File for Instance + become: yes + template: src=init/redhat/elasticsearch.j2 dest={{instance_init_script}} mode=0755 force=yes + when: ansible_os_family == 'RedHat' and not use_system_d + notify: restart elasticsearch + +#Copy the systemd specific file if systemd is installed +- name: Copy Systemd File for Instance + become: yes + template: src=systemd/elasticsearch.j2 dest={{instance_sysd_script}} mode=0644 force=yes + when: use_system_d + notify: + - reload systemd configuration + - restart elasticsearch + +#Copy the logging.yml +- name: Copy log4j2.properties File for Instance + become: yes + template: src={{es_config_log4j2}} dest={{conf_dir}}/log4j2.properties owner={{ es_user }} group={{ es_group }} mode=0644 force=yes + notify: restart elasticsearch + +- name: Get information on the RAM + set_fact: + es_heap_size: "{% if ((ansible_memory_mb.real.total/(2*1024))|int) > 26 %}26g{% else %}{{(((ansible_memory_mb.real.total/(2*1024))+1)|int)}}g{% endif %}" + when: es_heap_size is not defined + +- name: Copy jvm.options File for Instance + become: yes + template: src=jvm.options.j2 dest={{conf_dir}}/jvm.options owner={{ es_user }} group={{ es_group }} mode=0644 force=yes + notify: restart elasticsearch + +#Clean up un-wanted package scripts to avoid confusion + +- name: Delete Default Init + become: yes + file: dest=/etc/init.d/elasticsearch state=absent + +- name: Create empty default environment file + become: yes + changed_when: False + copy: + dest: /etc/default/elasticsearch + content: '' + when: ansible_os_family == 'Debian' + +- name: Create empty default environment file + become: yes + changed_when: False + copy: + dest: /etc/sysconfig/elasticsearch + content: '' + when: ansible_os_family == 'RedHat' + +- name: Delete Default Sysconfig File + become: yes + file: dest="{{ sysd_script }}" state=absent + +- name: Delete Default Configuration File + become: yes + file: dest=/etc/elasticsearch/elasticsearch.yml state=absent + +- name: Delete Default Logging File + become: yes + file: dest=/etc/elasticsearch/logging.yml state=absent + +- name: Delete Default Logging File + become: yes + file: dest=/etc/elasticsearch/log4j2.properties state=absent + +- name: Delete Default JVM Options File + become: yes + file: dest=/etc/elasticsearch/jvm.options state=absent diff --git a/ansible/roles/es7.17/tasks/elasticsearch-optional-user.yml b/ansible/roles/es7.17/tasks/elasticsearch-optional-user.yml new file mode 100644 index 0000000000..d8f787e4b7 --- /dev/null +++ b/ansible/roles/es7.17/tasks/elasticsearch-optional-user.yml @@ -0,0 +1,24 @@ +--- +#Add the elasticsearch user before installing from packages. +- name: Ensure optional elasticsearch group is created with the correct id. + become: yes + #Restart if these change + notify: restart elasticsearch + group: + state: present + name: "{{ es_group }}" + system: yes + gid: "{{ es_group_id }}" + +- name: Ensure optional elasticsearch user is created with the correct id. + become: yes + #Restart if these change + notify: restart elasticsearch + user: + state: present + name: "{{ es_user }}" + comment: elasticsearch system user + system: yes + createhome: no + uid: "{{ es_user_id }}" + group: "{{ es_group }}" diff --git a/ansible/roles/es7.17/tasks/elasticsearch-parameters.yml b/ansible/roles/es7.17/tasks/elasticsearch-parameters.yml new file mode 100644 index 0000000000..a9cc13830a --- /dev/null +++ b/ansible/roles/es7.17/tasks/elasticsearch-parameters.yml @@ -0,0 +1,75 @@ +# Check for mandatory parameters + +- name: fail when es_instance is not defined + fail: msg="es_instance_name must be specified and cannot be blank" + when: es_instance_name is not defined or es_instance_name == '' + +- name: fail when es_proxy_port is not defined or is blank + fail: msg="es_proxy_port must be specified and cannot be blank when es_proxy_host is defined" + when: (es_proxy_port is not defined or es_proxy_port == '') and (es_proxy_host is defined and es_proxy_host != '') + +- name: debug message + debug: msg="WARNING - It is recommended you specify the parameter 'http.port'" + when: es_config['http.port'] is not defined + +- name: debug message + debug: msg="WARNING - It is recommended you specify the parameter 'transport.tcp.port'" + when: es_config['transport.tcp.port'] is not defined + +- name: debug message + debug: msg="WARNING - It is recommended you specify the parameter 'discovery.zen.ping.unicast.hosts'" + when: es_config['discovery.zen.ping.unicast.hosts'] is not defined + +#If the user attempts to lock memory they must specify a heap size +- name: fail when heap size is not specified when using memory lock + fail: msg="If locking memory with bootstrap.memory_lock a heap size must be specified" + when: es_config['bootstrap.memory_lock'] is defined and es_config['bootstrap.memory_lock'] == True and es_heap_size is not defined + +#Check if working with security we have an es_api_basic_auth_username and es_api_basic_auth_username - otherwise any http calls wont work +- name: fail when api credentials are not declared when using security + fail: msg="Enabling security requires an es_api_basic_auth_username and es_api_basic_auth_password to be provided to allow cluster operations" + when: es_enable_xpack and ("security" in es_xpack_features) and es_api_basic_auth_username is not defined and es_api_basic_auth_password is not defined + +- name: set fact file_reserved_users + set_fact: file_reserved_users={{ es_users.file.keys() | intersect (reserved_xpack_users) }} + when: es_users is defined and es_users.file is defined and (es_users.file.keys() | length > 0) and (es_users.file.keys() | intersect (reserved_xpack_users) | length > 0) + +- name: fail when changing users through file realm + fail: + msg: "ERROR: INVALID CONFIG - YOU CANNOT CHANGE RESERVED USERS THROUGH THE FILE REALM. THE FOLLOWING CANNOT BE CHANGED: {{file_reserved_users}}. USE THE NATIVE REALM." + when: file_reserved_users | default([]) | length > 0 + +- name: set fact instance_default_file + set_fact: instance_default_file={{default_file | dirname}}/{{es_instance_name}}_{{default_file | basename}} +- name: set fact instance_init_script + set_fact: instance_init_script={{init_script | dirname }}/{{es_instance_name}}_{{init_script | basename}} +- name: set fact conf_dir + set_fact: conf_dir={{ es_conf_dir }}/{{es_instance_name}} +- name: set fact m_lock_enabled + set_fact: m_lock_enabled={{ es_config['bootstrap.memory_lock'] is defined and es_config['bootstrap.memory_lock'] == True }} + +#TODO - if transport.host is not local maybe error on boostrap checks + + +#Use systemd for the following distributions: +#Ubuntu 15 and up +#Debian 8 and up +#Centos 7 and up +#Relies on elasticsearch distribution installing a serviced script to determine whether one should be copied. + +- name: set fact use_system_d + set_fact: use_system_d={{(ansible_distribution == 'Debian' and ansible_distribution_version is version('8', '>=')) or (ansible_distribution in ['RedHat','CentOS'] and ansible_distribution_version is version('7', '>=')) or (ansible_distribution == 'Ubuntu' and ansible_distribution_version is version('15', '>=')) }} + +- name: set fact instance_sysd_script + set_fact: instance_sysd_script={{sysd_script | dirname }}/{{es_instance_name}}_{{sysd_script | basename}} + when: use_system_d +#For directories we also use the {{inventory_hostname}}-{{ es_instance_name }} - this helps if we have a shared SAN. + +- name: set fact instance_suffix + set_fact: instance_suffix={{inventory_hostname}}-{{ es_instance_name }} +- name: set fact pid_dir + set_fact: pid_dir={{ es_pid_dir }}/{{instance_suffix}} +- name: set fact log_dir + set_fact: log_dir={{ es_log_dir }}/{{instance_suffix}} +- name: set fact log_dir + set_fact: data_dirs={{ es_data_dirs | append_to_list('/'+instance_suffix) }} diff --git a/ansible/roles/es7.17/tasks/elasticsearch-plugins.yml b/ansible/roles/es7.17/tasks/elasticsearch-plugins.yml new file mode 100644 index 0000000000..5d4e2d8153 --- /dev/null +++ b/ansible/roles/es7.17/tasks/elasticsearch-plugins.yml @@ -0,0 +1,82 @@ +--- + +# es_plugins_reinstall will be set to true if elasticsearch_install_from_repo.changed or elasticsearch_install_from_package.changed +# i.e. we have changed ES version(or we have clean installation of ES), or if no plugins listed. Otherwise it is false and requires explicitly setting. +- name: set fact es_plugins_reinstall to true + set_fact: es_plugins_reinstall=true + when: (((debian_elasticsearch_install_from_repo is defined and debian_elasticsearch_install_from_repo.changed) or (redhat_elasticsearch_install_from_repo is defined and redhat_elasticsearch_install_from_repo.changed)) or (elasticsearch_install_from_package is defined and elasticsearch_install_from_package.changed)) or es_plugins is not defined or es_plugins is none + +- name: set fact list_command + set_fact: list_command="" +#If we are reinstalling all plugins, e.g. to a version change, we need to remove all plugins (inc. x-pack) to install any plugins. Otherwise we don't consider x-pack so the role stays idempotent. +- name: set fact list_command check for x-pack + set_fact: list_command="| grep -vE 'x-pack'" + when: not es_plugins_reinstall + +#List currently installed plugins. We have to list the directories as the list commmand fails if the ES version is different than the plugin version. +- name: Check installed elasticsearch plugins + become: yes + shell: "ls {{es_home}}/plugins {{list_command}}" + register: installed_plugins + changed_when: False + ignore_errors: yes + environment: + CONF_DIR: "{{ conf_dir }}" + ES_PATH_CONF: "{{ conf_dir }}" + ES_INCLUDE: "{{ instance_default_file }}" + +#if es_plugins_reinstall is set to true we remove ALL plugins +- name: set fact plugins_to_remove to install_plugins.stdout_lines + set_fact: plugins_to_remove="{{ installed_plugins.stdout_lines | default([]) }}" + when: es_plugins_reinstall + +#if the plugins listed are different than those requested, we remove those installed but not listed in the config +- name: set fact plugins_to_remove to delete plugins installed but not listed in es_plugins + set_fact: plugins_to_remove="{{ installed_plugins.stdout_lines | difference(es_plugins | json_query('[*].plugin')) | default([]) }}" + when: not es_plugins_reinstall + +#if es_plugins_reinstall is set to true we (re)install ALL plugins +- name: set fact plugins_to_install to es_plugins + set_fact: plugins_to_install="{{ es_plugins | json_query('[*].plugin') | default([]) }}" + when: es_plugins_reinstall + +#if the plugins listed are different than those requested, we install those not installed but listed in the config +- name: set fact to plugins_to_install to those in es_config but not installed + set_fact: plugins_to_install="{{ es_plugins | json_query('[*].plugin') | difference(installed_plugins.stdout_lines) | default([]) }}" + when: not es_plugins_reinstall + +# This removes any currently installed plugins (to prevent errors when reinstalling) +- name: Remove elasticsearch plugins + become: yes + command: "{{es_home}}/bin/elasticsearch-plugin remove {{item}} --silent" + ignore_errors: yes + with_items: "{{ plugins_to_remove | default([]) }}" + notify: restart elasticsearch + register: plugin_removed + environment: + CONF_DIR: "{{ conf_dir }}" + ES_PATH_CONF: "{{ conf_dir }}" + ES_INCLUDE: "{{ instance_default_file }}" + +- name: Install elasticsearch plugins + become: yes + command: "{{es_home}}/bin/elasticsearch-plugin install {{ item.plugin }} --batch --silent" + register: plugin_installed + failed_when: "'ERROR' in plugin_installed.stdout" + changed_when: plugin_installed.rc == 0 + with_items: "{{ es_plugins }}" + when: item.plugin in plugins_to_install + notify: restart elasticsearch + environment: + CONF_DIR: "{{ conf_dir }}" + ES_PATH_CONF: "{{ conf_dir }}" + ES_INCLUDE: "{{ instance_default_file }}" + ES_JAVA_OPTS: "{% if item.proxy_host is defined and item.proxy_host != '' and item.proxy_port is defined and item.proxy_port != ''%} -Dhttp.proxyHost={{ item.proxy_host }} -Dhttp.proxyPort={{ item.proxy_port }} -Dhttps.proxyHost={{ item.proxy_host }} -Dhttps.proxyPort={{ item.proxy_port }} {% elif es_proxy_host is defined and es_proxy_host != '' %} -Dhttp.proxyHost={{ es_proxy_host }} -Dhttp.proxyPort={{ es_proxy_port }} -Dhttps.proxyHost={{ es_proxy_host }} -Dhttps.proxyPort={{ es_proxy_port }} {% endif %}" + until: plugin_installed.rc == 0 + retries: 5 + delay: 5 + +#Set permissions on plugins directory +- name: Set Plugin Directory Permissions + become: yes + file: state=directory path={{ es_home }}/plugins owner={{ es_user }} group={{ es_group }} recurse=yes diff --git a/ansible/roles/es7.17/tasks/elasticsearch-scripts.yml b/ansible/roles/es7.17/tasks/elasticsearch-scripts.yml new file mode 100644 index 0000000000..e38c3b4c4d --- /dev/null +++ b/ansible/roles/es7.17/tasks/elasticsearch-scripts.yml @@ -0,0 +1,26 @@ +--- + +- name: set fact es_script_dir + set_fact: es_script_dir={{ es_conf_dir }}/{{es_instance_name}} + tags: + - always + +- name: set fact es_script_dir when path.scripts + set_fact: es_script_dir={{es_config['path.scripts']}} + when: es_config['path.scripts'] is defined + tags: + - always + +- name: Create script dir + become: yes + file: state=directory path={{ es_script_dir }} owner={{ es_user }} group={{ es_group }} recurse=yes + +- name: Copy default scripts to elasticsearch + become: yes + copy: src=scripts dest={{ es_script_dir }} owner={{ es_user }} group={{ es_group }} + when: es_scripts_fileglob is not defined + +- name: Copy scripts to elasticsearch + become: yes + copy: src={{ item }} dest={{ es_script_dir }} owner={{ es_user }} group={{ es_group }} + with_fileglob: "{{ es_scripts_fileglob | default('') }}" diff --git a/ansible/roles/es7.17/tasks/elasticsearch-template.yml b/ansible/roles/es7.17/tasks/elasticsearch-template.yml new file mode 100644 index 0000000000..6059c7d727 --- /dev/null +++ b/ansible/roles/es7.17/tasks/elasticsearch-template.yml @@ -0,0 +1,40 @@ +--- +- name: ensure templates dir is created + file: + path: /etc/elasticsearch/templates + state: directory + owner: "{{ es_user }}" + group: "{{ es_group }}" + +- name: Copy templates to elasticsearch + copy: src={{ item }} dest=/etc/elasticsearch/templates owner={{ es_user }} group={{ es_group }} + register: load_templates + with_fileglob: + - "{{ es_templates_fileglob | default('') }}" + +- name: Install templates without auth + uri: + url: "http://{{es_api_host}}:{{es_api_port}}/_template/{{item | filename}}" + method: PUT + status_code: 200 + body_format: json + body: "{{ lookup('file', item) }}" + when: load_templates.changed and es_start_service and not es_enable_xpack or not es_xpack_features is defined or "security" not in es_xpack_features + with_fileglob: + - "{{ es_templates_fileglob | default('') }}" + run_once: True + +- name: Install templates with auth + uri: + url: "http://{{es_api_host}}:{{es_api_port}}/_template/{{item | filename}}" + method: PUT + status_code: 200 + user: "{{es_api_basic_auth_username}}" + password: "{{es_api_basic_auth_password}}" + force_basic_auth: yes + body_format: json + body: "{{ lookup('file', item) }}" + when: load_templates.changed and es_start_service and es_enable_xpack and es_xpack_features is defined and "security" in es_xpack_features + with_fileglob: + - "{{ es_templates_fileglob | default('') }}" + run_once: True diff --git a/ansible/roles/es7.17/tasks/elasticsearch.yml b/ansible/roles/es7.17/tasks/elasticsearch.yml new file mode 100644 index 0000000000..e2361d49bf --- /dev/null +++ b/ansible/roles/es7.17/tasks/elasticsearch.yml @@ -0,0 +1,13 @@ +--- + +- name: Include optional user and group creation. + when: (es_user_id is defined) and (es_group_id is defined) + include: elasticsearch-optional-user.yml + +- name: Include specific Elasticsearch + include: elasticsearch-Debian.yml + when: ansible_os_family == 'Debian' + +- name: Include specific Elasticsearch + include: elasticsearch-RedHat.yml + when: ansible_os_family == 'RedHat' diff --git a/ansible/roles/es7.17/tasks/java.yml b/ansible/roles/es7.17/tasks/java.yml new file mode 100644 index 0000000000..a4ecac04a4 --- /dev/null +++ b/ansible/roles/es7.17/tasks/java.yml @@ -0,0 +1,51 @@ +--- + +- name: set fact java_state to present + set_fact: java_state="present" + +- name: set fact java_state to latest + set_fact: java_state="latest" + when: update_java == true + +- name: RedHat - Ensure Java is installed + become: yes + yum: name={{ java }} state={{java_state}} + when: ansible_os_family == 'RedHat' + +- name: Get the installed java path + shell: "update-alternatives --display java | grep '^/' | awk '{print $1}' | grep 1.8.0" + register: java_full_path + failed_when: False + changed_when: False + when: ansible_os_family == 'RedHat' + +- name: correct java version selected + alternatives: + name: java + path: "{{ java_full_path.stdout }}" + link: /usr/bin/java + when: ansible_os_family == 'RedHat' and java_full_path is defined + +- name: Refresh java repo + become: yes + apt: update_cache=yes + changed_when: false + when: ansible_os_family == 'Debian' + +- name: Debian - Ensure Java is installed + become: yes + apt: name={{ java }} state={{java_state}} + when: ansible_os_family == 'Debian' + +- name: register open_jdk version + shell: java -version 2>&1 | grep OpenJDK + register: open_jdk + ignore_errors: yes + changed_when: false + +#https://github.com/docker-library/openjdk/issues/19 - ensures tests pass due to java 8 broken certs +- name: refresh the java ca-certificates + become: yes + command: /var/lib/dpkg/info/ca-certificates-java.postinst configure + when: ansible_distribution == 'Ubuntu' and open_jdk.rc == 0 + changed_when: false diff --git a/ansible/roles/es7.17/tasks/main.yml b/ansible/roles/es7.17/tasks/main.yml new file mode 100644 index 0000000000..39f915a018 --- /dev/null +++ b/ansible/roles/es7.17/tasks/main.yml @@ -0,0 +1,92 @@ +--- +- name: os-specific vars + include_vars: "{{ansible_os_family}}.yml" + tags: + - always + +- name: check-set-parameters + include: elasticsearch-parameters.yml + tags: + - always + +- name: include elasticsearch.yml + include: elasticsearch.yml + tags: + - install + +- name: include elasticsearch-config.yml + include: elasticsearch-config.yml + tags: + - config + +- name: include elasticsearch-scripts.yml + include: elasticsearch-scripts.yml + when: es_scripts + tags: + - scripts + +- name: include elasticsearch-plugins.yml + include: elasticsearch-plugins.yml + when: es_plugins is defined or es_plugins_reinstall + tags: + - plugins + +#We always execute xpack as we may need to remove features +- name: include xpack/elasticsearch-xpack.yml + include: xpack/elasticsearch-xpack.yml + tags: + - xpack + +- name: include plugins/create-keystore.yml + include: plugins/create-keystore.yml + +- name: include plugins/repository-azure.yml + include: plugins/repository-azure.yml + when: cloud_service_provider == "azure" + +- name: include plugins/repository-s3.yml + include: plugins/repository-s3.yml + when: cloud_service_provider == "aws" or cloud_service_provider == "oci" + +- name: include plugins/repository-gcs.yml + include: plugins/repository-gcs.yml + when: cloud_service_provider == "gcloud" + +- name: flush handlers + meta: flush_handlers + +- name: Make sure elasticsearch is started + service: name={{instance_init_script | basename}} state=started enabled=yes + when: es_start_service + +- name: Wait for elasticsearch to startup + wait_for: host={{es_api_host}} port={{es_api_port}} delay=5 connect_timeout=1 + when: es_restarted is defined and es_restarted.changed and es_start_service + +- name: set fact manage_native_realm to false + set_fact: manage_native_realm=false + +- name: set fact manage_native_realm to true + set_fact: manage_native_realm=true + when: es_start_service and (es_enable_xpack and "security" in es_xpack_features) and ((es_users is defined and es_users.native is defined) or (es_roles is defined and es_roles.native is defined)) + +# If playbook runs too fast, Native commands could fail as the Native Realm is not yet up +- name: Wait 15 seconds for the Native Relm to come up + pause: seconds=15 + when: manage_native_realm + +- name: activate-license + include: ./xpack/security/elasticsearch-xpack-activation.yml + when: es_start_service and es_enable_xpack and es_xpack_license is defined and es_xpack_license != '' + +#perform security actions here now elasticsearch is started +- name: include xpack/security/elasticsearch-security-native.yml + include: ./xpack/security/elasticsearch-security-native.yml + when: manage_native_realm + +#We also do after the native realm to ensure any changes are applied here first and its denf up. +- name: include elasticsearch-template.yml + include: elasticsearch-template.yml + when: es_templates + tags: + - templates diff --git a/ansible/roles/es7.17/tasks/plugins/create-keystore.yml b/ansible/roles/es7.17/tasks/plugins/create-keystore.yml new file mode 100644 index 0000000000..656183902d --- /dev/null +++ b/ansible/roles/es7.17/tasks/plugins/create-keystore.yml @@ -0,0 +1,13 @@ +--- +- name: Check if elasticsearch keystore exists or not + become: yes + stat: + path: "{{ conf_dir }}/elasticsearch.keystore" + register: elasticsearch_keystore_file + +- name: Create the elasticsearch keystore if not exists + become: yes + command: "{{es_home}}/bin/elasticsearch-keystore create" + environment: + ES_PATH_CONF: "{{ conf_dir }}" + when: elasticsearch_keystore_file.stat.exists == false diff --git a/ansible/roles/es7.17/tasks/plugins/repository-azure.yml b/ansible/roles/es7.17/tasks/plugins/repository-azure.yml new file mode 100644 index 0000000000..dd7fcc3a20 --- /dev/null +++ b/ansible/roles/es7.17/tasks/plugins/repository-azure.yml @@ -0,0 +1,15 @@ +--- +- name: Add default azure account name for backups + become: yes + shell: echo "{{ cloud_management_storage_accountname }}" | {{ es_home }}/bin/elasticsearch-keystore add -f azure.client.default.account + no_log: True + environment: + ES_PATH_CONF: "{{ conf_dir }}" + + +- name: Add default azure account key for backups + become: yes + shell: echo "{{ cloud_management_storage_secret }}" | {{ es_home }}/bin/elasticsearch-keystore add -f azure.client.default.key + no_log: True + environment: + ES_PATH_CONF: "{{ conf_dir }}" diff --git a/ansible/roles/es7.17/tasks/plugins/repository-gcs.yml b/ansible/roles/es7.17/tasks/plugins/repository-gcs.yml new file mode 100644 index 0000000000..6a32c0051a --- /dev/null +++ b/ansible/roles/es7.17/tasks/plugins/repository-gcs.yml @@ -0,0 +1,18 @@ +--- +- name: Create the gcs service account file from variable + become: yes + copy: + dest: "{{ conf_dir }}/gcs_management_bucket_service_account.json" + content: "{{ cloud_management_storage_secret }}" + +- name: Add gcs service account file to keystore + become: yes + shell: "{{ es_home }}/bin/elasticsearch-keystore add-file -f gcs.client.default.credentials_file {{ conf_dir }}/gcs_management_bucket_service_account.json" + no_log: True + environment: + ES_PATH_CONF: "{{ conf_dir }}" + +- name: Remove the service account file + file: + path: "{{ conf_dir }}/gcs_management_bucket_service_account.json" + state: absent diff --git a/ansible/roles/es7.17/tasks/plugins/repository-s3.yml b/ansible/roles/es7.17/tasks/plugins/repository-s3.yml new file mode 100644 index 0000000000..07655d6746 --- /dev/null +++ b/ansible/roles/es7.17/tasks/plugins/repository-s3.yml @@ -0,0 +1,14 @@ +--- +- name: Add default aws account name for backups + become: yes + shell: echo "{{ cloud_management_storage_accountname }}" | {{ es_home }}/bin/elasticsearch-keystore add -f s3.client.default.access_key + no_log: True + environment: + ES_PATH_CONF: "{{ conf_dir }}" + +- name: Add default aws account key for backups + become: yes + shell: echo "{{ cloud_management_storage_secret }}" | {{ es_home }}/bin/elasticsearch-keystore add -f s3.client.default.secret_key + no_log: True + environment: + ES_PATH_CONF: "{{ conf_dir }}" diff --git a/ansible/roles/es7.17/tasks/xpack/elasticsearch-xpack-install.yml b/ansible/roles/es7.17/tasks/xpack/elasticsearch-xpack-install.yml new file mode 100644 index 0000000000..522f8161fd --- /dev/null +++ b/ansible/roles/es7.17/tasks/xpack/elasticsearch-xpack-install.yml @@ -0,0 +1,68 @@ +--- + +#Test if feature is installed +- name: Test if x-pack is installed + shell: "{{es_home}}/bin/elasticsearch-plugin list | grep x-pack" + become: yes + register: x_pack_installed + changed_when: False + failed_when: "'ERROR' in x_pack_installed.stdout" + check_mode: no + ignore_errors: yes + environment: + CONF_DIR: "{{ conf_dir }}" + ES_PATH_CONF: "{{ conf_dir }}" + ES_INCLUDE: "{{ instance_default_file }}" + + +#Remove X-Pack if installed and its not been requested or the ES version has changed +- name: Remove x-pack plugin + become: yes + command: "{{es_home}}/bin/elasticsearch-plugin remove x-pack" + register: xpack_state + failed_when: "'ERROR' in xpack_state.stdout" + changed_when: xpack_state.rc == 0 + when: x_pack_installed.rc == 0 and (not es_enable_xpack or es_version_changed) + notify: restart elasticsearch + environment: + CONF_DIR: "{{ conf_dir }}" + ES_PATH_CONF: "{{ conf_dir }}" + ES_INCLUDE: "{{ instance_default_file }}" + + +#Install plugin if not installed, or the es version has changed (so removed above), and its been requested +- name: Download x-pack from url + get_url: url={{ es_xpack_custom_url }} dest=/tmp/x-pack-{{ es_version }}.zip + when: (x_pack_installed.rc == 1 or es_version_changed) and (es_enable_xpack and es_xpack_custom_url is defined) + +- name: Install x-pack plugin from local + become: yes + command: > + {{es_home}}/bin/elasticsearch-plugin install --silent --batch file:///tmp/x-pack-{{ es_version }}.zip + register: xpack_state + changed_when: xpack_state.rc == 0 + when: (x_pack_installed.rc == 1 or es_version_changed) and (es_enable_xpack and es_xpack_custom_url is defined) + notify: restart elasticsearch + environment: + CONF_DIR: "{{ conf_dir }}" + ES_PATH_CONF: "{{ conf_dir }}" + ES_INCLUDE: "{{ instance_default_file }}" + +- name: Delete x-pack zip file + file: dest=/tmp/x-pack-{{ es_version }}.zip state=absent + when: es_xpack_custom_url is defined + +- name: Install x-pack plugin from elastic.co + become: yes + command: > + {{es_home}}/bin/elasticsearch-plugin install --silent --batch x-pack + register: xpack_state + failed_when: "'ERROR' in xpack_state.stdout" + changed_when: xpack_state.rc == 0 + when: (x_pack_installed.rc == 1 or es_version_changed) and (es_enable_xpack and es_xpack_custom_url is not defined) + notify: restart elasticsearch + environment: + CONF_DIR: "{{ conf_dir }}" + ES_PATH_CONF: "{{ conf_dir }}" + ES_INCLUDE: "{{ instance_default_file }}" + ES_JAVA_OPTS: "{% if es_proxy_host is defined and es_proxy_host != '' %}-Dhttp.proxyHost={{ es_proxy_host }} -Dhttp.proxyPort={{ es_proxy_port }} -Dhttps.proxyHost={{ es_proxy_host }} -Dhttps.proxyPort={{ es_proxy_port }}{% endif %}" diff --git a/ansible/roles/es7.17/tasks/xpack/elasticsearch-xpack.yml b/ansible/roles/es7.17/tasks/xpack/elasticsearch-xpack.yml new file mode 100644 index 0000000000..4fe1cab279 --- /dev/null +++ b/ansible/roles/es7.17/tasks/xpack/elasticsearch-xpack.yml @@ -0,0 +1,22 @@ +--- + +- name: set fact es_version_changed + set_fact: es_version_changed={{ ((elasticsearch_install_from_package is defined and (debian_elasticsearch_install_from_repo.changed or redhat_elasticsearch_install_from_repo.changed)) or (elasticsearch_install_from_package is defined and elasticsearch_install_from_package.changed)) }} + +- name: include elasticsearch-xpack-install.yml + include: elasticsearch-xpack-install.yml + +#Security configuration +- name: include security/elasticsearch-security.yml + include: security/elasticsearch-security.yml + +#Add any feature specific configuration here +- name: Set Plugin Directory Permissions + become: yes + file: state=directory path={{ es_home }}/plugins owner={{ es_user }} group={{ es_group }} recurse=yes + +#Make sure elasticsearch.keystore has correct Permissions +- name: Set elasticsearch.keystore Permissions + become: yes + file: state=file path={{ conf_dir }}/elasticsearch.keystore owner={{ es_user }} group={{ es_group }} + when: es_enable_xpack and "security" in es_xpack_features and (es_version is version('6.0.0', '>')) diff --git a/ansible/roles/es7.17/tasks/xpack/security/elasticsearch-security-file.yml b/ansible/roles/es7.17/tasks/xpack/security/elasticsearch-security-file.yml new file mode 100644 index 0000000000..8d6f878995 --- /dev/null +++ b/ansible/roles/es7.17/tasks/xpack/security/elasticsearch-security-file.yml @@ -0,0 +1,80 @@ +--- +- name: set fact manage_file_users + set_fact: manage_file_users=es_users is defined and es_users.file is defined and es_users.file.keys() | length > 0 + +#List current users +- name: List Users + become: yes + shell: cat {{conf_dir}}/x-pack/users | awk -F':' '{print $1}' + register: current_file_users + when: manage_file_users + changed_when: False + +- name: set fact users_to_remove + set_fact: users_to_remove={{ current_file_users.stdout_lines | difference (es_users.file.keys()) }} + when: manage_file_users + +#Remove users +- name: Remove Users + become: yes + command: > + {{es_home}}/bin/x-pack/users userdel {{item}} + with_items: "{{users_to_remove | default([])}}" + when: manage_file_users + environment: + CONF_DIR: "{{ conf_dir }}" + ES_PATH_CONF: "{{ conf_dir }}" + ES_HOME: "{{es_home}}" + +- name: set fact users_to_add + set_fact: users_to_add={{ es_users.file.keys() | difference (current_file_users.stdout_lines) }} + when: manage_file_users + +#Add users +- name: Add Users + become: yes + command: > + {{es_home}}/bin/x-pack/users useradd {{item}} -p {{es_users.file[item].password}} + with_items: "{{ users_to_add | default([]) }}" + when: manage_file_users + no_log: True + environment: + CONF_DIR: "{{ conf_dir }}" + ES_PATH_CONF: "{{ conf_dir }}" + ES_HOME: "{{es_home}}" + +#Set passwords for all users declared - Required as the useradd will not change existing user passwords +- name: Set User Passwords + become: yes + command: > + {{es_home}}/bin/x-pack/users passwd {{ item }} -p {{es_users.file[item].password}} + with_items: "{{ es_users.file.keys() | default([]) }}" + when: manage_file_users + #Currently no easy way to figure out if the password has changed or to know what it currently is so we can skip. + changed_when: False + no_log: True + environment: + CONF_DIR: "{{ conf_dir }}" + ES_PATH_CONF: "{{ conf_dir }}" + ES_HOME: "{{es_home}}" + +- name: set fact users_roles + set_fact: users_roles={{es_users.file | extract_role_users () }} + when: manage_file_users + +#Copy Roles files +- name: Copy roles.yml File for Instance + become: yes + template: src=security/roles.yml.j2 dest={{conf_dir}}/x-pack/roles.yml owner={{ es_user }} group={{ es_group }} mode=0644 force=yes + when: es_roles is defined and es_roles.file is defined + +#Overwrite users_roles file +- name: Copy User Roles + become: yes + template: src=security/users_roles.j2 dest={{conf_dir}}/x-pack/users_roles mode=0644 force=yes + when: manage_file_users and users_roles | length > 0 + +#Set permission on security directory. E.g. if 2 nodes are installed on the same machine, the second node will not get the users file created at install, causing the files being created at es_users call and then having the wrong Permissions. +- name: Set Security Directory Permissions Recursive + become: yes + file: state=directory path={{conf_dir}}/x-pack/ owner={{ es_user }} group={{ es_group }} recurse=yes diff --git a/ansible/roles/es7.17/tasks/xpack/security/elasticsearch-security-native.yml b/ansible/roles/es7.17/tasks/xpack/security/elasticsearch-security-native.yml new file mode 100644 index 0000000000..63024fadef --- /dev/null +++ b/ansible/roles/es7.17/tasks/xpack/security/elasticsearch-security-native.yml @@ -0,0 +1,191 @@ +--- +- name: set fact change_api_password to false + set_fact: change_api_password=false + +- name: set fact manage_native_users to false + set_fact: manage_native_users=false + +- name: set fact manage_native_users to true + set_fact: manage_native_users=true + when: es_users is defined and es_users.native is defined and es_users.native.keys() | length > 0 + +- name: set fact manage_native_role to false + set_fact: manage_native_roles=false + +- name: set fact manange_native_roles to true + set_fact: manage_native_roles=true + when: es_roles is defined and es_roles.native is defined and es_roles.native.keys() | length > 0 + +#If the node has just has security installed it maybe either stopped or started 1. if stopped, we need to start to load native realms 2. if started, we need to restart to load + +#List current users +- name: List Native Users + uri: + url: http://{{es_api_host}}:{{es_api_port}}/_xpack/security/user + method: GET + user: "{{es_api_basic_auth_username}}" + password: "{{es_api_basic_auth_password}}" + force_basic_auth: yes + status_code: 200 + register: user_list_response + when: manage_native_users + +- name: set fact reserved_users equals user_list_response.json + set_fact: reserved_users={{ user_list_response.json | filter_reserved }} + when: manage_native_users + +#Current users not inc. those reserved +- name: set fact current_users equals user_list_response.json.keys not including reserved + set_fact: current_users={{ user_list_response.json.keys() | difference (reserved_users) }} + when: manage_native_users + +#We are changing the es_api_basic_auth_username password, so we need to do it first and update the param +- name: set fact native_users + set_fact: native_users={{ es_users.native }} + when: manage_native_users + +- name: set fact change_api_password to true + set_fact: change_api_password=true + when: manage_native_users and es_api_basic_auth_username in native_users and native_users[es_api_basic_auth_username].password is defined + +- name: Update API User Password + uri: + url: http://{{es_api_host}}:{{es_api_port}}/_xpack/security/user/{{es_api_basic_auth_username}}/_password + method: POST + body_format: json + body: "{ \"password\":\"{{native_users[es_api_basic_auth_username].password}}\" }" + status_code: 200 + user: "{{es_api_basic_auth_username}}" + password: "{{es_api_basic_auth_password}}" + force_basic_auth: yes + when: change_api_password + +- name: set fact es_api_basic_auth_password + set_fact: es_api_basic_auth_password={{native_users[es_api_basic_auth_username].password}} + when: change_api_password + +#Identify users that are present in ES but not declared and thus should be removed +- name: set fact users_to_remove + set_fact: users_to_remove={{ current_users | difference ( native_users.keys() ) }} + when: manage_native_users + +#Delete all non required users NOT inc. reserved +- name: Delete Native Users + uri: + url: http://{{es_api_host}}:{{es_api_port}}/_xpack/security/user/{{item}} + method: DELETE + status_code: 200 + user: "{{es_api_basic_auth_username}}" + password: "{{es_api_basic_auth_password}}" + force_basic_auth: yes + when: manage_native_users + with_items: "{{ users_to_remove | default([]) }}" + +- name: set fact users_to_ignore + set_fact: users_to_ignore={{ native_users.keys() | intersect (reserved_users) }} + when: manage_native_users + +- name: debug message + debug: + msg: "WARNING: YOU CAN ONLY CHANGE THE PASSWORD FOR RESERVED USERS IN THE NATIVE REALM. ANY ROLE CHANGES WILL BE IGNORED: {{users_to_ignore}}" + when: manage_native_users and users_to_ignore | length > 0 + +#Update password on all reserved users +- name: Update Reserved User Passwords + uri: + url: http://{{es_api_host}}:{{es_api_port}}/_xpack/security/user/{{item}}/_password + method: POST + body_format: json + body: "{ \"password\":\"{{native_users[item].password}}\" }" + status_code: 200 + user: "{{es_api_basic_auth_username}}" + password: "{{es_api_basic_auth_password}}" + force_basic_auth: yes + when: native_users[item].password is defined + no_log: True + with_items: "{{ users_to_ignore | default([]) }}" + +- name: set fact users_to_modify + set_fact: users_to_modify={{ native_users.keys() | difference (reserved_users) }} + when: manage_native_users + +#Overwrite all other users NOT inc. those reserved +- name: Update Non-Reserved Native User Details + uri: + url: http://{{es_api_host}}:{{es_api_port}}/_xpack/security/user/{{item}} + method: POST + body_format: json + body: "{{ native_users[item] | to_json }}" + status_code: 200 + user: "{{es_api_basic_auth_username}}" + password: "{{es_api_basic_auth_password}}" + force_basic_auth: yes + when: manage_native_users + no_log: True + with_items: "{{ users_to_modify | default([]) }}" + +## ROLE CHANGES + +#List current roles not. inc those reserved +- name: List Native Roles + uri: + url: http://{{es_api_host}}:{{es_api_port}}/_xpack/security/role + method: GET + body_format: json + user: "{{es_api_basic_auth_username}}" + password: "{{es_api_basic_auth_password}}" + force_basic_auth: yes + status_code: 200 + register: role_list_response + when: manage_native_roles + +- name: set fact reserved roles + set_fact: reserved_roles={{ role_list_response.json | filter_reserved }} + when: manage_native_roles + +- name: set fact current roles + set_fact: current_roles={{ role_list_response.json.keys() | difference (reserved_roles) }} + when: manage_native_roles + +- name: set fact roles to ignore + set_fact: roles_to_ignore={{ es_roles.native.keys() | intersect (reserved_roles) | default([]) }} + when: manage_native_roles + +- name: debug message + debug: + msg: "WARNING: YOU CANNOT CHANGE RESERVED ROLES. THE FOLLOWING WILL BE IGNORED: {{roles_to_ignore}}" + when: manage_native_roles and roles_to_ignore | length > 0 + +- name: set fact roles_to_remove + set_fact: roles_to_remove={{ current_roles | difference ( es_roles.native.keys() ) }} + when: manage_native_roles + +#Delete all non required roles NOT inc. reserved +- name: Delete Native Roles + uri: + url: http://{{es_api_host}}:{{es_api_port}}/_xpack/security/role/{{item}} + method: DELETE + status_code: 200 + user: "{{es_api_basic_auth_username}}" + password: "{{es_api_basic_auth_password}}" + force_basic_auth: yes + when: manage_native_roles + with_items: "{{roles_to_remove | default([]) }}" + +- name: set fact roles_to_modify + set_fact: roles_to_modify={{ es_roles.native.keys() | difference (reserved_roles) }} + when: manage_native_roles + +#Update other roles - NOT inc. reserved roles +- name: Update Native Roles + uri: + url: http://{{es_api_host}}:{{es_api_port}}/_xpack/security/role/{{item}} + method: POST + body_format: json + body: "{{ es_roles.native[item] | to_json}}" + status_code: 200 + user: "{{es_api_basic_auth_username}}" + password: "{{es_api_basic_auth_password}}" + force_basic_auth: yes + when: manage_native_roles + with_items: "{{ roles_to_modify | default([]) }}" diff --git a/ansible/roles/es7.17/tasks/xpack/security/elasticsearch-security.yml b/ansible/roles/es7.17/tasks/xpack/security/elasticsearch-security.yml new file mode 100644 index 0000000000..9d5d4dc814 --- /dev/null +++ b/ansible/roles/es7.17/tasks/xpack/security/elasticsearch-security.yml @@ -0,0 +1,60 @@ +--- +#Security specific configuration done here + +#TODO: 1. Skip users with no password defined or error 2. Passwords | length > 6 + +#Ensure x-pack conf directory is created if necessary +- name: Ensure x-pack conf directory exists (file) + file: path={{ conf_dir }}/x-pack state=directory owner={{ es_user }} group={{ es_group }} + changed_when: False + when: + - es_enable_xpack and "security" in es_xpack_features + - (es_users is defined and es_users.file is defined) or (es_roles is defined and es_roles.file is defined) or (es_role_mapping is defined) + +#-----------------------------Create Bootstrap User----------------------------------- +- name: Check if bootstrap password is set + command: > + {{es_home}}/bin/elasticsearch-keystore list + register: list_keystore + changed_when: False + environment: + ES_PATH_CONF: "{{ conf_dir }}" + when: + - (es_enable_xpack and "security" in es_xpack_features) and (es_version is version('6.0.0', '>')) + +- name: Create Bootstrap password for elastic user + shell: echo "{{es_api_basic_auth_password}}" | {{es_home}}/bin/elasticsearch-keystore add -x 'bootstrap.password' + when: + - (es_enable_xpack and "security" in es_xpack_features) and (es_version is version('6.0.0', '>')) and es_api_basic_auth_username is defined and list_keystore is defined and es_api_basic_auth_username == 'elastic' and 'bootstrap.password' not in list_keystore.stdout_lines + environment: + ES_PATH_CONF: "{{ conf_dir }}" + no_log: true + +#-----------------------------FILE BASED REALM---------------------------------------- + +- include: elasticsearch-security-file.yml + when: (es_enable_xpack and "security" in es_xpack_features) and ((es_users is defined and es_users.file is defined) or (es_roles is defined and es_roles.file is defined)) + +#-----------------------------ROLE MAPPING ---------------------------------------- + +#Copy Roles files +- name: Copy role_mapping.yml File for Instance + become: yes + template: src=security/role_mapping.yml.j2 dest={{conf_dir}}/x-pack/role_mapping.yml owner={{ es_user }} group={{ es_group }} mode=0644 force=yes + when: es_role_mapping is defined + +#-----------------------------AUTH FILE---------------------------------------- + +- name: Copy message auth key to elasticsearch + become: yes + copy: src={{ es_message_auth_file }} dest={{conf_dir}}/x-pack/system_key owner={{ es_user }} group={{ es_group }} mode=0600 force=yes + when: es_message_auth_file is defined + +#------------------------------------------------------------------------------------ + +#Ensure security conf directory is created +- name: Ensure security conf directory exists + become: yes + file: path={{ conf_dir }}/security state=directory owner={{ es_user }} group={{ es_group }} + changed_when: False + when: es_enable_xpack and "security" in es_xpack_features diff --git a/ansible/roles/es7.17/tasks/xpack/security/elasticsearch-xpack-activation.yml b/ansible/roles/es7.17/tasks/xpack/security/elasticsearch-xpack-activation.yml new file mode 100644 index 0000000000..cd72d6a7d2 --- /dev/null +++ b/ansible/roles/es7.17/tasks/xpack/security/elasticsearch-xpack-activation.yml @@ -0,0 +1,37 @@ +--- + +- name: Activate ES license (without security authentication) + uri: + method: PUT + url: "http://{{es_api_host}}:{{es_api_port}}/_xpack/license?acknowledge=true" + body_format: json + body: "{{ es_xpack_license }}" + return_content: yes + register: license_activated + no_log: True + when: not "security" in es_xpack_features + failed_when: > + license_activated.status != 200 or + license_activated.json.license_status is not defined or + license_activated.json.license_status != 'valid' + +- name: Activate ES license (with security authentication) + uri: + method: PUT + url: "http://{{es_api_host}}:{{es_api_port}}/_xpack/license?acknowledge=true" + user: "{{es_api_basic_auth_username}}" + password: "{{es_api_basic_auth_password}}" + body_format: json + force_basic_auth: yes + body: "{{ es_xpack_license }}" + return_content: yes + register: license_activated + no_log: True + when: "'security' in es_xpack_features" + failed_when: > + license_activated.status != 200 or + license_activated.json.license_status is not defined or + license_activated.json.license_status != 'valid' + +- debug: + msg: "License: {{ license_activated }}" diff --git a/ansible/roles/es7.17/templates/elasticsearch.j2 b/ansible/roles/es7.17/templates/elasticsearch.j2 new file mode 100644 index 0000000000..5bf5746f93 --- /dev/null +++ b/ansible/roles/es7.17/templates/elasticsearch.j2 @@ -0,0 +1,83 @@ +################################ +# Elasticsearch +################################ + +# Elasticsearch home directory +ES_HOME={{es_home}} + +# Elasticsearch Java path +#JAVA_HOME= + +# Elasticsearch configuration directory +CONF_DIR={{conf_dir}} +ES_PATH_CONF={{conf_dir}} + +# Elasticsearch data directory +DATA_DIR={{ data_dirs | array_to_str }} + +# Elasticsearch logs directory +LOG_DIR={{log_dir}} + +# Elasticsearch PID directory +PID_DIR={{pid_dir}} + +ES_JVM_OPTIONS={{conf_dir}}/jvm.options + +# Configure restart on package upgrade (true, every other setting will lead to not restarting) +#ES_RESTART_ON_UPGRADE=true + +# Path to the GC log file +#ES_GC_LOG_FILE=/var/log/elasticsearch/gc.log + +################################ +# Elasticsearch service +################################ + +# SysV init.d +# +# When executing the init script, this user will be used to run the elasticsearch service. +# The default value is 'elasticsearch' and is declared in the init.d file. +# Note that this setting is only used by the init script. If changed, make sure that +# the configured user can read and write into the data, work, plugins and log directories. +# For systemd service, the user is usually configured in file /usr/lib/systemd/system/elasticsearch.service +ES_USER={{es_user}} +ES_GROUP={{es_group}} + +# The number of seconds to wait before checking if Elasticsearch started successfully as a daemon process +ES_STARTUP_SLEEP_TIME=5 + +################################ +# System properties +################################ + +# Specifies the maximum file descriptor number that can be opened by this process +# When using Systemd, this setting is ignored and the LimitNOFILE defined in +# /usr/lib/systemd/system/elasticsearch.service takes precedence +{% if es_max_open_files is defined %} +#MAX_OPEN_FILES +MAX_OPEN_FILES={{es_max_open_files}} +{% endif %} + +# The maximum number of bytes of memory that may be locked into RAM +# Set to "unlimited" if you use the 'bootstrap.memory_lock: true' option +# in elasticsearch.yml +# When using Systemd, the LimitMEMLOCK property must be set +# in /usr/lib/systemd/system/elasticsearch.service +#MAX_LOCKED_MEMORY= +{% if m_lock_enabled %} +MAX_LOCKED_MEMORY=unlimited +{% endif %} + +# Maximum number of VMA (Virtual Memory Areas) a process can own +# When using Systemd, this setting is ignored and the 'vm.max_map_count' +# property is set at boot time in /usr/lib/sysctl.d/elasticsearch.conf +#MAX_MAP_COUNT=262144 +{% if es_max_map_count is defined %} +MAX_MAP_COUNT={{es_max_map_count}} +{% endif %} + +# Specifies the maximum number of threads that can be started. +# Elasticsearch requires a minimum of 2048. +{% if es_max_threads is defined %} +MAX_THREADS={{ es_max_threads }} +{% endif %} diff --git a/ansible/roles/es7.17/templates/elasticsearch.repo b/ansible/roles/es7.17/templates/elasticsearch.repo new file mode 100644 index 0000000000..b6299042bd --- /dev/null +++ b/ansible/roles/es7.17/templates/elasticsearch.repo @@ -0,0 +1,11 @@ +[elasticsearch-{{ es_major_version }}] +name=Elasticsearch repository for {{ es_major_version }} packages +baseurl=https://artifacts.elastic.co/packages/{{ es_major_version }}/yum +gpgcheck=1 +gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch +enabled=1 +autorefresh=1 +type=rpm-md +{% if es_proxy_host is defined and es_proxy_host != '' and es_proxy_port is defined %} +proxy=http://{{ es_proxy_host }}:{{es_proxy_port}} +{% endif %} diff --git a/ansible/roles/es7.17/templates/elasticsearch.yml.j2 b/ansible/roles/es7.17/templates/elasticsearch.yml.j2 new file mode 100644 index 0000000000..19442b224f --- /dev/null +++ b/ansible/roles/es7.17/templates/elasticsearch.yml.j2 @@ -0,0 +1,60 @@ + +{% if es_config %} +{{ es_config | to_nice_yaml }} +{% endif %} + +{% if es_config['cluster.name'] is not defined %} +cluster.name: elasticsearch +{% endif %} + +{% if (groups['es']|length) <= 2 %} +discovery.zen.minimum_master_nodes: 1 +{% else %} +discovery.zen.minimum_master_nodes: "{{ ((groups['es']|length) / 2 +1) | round(0, 'floor') | int}}" +{% endif %} + +{% if es_config['node.name'] is not defined %} +node.name: {{inventory_hostname}}-{{es_instance_name}} +{% endif %} + +#################################### Paths #################################### + +# Path to directory containing configuration (this file and logging.yml): + +{% if (es_version is version('6.0.0', '<')) %} +path.conf: {{ conf_dir }} +{% endif %} + +path.data: {{ data_dirs | array_to_str }} + +path.logs: {{ log_dir }} + +{% if es_enable_xpack %} +{% if not "security" in es_xpack_features %} +xpack.security.enabled: false +{% endif %} + +{% if not "monitoring" in es_xpack_features %} +xpack.monitoring.enabled: false +{% endif %} + +{% if not "alerting" in es_xpack_features %} +xpack.watcher.enabled: false +{% endif %} + +{% if not "ml" in es_xpack_features %} +xpack.ml.enabled: false +{% endif %} + +{% if not "graph" in es_xpack_features %} +xpack.graph.enabled: false +{% endif %} +{% endif %} + +network.host: 0.0.0.0 + +{% if es_remote_reindex is defined %} +reindex.remote.whitelist: {{es_remote_host}}:9200 +{% endif %} + +discovery.type: {{ es_etc_discovery_type | default('single-node') }} diff --git a/ansible/roles/es7.17/templates/init/debian/elasticsearch.j2 b/ansible/roles/es7.17/templates/init/debian/elasticsearch.j2 new file mode 100755 index 0000000000..22af436d6b --- /dev/null +++ b/ansible/roles/es7.17/templates/init/debian/elasticsearch.j2 @@ -0,0 +1,229 @@ +#!/bin/bash +# +# /etc/init.d/elasticsearch -- startup script for Elasticsearch +# +### BEGIN INIT INFO +# Provides: elasticsearch +# Required-Start: $network $remote_fs $named +# Required-Stop: $network $remote_fs $named +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Starts elasticsearch +# Description: Starts elasticsearch using start-stop-daemon +### END INIT INFO + +PATH=/bin:/usr/bin:/sbin:/usr/sbin +NAME={{es_instance_name}}_{{default_file | basename}} +{% if es_config['node.name'] is defined %} +DESC="Elasticsearch Server - {{es_config['node.name']}}" +{% else %} +DESC="Elasticsearch Server - {{es_instance_name}}" +{% endif %} + +DEFAULT=/etc/default/$NAME + +if [ `id -u` -ne 0 ]; then + echo "You need root privileges to run this script" + exit 1 +fi + +. /lib/lsb/init-functions +if [ -r /etc/default/rcS ]; then + . /etc/default/rcS +fi + +# The following variables can be overwritten in $DEFAULT + +# Run Elasticsearch as this user ID and group ID +ES_USER={{es_user}} +ES_GROUP={{es_group}} + +# Directory where the Elasticsearch binary distribution resides +ES_HOME={{es_home}} + +# Maximum number of open files +{% if es_max_open_files is defined %} +MAX_OPEN_FILES={{es_max_open_files}} +{% endif %} + +# Maximum amount of locked memory +#MAX_LOCKED_MEMORY= +{% if m_lock_enabled %} +MAX_LOCKED_MEMORY=unlimited +{% endif %} + +# Elasticsearch log directory +LOG_DIR={{log_dir}} + +# Elasticsearch data directory +DATA_DIR={{ data_dirs | array_to_str }} + +# Elasticsearch configuration directory +CONF_DIR={{conf_dir}} +ES_PATH_CONF={{ conf_dir }} + +# Maximum number of VMA (Virtual Memory Areas) a process can own +{% if es_max_map_count is defined %} +MAX_MAP_COUNT={{es_max_map_count}} +{% endif %} + +# Elasticsearch PID file directory +PID_DIR={{pid_dir}} + +ES_JVM_OPTIONS="{{conf_dir}}/jvm.options" + +# End of variables that can be overwritten in $DEFAULT + +# overwrite settings from default file +if [ -f "$DEFAULT" ]; then + . "$DEFAULT" +fi + +# CONF_FILE setting was removed +if [ ! -z "$CONF_FILE" ]; then + echo "CONF_FILE setting is no longer supported. elasticsearch.yml must be placed in the config directory and cannot be renamed." + exit 1 +fi + +if [ "$ES_USER" != "elasticsearch" ] || [ "$ES_GROUP" != "elasticsearch" ]; then + echo "WARNING: ES_USER and ES_GROUP are deprecated and will be removed in the next major version of Elasticsearch, got: [$ES_USER:$ES_GROUP]" +fi + +# Define other required variables +PID_FILE="$PID_DIR/$NAME.pid" +DAEMON=$ES_HOME/bin/elasticsearch +{% if (es_version is version('6.0.0', '<')) %} +DAEMON_OPTS="-d -p $PID_FILE -Edefault.path.logs=$LOG_DIR -Edefault.path.data=$DATA_DIR -Edefault.path.conf=$CONF_DIR" +{% else %} +DAEMON_OPTS="-d -p $PID_FILE" +{% endif %} + +export ES_JAVA_OPTS +export JAVA_HOME +export ES_INCLUDE +export ES_JVM_OPTIONS +export ES_PATH_CONF + +# export unsupported variables so bin/elasticsearch can reject them and inform the user these are unsupported +if test -n "$ES_MIN_MEM"; then export ES_MIN_MEM; fi +if test -n "$ES_MAX_MEM"; then export ES_MAX_MEM; fi +if test -n "$ES_HEAP_SIZE"; then export ES_HEAP_SIZE; fi +if test -n "$ES_HEAP_NEWSIZE"; then export ES_HEAP_NEWSIZE; fi +if test -n "$ES_DIRECT_SIZE"; then export ES_DIRECT_SIZE; fi +if test -n "$ES_USE_IPV4"; then export ES_USE_IPV4; fi +if test -n "$ES_GC_OPTS"; then export ES_GC_OPTS; fi +if test -n "$ES_GC_LOG_FILE"; then export ES_GC_LOG_FILE; fi + +# Check DAEMON exists +if [ ! -x "$DAEMON" ]; then + echo "The elasticsearch startup script does not exists or it is not executable, tried: $DAEMON" + exit 1 +fi + +checkJava() { + if [ -x "$JAVA_HOME/bin/java" ]; then + JAVA="$JAVA_HOME/bin/java" + else + JAVA=`which java` + fi + + if [ ! -x "$JAVA" ]; then + echo "Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME" + exit 1 + fi +} + +case "$1" in + start) + checkJava + + log_daemon_msg "Starting $DESC" + + pid=`pidofproc -p $PID_FILE elasticsearch` + if [ -n "$pid" ] ; then + log_begin_msg "Already running." + log_end_msg 0 + exit 0 + fi + + # Ensure that the PID_DIR exists (it is cleaned at OS startup time) + if [ -n "$PID_DIR" ] && [ ! -e "$PID_DIR" ]; then + mkdir -p "$PID_DIR" && chown "$ES_USER":"$ES_GROUP" "$PID_DIR" + fi + if [ -n "$PID_FILE" ] && [ ! -e "$PID_FILE" ]; then + touch "$PID_FILE" && chown "$ES_USER":"$ES_GROUP" "$PID_FILE" + fi + + if [ -n "$MAX_OPEN_FILES" ]; then + ulimit -n $MAX_OPEN_FILES + fi + + if [ -n "$MAX_LOCKED_MEMORY" ]; then + ulimit -l $MAX_LOCKED_MEMORY + fi + + if [ -n "$MAX_THREADS" ]; then + ulimit -u $MAX_THREADS + fi + + if [ -n "$MAX_MAP_COUNT" -a -f /proc/sys/vm/max_map_count ]; then + sysctl -q -w vm.max_map_count=$MAX_MAP_COUNT + fi + + # Start Daemon + start-stop-daemon -d $ES_HOME --start --user "$ES_USER" -c "$ES_USER" --pidfile "$PID_FILE" --exec $DAEMON -- $DAEMON_OPTS + return=$? + if [ $return -eq 0 ]; then + i=0 + timeout={{es_debian_startup_timeout}} + # Wait for the process to be properly started before exiting + until { kill -0 `cat "$PID_FILE"`; } >/dev/null 2>&1 + do + sleep 1 + i=$(($i + 1)) + if [ $i -gt $timeout ]; then + log_end_msg 1 + exit 1 + fi + done + fi + log_end_msg $return + exit $return + ;; + stop) + log_daemon_msg "Stopping $DESC" + + if [ -f "$PID_FILE" ]; then + start-stop-daemon --stop --pidfile "$PID_FILE" \ + --user "$ES_USER" \ + --quiet \ + --retry forever/TERM/20 > /dev/null + if [ $? -eq 1 ]; then + log_progress_msg "$DESC is not running but pid file exists, cleaning up" + elif [ $? -eq 3 ]; then + PID="`cat $PID_FILE`" + log_failure_msg "Failed to stop $DESC (pid $PID)" + exit 1 + fi + rm -f "$PID_FILE" + else + log_progress_msg "(not running)" + fi + log_end_msg 0 + ;; + status) + status_of_proc -p $PID_FILE elasticsearch elasticsearch && exit 0 || exit $? + ;; + restart|force-reload) + if [ -f "$PID_FILE" ]; then + $0 stop + fi + $0 start + ;; + *) + log_success_msg "Usage: $0 {start|stop|restart|force-reload|status}" + exit 1 + ;; +esac + +exit 0 diff --git a/ansible/roles/es7.17/templates/init/redhat/elasticsearch.j2 b/ansible/roles/es7.17/templates/init/redhat/elasticsearch.j2 new file mode 100755 index 0000000000..d32e393b2f --- /dev/null +++ b/ansible/roles/es7.17/templates/init/redhat/elasticsearch.j2 @@ -0,0 +1,217 @@ +#!/bin/bash +# +# elasticsearch +# +# chkconfig: 2345 80 20 +# description: Starts and stops a single elasticsearch instance on this system +# + +### BEGIN INIT INFO +# Provides: Elasticsearch +# Required-Start: $network $named +# Required-Stop: $network $named +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: This service manages the elasticsearch daemon +# Description: Elasticsearch is a very scalable, schema-free and high-performance search solution supporting multi-tenancy and near realtime search. +### END INIT INFO + +# +# init.d / servicectl compatibility (openSUSE) +# +if [ -f /etc/rc.status ]; then + . /etc/rc.status + rc_reset +fi + +# +# Source function library. +# +if [ -f /etc/rc.d/init.d/functions ]; then + . /etc/rc.d/init.d/functions +fi + +# Sets the default values for elasticsearch variables used in this script +ES_USER="{{es_user}}" +ES_GROUP="{{es_group}}" +ES_HOME="{{es_home}}" +{% if es_max_open_files is defined %} +MAX_OPEN_FILES={{es_max_open_files}} +{% endif %} +# Maximum number of VMA (Virtual Memory Areas) a process can own +{% if es_max_map_count is defined %} +MAX_MAP_COUNT={{es_max_map_count}} +{% endif %} + +LOG_DIR="{{log_dir}}" +DATA_DIR={{ data_dirs | array_to_str }} +CONF_DIR="{{conf_dir}}" +ES_PATH_CONF="{{ conf_dir }}" + +PID_DIR="{{pid_dir}}" + +# Source the default env file +ES_ENV_FILE="{{instance_default_file}}" +if [ -f "$ES_ENV_FILE" ]; then + . "$ES_ENV_FILE" +fi + +if [ "$ES_USER" != "elasticsearch" ] || [ "$ES_GROUP" != "elasticsearch" ]; then + echo "WARNING: ES_USER and ES_GROUP are deprecated and will be removed in the next major version of Elasticsearch, got: [$ES_USER:$ES_GROUP]" +fi + +# CONF_FILE setting was removed +if [ ! -z "$CONF_FILE" ]; then + echo "CONF_FILE setting is no longer supported. elasticsearch.yml must be placed in the config directory and cannot be renamed." + exit 1 +fi + +exec="$ES_HOME/bin/elasticsearch" +prog="{{es_instance_name}}_{{default_file | basename}}" +pidfile="$PID_DIR/${prog}.pid" + +export ES_JAVA_OPTS +export JAVA_HOME +export ES_INCLUDE +export ES_JVM_OPTIONS +export ES_STARTUP_SLEEP_TIME +export ES_PATH_CONF + +# export unsupported variables so bin/elasticsearch can reject them and inform the user these are unsupported +if test -n "$ES_MIN_MEM"; then export ES_MIN_MEM; fi +if test -n "$ES_MAX_MEM"; then export ES_MAX_MEM; fi +if test -n "$ES_HEAP_SIZE"; then export ES_HEAP_SIZE; fi +if test -n "$ES_HEAP_NEWSIZE"; then export ES_HEAP_NEWSIZE; fi +if test -n "$ES_DIRECT_SIZE"; then export ES_DIRECT_SIZE; fi +if test -n "$ES_USE_IPV4"; then export ES_USE_IPV4; fi +if test -n "$ES_GC_OPTS"; then export ES_GC_OPTS; fi +if test -n "$ES_GC_LOG_FILE"; then export ES_GC_LOG_FILE; fi + +lockfile=/var/lock/subsys/$prog + +# backwards compatibility for old config sysconfig files, pre 0.90.1 +if [ -n $USER ] && [ -z $ES_USER ] ; then + ES_USER=$USER +fi + +if [ ! -x "$exec" ]; then + echo "The elasticsearch startup script does not exists or it is not executable, tried: $exec" + exit 1 +fi + +checkJava() { + if [ -x "$JAVA_HOME/bin/java" ]; then + JAVA="$JAVA_HOME/bin/java" + else + JAVA=`which java` + fi + + if [ ! -x "$JAVA" ]; then + echo "Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME" + exit 1 + fi +} + +start() { + checkJava + [ -x $exec ] || exit 5 + + if [ -n "$MAX_OPEN_FILES" ]; then + ulimit -n $MAX_OPEN_FILES + fi + if [ -n "$MAX_LOCKED_MEMORY" ]; then + ulimit -l $MAX_LOCKED_MEMORY + fi + if [ -n "$MAX_THREADS" ]; then + ulimit -u $MAX_THREADS + fi + if [ -n "$MAX_MAP_COUNT" -a -f /proc/sys/vm/max_map_count ]; then + sysctl -q -w vm.max_map_count=$MAX_MAP_COUNT + fi + + # Ensure that the PID_DIR exists (it is cleaned at OS startup time) + if [ -n "$PID_DIR" ] && [ ! -e "$PID_DIR" ]; then + mkdir -p "$PID_DIR" && chown "$ES_USER":"$ES_GROUP" "$PID_DIR" + fi + if [ -n "$pidfile" ] && [ ! -e "$pidfile" ]; then + touch "$pidfile" && chown "$ES_USER":"$ES_GROUP" "$pidfile" + fi + + cd $ES_HOME + echo -n $"Starting $prog: " + # if not running, start it up here, usually something like "daemon $exec" +{% if (es_version is version('6.0.0', '<')) %} + daemon --user $ES_USER --pidfile $pidfile $exec -p $pidfile -d -Edefault.path.logs=$LOG_DIR -Edefault.path.data=$DATA_DIR -Edefault.path.conf=$CONF_DIR +{% else %} + daemon --user $ES_USER --pidfile $pidfile $exec -p $pidfile -d +{% endif %} + retval=$? + echo + [ $retval -eq 0 ] && touch $lockfile + return $retval +} + +stop() { + echo -n $"Stopping $prog: " + # stop it here, often "killproc $prog" + killproc -p $pidfile -d 86400 $prog + retval=$? + echo + [ $retval -eq 0 ] && rm -f $lockfile + return $retval +} + +restart() { + stop + start +} + +reload() { + restart +} + +force_reload() { + restart +} + +rh_status() { + # run checks to determine if the service is running or use generic status + status -p $pidfile $prog +} + +rh_status_q() { + rh_status >/dev/null 2>&1 +} + + +case "$1" in + start) + rh_status_q && exit 0 + $1 + ;; + stop) + rh_status_q || exit 0 + $1 + ;; + restart) + $1 + ;; + reload) + rh_status_q || exit 7 + $1 + ;; + force-reload) + force_reload + ;; + status) + rh_status + ;; + condrestart|try-restart) + rh_status_q || exit 0 + restart + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" + exit 2 +esac +exit $? diff --git a/ansible/roles/es7.17/templates/jvm.options.j2 b/ansible/roles/es7.17/templates/jvm.options.j2 new file mode 100644 index 0000000000..ad30851a2b --- /dev/null +++ b/ansible/roles/es7.17/templates/jvm.options.j2 @@ -0,0 +1,118 @@ +## JVM configuration + +################################################################ +## IMPORTANT: JVM heap size +################################################################ +## +## You should always set the min and max JVM heap +## size to the same value. For example, to set +## the heap to 4 GB, set: +## +## -Xms4g +## -Xmx4g +## +## See https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html +## for more information +## +################################################################ + +# Xms represents the initial size of total heap space +# Xmx represents the maximum size of total heap space +{% if es_heap_size is defined %} +-Xms{{ es_heap_size }} +-Xmx{{ es_heap_size }} +{% else %} +-Xms2g +-Xmx2g +{% endif %} + +################################################################ +## Expert settings +################################################################ +## +## All settings below this section are considered +## expert settings. Don't tamper with them unless +## you understand what you are doing +## +################################################################ + +## GC configuration +-XX:+UseConcMarkSweepGC +-XX:CMSInitiatingOccupancyFraction=75 +-XX:+UseCMSInitiatingOccupancyOnly + +## optimizations + +# pre-touch memory pages used by the JVM during initialization +-XX:+AlwaysPreTouch + +## basic + +# force the server VM +-server + +# set to headless, just in case +-Djava.awt.headless=true + +# ensure UTF-8 encoding by default (e.g. filenames) +-Dfile.encoding=UTF-8 + +# use our provided JNA always versus the system one +-Djna.nosys=true + +# use old-style file permissions on JDK9 +-Djdk.io.permissionsUseCanonicalPath=true + +# flags to configure Netty +-Dio.netty.noUnsafe=true +-Dio.netty.noKeySetOptimization=true +-Dio.netty.recycler.maxCapacityPerThread=0 + +# log4j 2 +-Dlog4j.shutdownHookEnabled=false +-Dlog4j2.disable.jmx=true +-Dlog4j.skipJansi=true + +## heap dumps + +# generate a heap dump when an allocation from the Java heap fails +# heap dumps are created in the working directory of the JVM +-XX:+HeapDumpOnOutOfMemoryError + +# specify an alternative path for heap dumps +# ensure the directory exists and has sufficient space +#-XX:HeapDumpPath=${heap.dump.path} + +## GC logging + +#-XX:+PrintGCDetails +#-XX:+PrintGCTimeStamps +#-XX:+PrintGCDateStamps +#-XX:+PrintClassHistogram +#-XX:+PrintTenuringDistribution +#-XX:+PrintGCApplicationStoppedTime + +# log GC status to a file with time stamps +# ensure the directory exists +#-Xloggc:${loggc} + + +# By default, the GC log file will not rotate. +# By uncommenting the lines below, the GC log file +# will be rotated every 128MB at most 32 times. +#-XX:+UseGCLogFileRotation +#-XX:NumberOfGCLogFiles=32 +#-XX:GCLogFileSize=128M + +# Elasticsearch 5.0.0 will throw an exception on unquoted field names in JSON. +# If documents were already indexed with unquoted fields in a previous version +# of Elasticsearch, some operations may throw errors. +# +# WARNING: This option will be removed in Elasticsearch 6.0.0 and is provided +# only for migration purposes. +#-Delasticsearch.json.allow_unquoted_field_names=true +{% if es_jvm_custom_parameters !='' %} +{% for item in es_jvm_custom_parameters %} +{{ item }} +{% endfor %} +{% endif %} diff --git a/ansible/roles/es7.17/templates/log4j2.properties.j2 b/ansible/roles/es7.17/templates/log4j2.properties.j2 new file mode 100644 index 0000000000..330f1435b8 --- /dev/null +++ b/ansible/roles/es7.17/templates/log4j2.properties.j2 @@ -0,0 +1,117 @@ +status = error + +# log action execution errors for easier debugging +logger.action.name = org.elasticsearch.action +logger.action.level = debug + +appender.console.type = Console +appender.console.name = console +appender.console.layout.type = PatternLayout +appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%m%n + +appender.rolling.type = RollingFile +appender.rolling.name = rolling +{% if (es_version is version('6.0.0', '<')) %} +appender.rolling.fileName = ${sys:es.logs}.log +{% else %} +appender.rolling.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}.log +{% endif %} +appender.rolling.layout.type = PatternLayout +appender.rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%.-10000m%n +{% if (es_version is version('6.0.0', '<')) %} +appender.rolling.filePattern = ${sys:es.logs}-%d{yyyy-MM-dd}.log +{% else %} +appender.rolling.filePattern = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}-%d{yyyy-MM-dd}-%i.log.gz +{% endif %} +appender.rolling.policies.type = Policies +appender.rolling.policies.time.type = TimeBasedTriggeringPolicy +appender.rolling.policies.time.interval = 1 +appender.rolling.policies.time.modulate = true +{% if (es_version is version('6.0.0', '>')) %} +appender.rolling.policies.size.type = SizeBasedTriggeringPolicy +appender.rolling.policies.size.size = 128MB +appender.rolling.strategy.type = DefaultRolloverStrategy +appender.rolling.strategy.fileIndex = nomax +appender.rolling.strategy.action.type = Delete +appender.rolling.strategy.action.basepath = ${sys:es.logs.base_path} +appender.rolling.strategy.action.condition.type = IfFileName +appender.rolling.strategy.action.condition.glob = ${sys:es.logs.cluster_name}-* +appender.rolling.strategy.action.condition.nested_condition.type = IfAccumulatedFileSize +appender.rolling.strategy.action.condition.nested_condition.exceeds = 2GB +{% endif %} +rootLogger.level = info +rootLogger.appenderRef.console.ref = console +rootLogger.appenderRef.rolling.ref = rolling + +appender.deprecation_rolling.type = RollingFile +appender.deprecation_rolling.name = deprecation_rolling +{% if (es_version is version('6.0.0', '<')) %} +appender.deprecation_rolling.fileName = ${sys:es.logs}_deprecation.log +{% else %} +appender.deprecation_rolling.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_deprecation.log +{% endif %} +appender.deprecation_rolling.layout.type = PatternLayout +appender.deprecation_rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%.-10000m%n +{% if (es_version is version('6.0.0', '<')) %} +appender.deprecation_rolling.filePattern = ${sys:es.logs}_deprecation-%i.log.gz +{% else %} +appender.deprecation_rolling.filePattern = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_deprecation-%i.log.gz +{% endif %} +appender.deprecation_rolling.policies.type = Policies +appender.deprecation_rolling.policies.size.type = SizeBasedTriggeringPolicy +appender.deprecation_rolling.policies.size.size = 1GB +appender.deprecation_rolling.strategy.type = DefaultRolloverStrategy +appender.deprecation_rolling.strategy.max = 4 + +logger.deprecation.name = org.elasticsearch.deprecation +logger.deprecation.level = warn +logger.deprecation.appenderRef.deprecation_rolling.ref = deprecation_rolling +logger.deprecation.additivity = false + +appender.index_search_slowlog_rolling.type = RollingFile +appender.index_search_slowlog_rolling.name = index_search_slowlog_rolling +{% if (es_version is version('6.0.0', '<')) %} +appender.index_search_slowlog_rolling.fileName = ${sys:es.logs}_index_search_slowlog.log +{% else %} +appender.index_search_slowlog_rolling.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_index_search_slowlog.log +{% endif %} +appender.index_search_slowlog_rolling.layout.type = PatternLayout +appender.index_search_slowlog_rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c] %marker%.-10000m%n +{% if (es_version is version('6.0.0', '<')) %} +appender.index_search_slowlog_rolling.filePattern = ${sys:es.logs}_index_search_slowlog-%d{yyyy-MM-dd}.log +{% else %} +appender.index_search_slowlog_rolling.filePattern = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_index_search_slowlog-%d{yyyy-MM-dd}.log +{% endif %} +appender.index_search_slowlog_rolling.policies.type = Policies +appender.index_search_slowlog_rolling.policies.time.type = TimeBasedTriggeringPolicy +appender.index_search_slowlog_rolling.policies.time.interval = 1 +appender.index_search_slowlog_rolling.policies.time.modulate = true + +logger.index_search_slowlog_rolling.name = index.search.slowlog +logger.index_search_slowlog_rolling.level = trace +logger.index_search_slowlog_rolling.appenderRef.index_search_slowlog_rolling.ref = index_search_slowlog_rolling +logger.index_search_slowlog_rolling.additivity = false + +appender.index_indexing_slowlog_rolling.type = RollingFile +appender.index_indexing_slowlog_rolling.name = index_indexing_slowlog_rolling +{% if (es_version is version('6.0.0', '<')) %} +appender.index_indexing_slowlog_rolling.fileName = ${sys:es.logs}_index_indexing_slowlog.log +{% else %} +appender.index_indexing_slowlog_rolling.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_index_indexing_slowlog.log +{% endif %} +appender.index_indexing_slowlog_rolling.layout.type = PatternLayout +appender.index_indexing_slowlog_rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c] %marker%.-10000m%n +{% if (es_version is version('6.0.0', '<')) %} +appender.index_indexing_slowlog_rolling.filePattern = ${sys:es.logs}_index_indexing_slowlog-%d{yyyy-MM-dd}.log +{% else %} +appender.index_indexing_slowlog_rolling.filePattern = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_index_indexing_slowlog-%d{yyyy-MM-dd}.log +{% endif %} +appender.index_indexing_slowlog_rolling.policies.type = Policies +appender.index_indexing_slowlog_rolling.policies.time.type = TimeBasedTriggeringPolicy +appender.index_indexing_slowlog_rolling.policies.time.interval = 1 +appender.index_indexing_slowlog_rolling.policies.time.modulate = true + +logger.index_indexing_slowlog.name = index.indexing.slowlog.index +logger.index_indexing_slowlog.level = trace +logger.index_indexing_slowlog.appenderRef.index_indexing_slowlog_rolling.ref = index_indexing_slowlog_rolling +logger.index_indexing_slowlog.additivity = false diff --git a/ansible/roles/es7.17/templates/security/role_mapping.yml.j2 b/ansible/roles/es7.17/templates/security/role_mapping.yml.j2 new file mode 100644 index 0000000000..2584375226 --- /dev/null +++ b/ansible/roles/es7.17/templates/security/role_mapping.yml.j2 @@ -0,0 +1 @@ +{{ es_role_mapping | to_nice_yaml }} \ No newline at end of file diff --git a/ansible/roles/es7.17/templates/security/roles.yml.j2 b/ansible/roles/es7.17/templates/security/roles.yml.j2 new file mode 100644 index 0000000000..9f211f2b07 --- /dev/null +++ b/ansible/roles/es7.17/templates/security/roles.yml.j2 @@ -0,0 +1 @@ +{{ es_roles.file | to_nice_yaml }} \ No newline at end of file diff --git a/ansible/roles/es7.17/templates/security/users_roles.j2 b/ansible/roles/es7.17/templates/security/users_roles.j2 new file mode 100644 index 0000000000..1c0acfa1d7 --- /dev/null +++ b/ansible/roles/es7.17/templates/security/users_roles.j2 @@ -0,0 +1 @@ +{{users_roles | join("\n") }} \ No newline at end of file diff --git a/ansible/roles/es7.17/templates/systemd/elasticsearch.j2 b/ansible/roles/es7.17/templates/systemd/elasticsearch.j2 new file mode 100644 index 0000000000..b4ef897538 --- /dev/null +++ b/ansible/roles/es7.17/templates/systemd/elasticsearch.j2 @@ -0,0 +1,77 @@ +[Unit] +Description=Elasticsearch-{{es_instance_name}} +Documentation=http://www.elastic.co +Wants=network-online.target +After=network-online.target + +[Service] +Environment="_JAVA_OPTIONS='-Dlog4j2.formatMsgNoLookups=true'" +Environment=ES_HOME={{es_home}} +Environment=CONF_DIR={{conf_dir}} +Environment=ES_PATH_CONF={{conf_dir}} +Environment=DATA_DIR={{ data_dirs | array_to_str }} +Environment=LOG_DIR={{log_dir}} +Environment=PID_DIR={{pid_dir}} +EnvironmentFile=-{{instance_default_file}} + +WorkingDirectory={{es_home}} + +User={{es_user}} +Group={{es_group}} + +{% if (es_version is version('6.0.0', '<')) %} +ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec +{% endif %} + +ExecStart={{es_home}}/bin/elasticsearch \ + -p ${PID_DIR}/elasticsearch.pid \ +{% if (es_version is version('6.0.0', '<')) %} + -Edefault.path.logs=${LOG_DIR} \ + -Edefault.path.data=${DATA_DIR} \ + -Edefault.path.conf=${CONF_DIR} \ +{% endif %} + --quiet + + +# StandardOutput is configured to redirect to journalctl since +# some error messages may be logged in standard output before +# elasticsearch logging system is initialized. Elasticsearch +# stores its logs in /var/log/elasticsearch and does not use +# journalctl by default. If you also want to enable journalctl +# logging, you can simply remove the "quiet" option from ExecStart. +StandardOutput=journal +StandardError=inherit + +# Specifies the maximum file descriptor number that can be opened by this process +{% if es_max_open_files is defined %} +LimitNOFILE={{es_max_open_files}} +{% endif %} + +# Specifies the maximum number of bytes of memory that may be locked into RAM +# Set to "infinity" if you use the 'bootstrap.memory_lock: true' option +# in elasticsearch.yml and 'MAX_LOCKED_MEMORY=unlimited' in {{instance_default_file}} +{% if m_lock_enabled %} +LimitMEMLOCK=infinity +{% endif %} + +# Specifies the maximum number of threads that can be started. Elasticsearch requires a +# minimum of 2048. +LimitNPROC={{ es_max_threads }} + +# Disable timeout logic and wait until process is stopped +TimeoutStopSec=0 + +# SIGTERM signal is used to stop the Java process +KillSignal=SIGTERM + +# Send the signal only to the JVM rather than its control group +KillMode=process + +# Java process is never killed +SendSIGKILL=no + +# When a JVM receives a SIGTERM signal it exits with code 143 +SuccessExitStatus=143 + +[Install] +WantedBy=multi-user.target diff --git a/ansible/roles/es7.17/vars/Debian.yml b/ansible/roles/es7.17/vars/Debian.yml new file mode 100644 index 0000000000..071736ef70 --- /dev/null +++ b/ansible/roles/es7.17/vars/Debian.yml @@ -0,0 +1,4 @@ +--- +java: "{% if es_java is defined %}{{es_java}}{% else %}openjdk-8-jre-headless{% endif %}" +default_file: "/etc/default/elasticsearch" +es_home: "/usr/share/elasticsearch" diff --git a/ansible/roles/es7.17/vars/RedHat.yml b/ansible/roles/es7.17/vars/RedHat.yml new file mode 100644 index 0000000000..b0aa42b2bb --- /dev/null +++ b/ansible/roles/es7.17/vars/RedHat.yml @@ -0,0 +1,4 @@ +--- +java: "{{ es_java | default('java-1.8.0-openjdk.x86_64') }}" +default_file: "/etc/sysconfig/elasticsearch" +es_home: "/usr/share/elasticsearch" \ No newline at end of file diff --git a/ansible/roles/es7.17/vars/main.yml b/ansible/roles/es7.17/vars/main.yml new file mode 100644 index 0000000000..b3bd126711 --- /dev/null +++ b/ansible/roles/es7.17/vars/main.yml @@ -0,0 +1,8 @@ +--- +es_package_url: "https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch" +es_conf_dir: "/etc/elasticsearch" +sysd_script: "/usr/lib/systemd/system/elasticsearch.service" +init_script: "/etc/init.d/elasticsearch" +#add supported features here +supported_xpack_features: ["alerting","monitoring","graph","security"] +reserved_xpack_users: ["elastic","kibana","logstash_system"] \ No newline at end of file diff --git a/ansible/roles/graylog/README.md b/ansible/roles/graylog/README.md index f2db50610c..27d6cf97da 100644 --- a/ansible/roles/graylog/README.md +++ b/ansible/roles/graylog/README.md @@ -28,8 +28,8 @@ Be certain you are running a supported version of Elasticsearch. You can configu **Compatibility Matrix** -| Graylog version | 3.x | 4.x | -|:--------------|:-------------:|:-------------:| +| Graylog version | 3.x | 4.x | +|:--------------|:-------------:|:----------:| | Elasticsearch | 5-6 | 6.8 - 7.10 | diff --git a/ansible/roles/kong-api/defaults/main.yml b/ansible/roles/kong-api/defaults/main.yml index 5e3c39c940..648aeb46cd 100644 --- a/ansible/roles/kong-api/defaults/main.yml +++ b/ansible/roles/kong-api/defaults/main.yml @@ -4193,6 +4193,90 @@ kong_apis: config.required: false config.enabled: false +- name: userFeed + uris: "{{ user_service_prefix }}/v1/feed" + upstream_url: "{{ userorg_service_url }}/v1/user/feed" + strip_uri: true + plugins: + - name: jwt + - name: cors + - "{{ statsd_pulgin }}" + - name: acl + config.whitelist: + - userAccess + - name: rate-limiting + config.policy: local + config.hour: "{{ medium_rate_limit_per_hour }}" + config.limit_by: credential + - name: request-size-limiting + config.allowed_payload_size: "{{ small_request_size_limit }}" + - name: opa-checks + config.required: true + config.enabled: true + +- name: userFeedCreate + uris: "{{ user_service_prefix }}/feed/v1/create" + upstream_url: "{{ userorg_service_url }}/v1/user/feed/create" + strip_uri: true + plugins: + - name: jwt + - name: cors + - "{{ statsd_pulgin }}" + - name: acl + config.whitelist: + - userAccess + - name: rate-limiting + config.policy: local + config.hour: "{{ medium_rate_limit_per_hour }}" + config.limit_by: credential + - name: request-size-limiting + config.allowed_payload_size: "{{ small_request_size_limit }}" + - name: opa-checks + config.required: false + config.enabled: false + +- name: userFeedDelete + uris: "{{ user_service_prefix }}/feed/v1/delete" + upstream_url: "{{ userorg_service_url }}/v1/user/feed/delete" + strip_uri: true + plugins: + - name: jwt + - name: cors + - "{{ statsd_pulgin }}" + - name: acl + config.whitelist: + - userAccess + - name: rate-limiting + config.policy: local + config.hour: "{{ medium_rate_limit_per_hour }}" + config.limit_by: credential + - name: request-size-limiting + config.allowed_payload_size: "{{ small_request_size_limit }}" + - name: opa-checks + config.required: false + config.enabled: false + +- name: userFeedUpdate + uris: "{{ user_service_prefix }}/feed/v1/update" + upstream_url: "{{ userorg_service_url }}/v1/user/feed/update" + strip_uri: true + plugins: + - name: jwt + - name: cors + - "{{ statsd_pulgin }}" + - name: acl + config.whitelist: + - userAccess + - name: rate-limiting + config.policy: local + config.hour: "{{ medium_rate_limit_per_hour }}" + config.limit_by: credential + - name: request-size-limiting + config.allowed_payload_size: "{{ small_request_size_limit }}" + - name: opa-checks + config.required: false + config.enabled: false + - name: userMigrate uris: "{{ user_service_prefix }}/v1/migrate" upstream_url: "{{ userorg_service_url }}/v1/user/migrate"