diff --git a/dependencies_with_url.csv b/dependencies_with_url.csv index 38a9f5e70e..b94a984361 100644 --- a/dependencies_with_url.csv +++ b/dependencies_with_url.csv @@ -310,6 +310,29 @@ org.springframework.security.kerberos:spring-security-kerberos-core:jar:1.0.1.RE org.springframework.kafka:spring-kafka:jar:1.1.1.RELEASE:compile,ASLv2,https://github.com/spring-projects/spring-kafka ch.hsr:geohash:jar:1.3.0:compile,ASLv2,https://github.com/kungfoo/geohash-java org.locationtech.spatial4j:spatial4j:jar:0.6:compile,ASLv2,https://github.com/locationtech/spatial4j +com.github.spullara.mustache.java:compiler:jar:0.9.3:compile,ASLv2,https://github.com/spullara/mustache.java/blob/master/LICENSE +io.netty:netty-buffer:jar:4.1.13.Final:compile,ASLv2,http://netty.io/ +io.netty:netty-codec-http:jar:4.1.13.Final:compile,ASLv2,http://netty.io/ +io.netty:netty-codec:jar:4.1.13.Final:compile,ASLv2,http://netty.io/ +io.netty:netty-common:jar:4.1.13.Final:compile,ASLv2,http://netty.io/ +io.netty:netty-handler:jar:4.1.13.Final:compile,ASLv2,http://netty.io/ +io.netty:netty:jar:3.10.6.Final:compile,ASLv2,http://netty.io/ +io.netty:netty-resolver:jar:4.1.13.Final:compile,ASLv2,http://netty.io/ +io.netty:netty-transport:jar:4.1.13.Final:compile,ASLv2,http://netty.io/ +joda-time:joda-time:jar:2.9.5:compile,ASLv2,https://github.com/JodaOrg/joda-time +net.sf.jopt-simple:jopt-simple:jar:5.0.2:compile,The MIT License,http://jopt-simple.sourceforge.net +org.elasticsearch.client:elasticsearch-rest-client:jar:5.6.2:compile,ASLv2,https://github.com/elastic/elasticsearch/blob/master/LICENSE.txt +org.elasticsearch.client:transport:jar:5.6.2:compile,ASLv2,https://github.com/elastic/elasticsearch/blob/master/LICENSE.txt +org.elasticsearch:elasticsearch:jar:5.6.2:compile,ASLv2,https://github.com/elastic/elasticsearch/blob/master/LICENSE.txt +org.elasticsearch:jna:jar:4.4.0-1:compile,ASLv2,https://github.com/elastic/elasticsearch/blob/master/LICENSE.txt +org.elasticsearch.plugin:lang-mustache-client:jar:5.6.2:compile,ASLv2,https://github.com/elastic/elasticsearch/blob/master/LICENSE.txt +org.elasticsearch.plugin:parent-join-client:jar:5.6.2:compile,ASLv2,https://github.com/elastic/elasticsearch/blob/master/LICENSE.txt +org.elasticsearch.plugin:percolator-client:jar:5.6.2:compile,ASLv2,https://github.com/elastic/elasticsearch/blob/master/LICENSE.txt +org.elasticsearch.plugin:reindex-client:jar:5.6.2:compile,ASLv2,https://github.com/elastic/elasticsearch/blob/master/LICENSE.txt +org.elasticsearch.plugin:transport-netty3-client:jar:5.6.2:compile,ASLv2,https://github.com/elastic/elasticsearch/blob/master/LICENSE.txt +org.elasticsearch.plugin:transport-netty4-client:jar:5.6.2:compile,ASLv2,https://github.com/elastic/elasticsearch/blob/master/LICENSE.txt +org.elasticsearch:securesm:jar:1.1:compile,ASLv2,https://github.com/elastic/elasticsearch/blob/master/LICENSE.txt +org.hdrhistogram:HdrHistogram:jar:2.1.9:compile,BSD,https://github.com/HdrHistogram/HdrHistogram/blob/master/LICENSE.txt com.trendmicro:tlsh:jar:3.7.1:compile,ASLv2,https://github.com/trendmicro/tlsh org.glassfish:javax.json:jar:1.0.4:compile,Common Development and Distribution License (CDDL) v1.0,https://github.com/javaee/jsonp org.eclipse.persistence:javax.persistence:jar:2.1.1:compile,EPL 1.0,http://www.eclipse.org/eclipselink diff --git a/metron-analytics/metron-profiler-client/pom.xml b/metron-analytics/metron-profiler-client/pom.xml index 342160df7c..932284d27d 100644 --- a/metron-analytics/metron-profiler-client/pom.xml +++ b/metron-analytics/metron-profiler-client/pom.xml @@ -139,6 +139,14 @@ ${global_storm_version} provided + + org.apache.logging.log4j + log4j-api + + + org.apache.logging.log4j + log4j-core + servlet-api javax.servlet diff --git a/metron-analytics/metron-profiler-common/pom.xml b/metron-analytics/metron-profiler-common/pom.xml index b686f6beb8..f24b1d2fb3 100644 --- a/metron-analytics/metron-profiler-common/pom.xml +++ b/metron-analytics/metron-profiler-common/pom.xml @@ -114,6 +114,14 @@ ${global_storm_version} provided + + org.apache.logging.log4j + log4j-api + + + org.apache.logging.log4j + log4j-core + log4j-slf4j-impl org.apache.logging.log4j diff --git a/metron-analytics/metron-profiler/pom.xml b/metron-analytics/metron-profiler/pom.xml index 6dcb595b03..d634cef683 100644 --- a/metron-analytics/metron-profiler/pom.xml +++ b/metron-analytics/metron-profiler/pom.xml @@ -202,6 +202,14 @@ storm-core ${global_storm_version} + + org.apache.logging.log4j + log4j-api + + + org.apache.logging.log4j + log4j-core + servlet-api javax.servlet @@ -221,6 +229,18 @@ provided + + org.apache.logging.log4j + log4j-api + ${global_log4j_core_version} + test + + + org.apache.logging.log4j + log4j-core + ${global_log4j_core_version} + test + org.apache.kafka kafka_2.10 diff --git a/metron-deployment/other-examples/manual-install/Manual_Install_CentOS6.md b/metron-deployment/other-examples/manual-install/Manual_Install_CentOS6.md index 0c9df5e217..e1305b6109 100644 --- a/metron-deployment/other-examples/manual-install/Manual_Install_CentOS6.md +++ b/metron-deployment/other-examples/manual-install/Manual_Install_CentOS6.md @@ -458,7 +458,7 @@ Client - Kibana: * Set "kibana_es_url" to `http://:9200`. "replace_with_elasticsearch_master_hostname" is the IP of the node where you assigned ElasticSearch Master on the Assign Master tab. - * Change kibana_default_application to "dashboard/Metron-Dashboard" + * Change kibana_default_application to "dashboard/AV-YpDmwdXwc6Ua9Muh9" - Metron: Set "Elasticsearch Hosts" to the IP of the node where you assigned ElasticSearch Master on the Assign Master tab. diff --git a/metron-deployment/packaging/ambari/README.md b/metron-deployment/packaging/ambari/README.md index bdb8b499e2..82e1537515 100644 --- a/metron-deployment/packaging/ambari/README.md +++ b/metron-deployment/packaging/ambari/README.md @@ -27,6 +27,7 @@ limitations under the License. * [Configuration involving dependency services](#configuration-involving-dependency-services) * [Kerberos](#kerberos) * [Best practices](#best-practices) +* [Upgrading MPack Services](#upgrading-mpack-services) ## Overview Typically, Ambari Management Pack development will be done in the Vagrant environments. These instructions are specific to Vagrant, but can be adapted for other environemnts (e.g. make sure to be on the correct nodes for server vs agent files) @@ -464,3 +465,211 @@ This is checked in the indexing master * Make sure to `kinit` as the correct user for setting up ACLs in a secured cluster. This is usually kafka for Kafka and hbase for HBase. * See `set_hbase_acls` in `METRON.CURRENT/package/scripts/enrichment_commands.py` for an HBase example * See `init_kafka_acls` in `METRON.CURRENT/package/scripts/enrichment_commands.py` and `METRON.CURRENT/package/scripts/metron_service.py` for an Kafka example + +## Upgrading MPack Services + +Apache Metron currently provides three services as part of its MPack +* Elasticsearch +* Kibana +* Metron + +There is currently no mechanism provided for multi-version or backwards compatibility. If you upgrade a service, e.g. Elasticsearch 2.x to 5.x, that is the only version that will be +supported by Ambari via MPack. + +The main steps for upgrading a service are split into add-on and common services for each service within the MPack as follows: +* Update the common services + * Change the service directory to use the new product version number + * Update metainfo.xml +* Update the add-on services + * Change the service directory to use the new product version number + * Update repoinfo.xml + * Update metainfo.xml +* Update mpack.json + +### Update Elasticsearch + +#### Update Common Services + +1. Change service directory names for Elasticsearch to the new desired version + + ``` + metron/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/${YOUR_VERSION_NUMBER_HERE} + ``` + + e.g. + + ``` + metron/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2 + ``` + +1. Update metainfo.xml + + Change the version number and package name in `metron/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/${YOUR_VERSION_NUMBER_HERE}/metainfo.xml`, e.g. + + ``` + 5.6.2 + ... + + + any + + + elasticsearch-5.6.2 + + + + + ``` + +#### Update Add-on Services + +1. Change service directory names for Elasticsearch to the new desired version + + ``` + metron/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/ELASTICSEARCH/${YOUR_VERSION_NUMBER_HERE} + ``` + + e.g. + + ``` + metron/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/ELASTICSEARCH/5.6.2 + ``` + +1. Update repoinfo.xml + + See [https://www.elastic.co/guide/en/elasticsearch/reference/current/rpm.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/rpm.html) for the latest info. + + Modify the baseurl and repoid in `metron/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/ELASTICSEARCH/${YOUR_VERSION_NUMBER_HERE}/repos/repoinfo.xml`, e.g. + + ``` + https://artifacts.elastic.co/packages/5.x/yum + elasticsearch-5.x + ELASTICSEARCH + ``` + +1. Update metainfo.xml + + Change the version number in `metron/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/ELASTICSEARCH/${YOUR_VERSION_NUMBER_HERE}/metainfo.xml`. + Also make sure to update the "extends" version to point to the updated common-services version, e.g. + + ``` + ELASTICSEARCH + 5.6.2 + common-services/ELASTICSEARCH/5.6.2 + ``` + +#### Update mpack.json + +1. Update the corresponding service_version in the service_versions_map, e.g. + + ``` + ... + "service_versions_map": [ + { + "service_name" : "ELASTICSEARCH", + "service_version" : "5.6.2", + "applicable_stacks" : [ + ... + ] + }, + ... + ] + ... + ``` + +### Kibana + +**Note:** Curator is included with the Kibana service + +#### Update Common Services + +1. Change service directory names for Kibana to the new desired version + + ``` + metron/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/${YOUR_VERSION_NUMBER_HERE} + ``` + + e.g. + + ``` + metron/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/5.6.2 + ``` + +1. Update metainfo.xml + + Change the version number and package name in `metron/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/${YOUR_VERSION_NUMBER_HERE}/metainfo.xml`, e.g. + + ``` + 5.6.2 + ... + + ... + + kibana-5.6.2 + + + ``` + +#### Update Add-on Services + +1. Change service directory names for Kibana to the new desired version + + ``` + metron/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/KIBANA/${YOUR_VERSION_NUMBER_HERE} + ``` + + e.g. + + ``` + metron/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/KIBANA/5.6.2 + ``` + +1. Update repoinfo.xml + + **Note:** for Curator, there is a different repo for rhel 6 vs rhel 7 + + See the following links for current repo information for Kibana and Curator. + * [https://www.elastic.co/guide/en/kibana/current/rpm.html](https://www.elastic.co/guide/en/kibana/current/rpm.html) + * [https://www.elastic.co/guide/en/elasticsearch/client/curator/current/yum-repository.html](https://www.elastic.co/guide/en/elasticsearch/client/curator/current/yum-repository.html) + + Modify the baseurl's and repoid's in `metron/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/KIBANA/${YOUR_VERSION_NUMBER_HERE}/repos/repoinfo.xml`, e.g. + + ``` + https://artifacts.elastic.co/packages/5.x/yum + kibana-5.x + KIBANA + ... + http://packages.elastic.co/curator/5/centos/6 + ES-Curator-5.x + CURATOR + ``` + +1. Update metainfo.xml + + Change the version number in `metron/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/KIBANA/${YOUR_VERSION_NUMBER_HERE}/metainfo.xml`. + Also make sure to update the "extends" version to point to the updated common-services version, e.g. + ``` + KIBANA + 5.6.2 + common-services/KIBANA/5.6.2 + ``` + +#### Update mpack.json + +1. Update the corresponding service_version in the service_versions_map, e.g. + + ``` + ... + "service_versions_map": [ + { + "service_name" : "KIBANA", + "service_version" : "5.6.2", + "applicable_stacks" : [ + ... + ] + }, + ... + ] + ... + ``` + diff --git a/metron-deployment/packaging/ambari/metron-mpack/README.md b/metron-deployment/packaging/ambari/metron-mpack/README.md index 17fc4f6061..5179b5fc77 100644 --- a/metron-deployment/packaging/ambari/metron-mpack/README.md +++ b/metron-deployment/packaging/ambari/metron-mpack/README.md @@ -92,13 +92,94 @@ A custom action is available in Ambari to import Zeppelin dashboards. See the [m #### Kibana Dashboards -The dashboards installed by the Kibana custom action are managed by the `dashboard.p` file. This file is created by exporting existing dashboards from a running Kibana instance. - -To create a new version of the file, make any necessary changes to Kibana and run the following commands to export your changes. - ``` - cd packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/4.5.1/package/scripts/dashboard - python dashboardindex.py $ES_HOST 9200 dashboard.p -s - ``` +The dashboards installed by the Kibana custom action are managed by two JSON files: +* metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/5.6.2/package/scripts/dashboard/kibana.template +* metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/5.6.2/package/scripts/dashboard/dashboard-bulkload.json + +The first file, `kibana.template`, is an Elasticsearch template that specifies the proper mapping types for the Kibana index. This configuration is necessary due to a bug +in the default dynamic mappings provided by Elasticsearch for long types versus integer that are incompatible with Kibana \[1\]. The second file, `dashboard-bulkload.json`, +contains all of the dashboard metadata necessary to create the Metron dashboard. It is an Elasticsearch bulk-insert formatted file \[2\] that contains a series +of documents necessary for setting up the dashboard in Elasticsearch. The main features installed are index patterns, searches, and a variety of visualizations +that are used in the Metron dashboard. + +Deploying the existing dashboard is easy. Once the MPack is installed, run the Kibana service's action "Load Template" to install dashboards. This will no longer overwrite +the .kibana in Elasticsearch. The bulk load is configured to fail inserts for existing documents. If you want to _completely_ reload the dashboard, you would need to delete +the .kibana index and reload again from Ambari. + +1. [https://github.com/elastic/kibana/issues/9888#issuecomment-298096954](https://github.com/elastic/kibana/issues/9888#issuecomment-298096954) +2. [https://www.elastic.co/guide/en/elasticsearch/reference/5.6/docs-bulk.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/docs-bulk.html) + +##### Modifying Pre-Installed Dashboards + +You can modify dashboards in Kibana and bring those changes into the core MPack distribution by performing the following steps: + +1. Export the .kibana index from ES +2. Convert the data into the ES bulk load format +3. Replace the dashboard-bulkload.json file in the Kibana MPack. + +You can export the .kibana index using a tool like [https://github.com/taskrabbit/elasticsearch-dump](https://github.com/taskrabbit/elasticsearch-dump). The important +feature is to have one document per line. Here's an exmaple export using elasticsearch-dump + +``` +elasticdump \ + --input=http://node1:9200/.kibana \ + --output=~/dashboard-data.json \ + --type=data +``` + +Once you've exported the data, you can now format it as a bulk load ES file by running the import/export tool located in +metron-platform/metron-elasticsearch/src/main/java/org/apache/metron/elasticsearch/bulk/ElasticsearchImportExport.java. This tool can be run from full-dev +as follows + +``` +java -cp $METRON_HOME/lib/metron-elasticsearch-0.4.2-uber.jar org.apache.metron.elasticsearch.bulk.ElasticsearchImportExport \ + ~/dashboard-data.json \ + ~/dashboard-bulkload.json +``` + +Locate the "create" command for setting the default index by searching for "5.6.2". Change "create" to "index" so that it modifies the existing value. It should look similar to line 1 below. + +``` +{ "index" : { "_id": "5.6.2", "_type": "config" } } +{"defaultIndex":"AV-S2e81hKs1cXXnFMqN"} +``` + +Now copy this file to the Kibana MPack, overwriting the existing bulk load file. That should be everything needed to backup the dashboard. + +**Note**: the dashboard Python Pickle binary file is deprecated and no longer used for backing up and restoring Kibana dashboards. The tooling is still provided as of this +version but is expected to be removed in the future. A section describing the deprecated backup process remains below. + +##### Deprecated Dashboard Install/Backup Instructions + +The dashboards installed by the Kibana custom action are managed by the dashboard.p file. This file is created by exporting existing dashboards from a running Kibana instance. + +To create a new version of the file, make any necessary changes to Kibana (e.g. on full-dev), and export with the appropriate script. + +**Script Options** +``` +[elasticsearch_host] ES host +[elasticsearch_port] ES port number +[input_output_filename] Filename used for reading or writing out pickle file +[-s] Flag to indicate that the .kibana index should be saved locally. Not including this flag will overwrite the .kibana + index completely with the contents of 'input_output_filename'. Careful with this. +``` + +**Saving a Backup** +``` +python packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/5.6.2/package/scripts/dashboard/dashboardindex.py \ +$ES_HOST 9200 \ +~/dashboard.p -s +``` + +**Restoring From a Backup** +``` +python packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/5.6.2/package/scripts/dashboard/dashboardindex.py \ +$ES_HOST 9200 \ +~/dashboard.p +``` + +**Note**: This method of writing the Kibana dashboard to Elasticsearch will overwrite the entire .kibana index. Be sure to first backup the index first using either the new JSON +method described above, or writing out the dashboard.p pickle file using the old method (passing -s option to dashboardindex.py) described here. #### Offline Installation diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/ELASTICSEARCH/2.3.3/metainfo.xml b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/ELASTICSEARCH/5.6.2/metainfo.xml similarity index 89% rename from metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/ELASTICSEARCH/2.3.3/metainfo.xml rename to metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/ELASTICSEARCH/5.6.2/metainfo.xml index e2e6cddb09..accf7da071 100755 --- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/ELASTICSEARCH/2.3.3/metainfo.xml +++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/ELASTICSEARCH/5.6.2/metainfo.xml @@ -22,8 +22,8 @@ ELASTICSEARCH - 2.3.3 - common-services/ELASTICSEARCH/2.3.3 + 5.6.2 + common-services/ELASTICSEARCH/5.6.2 - \ No newline at end of file + diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/ELASTICSEARCH/2.3.3/repos/repoinfo.xml b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/ELASTICSEARCH/5.6.2/repos/repoinfo.xml similarity index 80% rename from metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/ELASTICSEARCH/2.3.3/repos/repoinfo.xml rename to metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/ELASTICSEARCH/5.6.2/repos/repoinfo.xml index 0a9caac3c1..2c645185b0 100644 --- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/ELASTICSEARCH/2.3.3/repos/repoinfo.xml +++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/ELASTICSEARCH/5.6.2/repos/repoinfo.xml @@ -16,15 +16,15 @@ - https://packages.elastic.co/elasticsearch/2.x/centos - elastic-2.x + https://artifacts.elastic.co/packages/5.x/yum + elasticsearch-5.x ELASTICSEARCH - https://packages.elastic.co/elasticsearch/2.x/centos - elasticsearch-2.x + https://artifacts.elastic.co/packages/5.x/yum + elasticsearch-5.x ELASTICSEARCH diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/KIBANA/4.5.1/metainfo.xml b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/KIBANA/5.6.2/metainfo.xml similarity index 91% rename from metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/KIBANA/4.5.1/metainfo.xml rename to metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/KIBANA/5.6.2/metainfo.xml index 494f71b355..8a4fba2873 100755 --- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/KIBANA/4.5.1/metainfo.xml +++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/KIBANA/5.6.2/metainfo.xml @@ -22,7 +22,8 @@ KIBANA - common-services/KIBANA/4.5.1 + 5.6.2 + common-services/KIBANA/5.6.2 diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/KIBANA/4.5.1/quicklinks/quicklinks.json b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/KIBANA/5.6.2/quicklinks/quicklinks.json similarity index 100% rename from metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/KIBANA/4.5.1/quicklinks/quicklinks.json rename to metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/KIBANA/5.6.2/quicklinks/quicklinks.json diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/KIBANA/4.5.1/repos/repoinfo.xml b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/KIBANA/5.6.2/repos/repoinfo.xml similarity index 73% rename from metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/KIBANA/4.5.1/repos/repoinfo.xml rename to metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/KIBANA/5.6.2/repos/repoinfo.xml index b05c2cfa09..d0bd284afe 100644 --- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/KIBANA/4.5.1/repos/repoinfo.xml +++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/addon-services/KIBANA/5.6.2/repos/repoinfo.xml @@ -16,25 +16,25 @@ - http://packages.elastic.co/kibana/4.5/centos - kibana-4.x + https://artifacts.elastic.co/packages/5.x/yum + kibana-5.x KIBANA - http://packages.elastic.co/curator/4/centos/6 - ES-Curator-4.x + http://packages.elastic.co/curator/5/centos/6 + ES-Curator-5.x CURATOR - http://packages.elastic.co/kibana/4.5/centos - kibana-4.x + https://artifacts.elastic.co/packages/5.x/yum + kibana-5.x KIBANA - http://packages.elastic.co/curator/4/centos/7 - ES-Curator-4.x + http://packages.elastic.co/curator/5/centos/7 + ES-Curator-5.x CURATOR diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/configuration/elastic-env.xml b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/configuration/elastic-env.xml similarity index 75% rename from metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/configuration/elastic-env.xml rename to metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/configuration/elastic-env.xml index a4de039abd..9e4f8ad266 100755 --- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/configuration/elastic-env.xml +++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/configuration/elastic-env.xml @@ -49,7 +49,6 @@ /var/run/elasticsearch The directory for pid files - content @@ -64,4 +63,24 @@ export JAVA_HOME={{java64_home}} export PATH=$PATH:$JAVA_HOME/bin + + elastic_user_nofile_limit + 65536 + Max open file limit for Elasticsearch user. + + + elastic_user_nproc_limit + 2048 + Max number of processes for Elasticsearch user. + + + elastic_user_memlock_soft_limit + unlimited + Max locked-in memory address space (soft memlock limit). + + + elastic_user_memlock_hard_limit + unlimited + Max locked-in memory address space (hard memlock limit). + diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/configuration/elastic-site.xml b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/configuration/elastic-site.xml similarity index 97% rename from metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/configuration/elastic-site.xml rename to metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/configuration/elastic-site.xml index 7369f921a9..34df1e49ab 100755 --- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/configuration/elastic-site.xml +++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/configuration/elastic-site.xml @@ -75,11 +75,6 @@ Set a custom port for the node to node communication - - discovery_zen_ping_multicast_enabled - false - Whether to use multicast - discovery_zen_ping_timeout 3s @@ -143,7 +138,7 @@ Percentage of heap used for write buffers - bootstrap_mlockall + bootstrap_memory_lock true The third option on Linux/Unix systems only, is to use mlockall to try to lock the process address space into RAM, preventing any Elasticsearch memory from being swapped out @@ -194,7 +189,7 @@ network_publish_host - + [] true diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/configuration/elastic-sysconfig.xml b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/configuration/elastic-sysconfig.xml similarity index 96% rename from metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/configuration/elastic-sysconfig.xml rename to metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/configuration/elastic-sysconfig.xml index 44ecf05ac4..d6db027e6d 100755 --- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/configuration/elastic-sysconfig.xml +++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/configuration/elastic-sysconfig.xml @@ -41,12 +41,12 @@ heap_size - 128m + 512m Heap size max_open_files - 65535 + 65536 Maximum number of open files @@ -63,9 +63,6 @@ # Directory where the Elasticsearch binary distribution resides ES_HOME={{elastic_home}} -# Heap Size (defaults to 256m min, 1g max) -ES_HEAP_SIZE={{heap_size}} - # Maximum number of open files MAX_OPEN_FILES={{max_open_files}} @@ -98,7 +95,8 @@ JAVA_HOME={{java64_home}} # Additional Java OPTS ES_JAVA_OPTS="-verbose:gc -Xloggc:{{log_dir}}/elasticsearch_gc.log -XX:-CMSConcurrentMTEnabled \ -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+PrintGCTimeStamps \ --XX:ErrorFile={{log_dir}}/elasticsearch_err.log -XX:ParallelGCThreads=8" +-XX:ErrorFile={{log_dir}}/elasticsearch_err.log -XX:ParallelGCThreads=8 \ +-Xms{{heap_size}} -Xmx{{heap_size}}" diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/metainfo.xml b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/metainfo.xml similarity index 97% rename from metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/metainfo.xml rename to metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/metainfo.xml index 4373e381db..3783d31eab 100755 --- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/metainfo.xml +++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/metainfo.xml @@ -22,7 +22,7 @@ ELASTICSEARCH Elasticsearch Indexing and Search - 2.3.3 + 5.6.2 ES_MASTER @@ -52,7 +52,7 @@ any - elasticsearch-2.3.3 + elasticsearch-5.6.2 diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/package/scripts/elastic.py b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/scripts/elastic.py similarity index 70% rename from metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/package/scripts/elastic.py rename to metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/scripts/elastic.py index c44d5ef686..e27e8bf7a1 100755 --- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/package/scripts/elastic.py +++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/scripts/elastic.py @@ -23,18 +23,22 @@ from resource_management.core.source import InlineTemplate from resource_management.core.source import Template from resource_management.core.resources import User +from resource_management.core.logger import Logger +from resource_management.libraries.functions import format as ambari_format def elastic(): import params + Logger.info("Creating user: {0}:{1}".format(params.elastic_user, params.elastic_group)) User(params.elastic_user, action = "create", groups = params.elastic_group) + params.path_data = params.path_data.replace('"', '') data_path = params.path_data.replace(' ', '').split(',') data_path[:] = [x.replace('"', '') for x in data_path] - directories = [params.log_dir, params.pid_dir, params.conf_dir] directories = directories + data_path + ["{0}/scripts".format(params.conf_dir)] + Logger.info("Creating directories: {0}".format(directories)) Directory(directories, create_parents=True, mode=0755, @@ -42,7 +46,7 @@ def elastic(): group=params.elastic_group ) - print "Master env: ""{0}/elastic-env.sh".format(params.conf_dir) + Logger.info("Master env: ""{0}/elastic-env.sh".format(params.conf_dir)) File("{0}/elastic-env.sh".format(params.conf_dir), owner=params.elastic_user, group=params.elastic_group, @@ -50,8 +54,7 @@ def elastic(): ) configurations = params.config['configurations']['elastic-site'] - - print "Master yml: ""{0}/elasticsearch.yml".format(params.conf_dir) + Logger.info("Master yml: ""{0}/elasticsearch.yml".format(params.conf_dir)) File("{0}/elasticsearch.yml".format(params.conf_dir), content=Template( "elasticsearch.master.yaml.j2", @@ -60,9 +63,24 @@ def elastic(): group=params.elastic_group ) - print "Master sysconfig: /etc/sysconfig/elasticsearch" + Logger.info("Master sysconfig: /etc/sysconfig/elasticsearch") File("/etc/sysconfig/elasticsearch", owner="root", group="root", content=InlineTemplate(params.sysconfig_template) ) + + # in some OS this folder may not exist, so create it + Logger.info("Ensure PAM limits directory exists: {0}".format(params.limits_conf_dir)) + Directory(params.limits_conf_dir, + create_parents=True, + owner='root', + group='root' + ) + + Logger.info("Master PAM limits: {0}".format(params.limits_conf_file)) + File(params.limits_conf_file, + content=Template('elasticsearch_limits.conf.j2'), + owner="root", + group="root" + ) diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/package/scripts/elastic_master.py b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/scripts/elastic_master.py similarity index 85% rename from metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/package/scripts/elastic_master.py rename to metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/scripts/elastic_master.py index 3cd63c302e..c3f089afd4 100755 --- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/package/scripts/elastic_master.py +++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/scripts/elastic_master.py @@ -28,44 +28,43 @@ class Elasticsearch(Script): def install(self, env): import params env.set_params(params) - Logger.info('Install ES Master Node') + Logger.info('Install Elasticsearch master node') self.install_packages(env) def configure(self, env, upgrade_type=None, config_dir=None): import params env.set_params(params) - + Logger.info('Configure Elasticsearch master node') elastic() def stop(self, env, upgrade_type=None): import params env.set_params(params) + Logger.info('Stop Elasticsearch master node') stop_cmd = "service elasticsearch stop" - print 'Stop the Master' Execute(stop_cmd) def start(self, env, upgrade_type=None): import params env.set_params(params) - + Logger.info('Start Elasticsearch master node') self.configure(env) start_cmd = "service elasticsearch start" - print 'Start the Master' Execute(start_cmd) def status(self, env): import params env.set_params(params) + Logger.info('Check status of Elasticsearch master node') status_cmd = "service elasticsearch status" - print 'Status of the Master' Execute(status_cmd) def restart(self, env): import params env.set_params(params) self.configure(env) + Logger.info('Restart Elasticsearch master node') restart_cmd = "service elasticsearch restart" - print 'Restarting the Master' Execute(restart_cmd) diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/package/scripts/elastic_slave.py b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/scripts/elastic_slave.py similarity index 85% rename from metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/package/scripts/elastic_slave.py rename to metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/scripts/elastic_slave.py index 633ddd9311..8aaee75290 100755 --- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/package/scripts/elastic_slave.py +++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/scripts/elastic_slave.py @@ -28,42 +28,43 @@ class Elasticsearch(Script): def install(self, env): import params env.set_params(params) - Logger.info('Install ES Data Node') + Logger.info('Install Elasticsearch data node') self.install_packages(env) def configure(self, env, upgrade_type=None, config_dir=None): import params env.set_params(params) + Logger.info('Configure Elasticsearch data node') slave() def stop(self, env, upgrade_type=None): import params env.set_params(params) + Logger.info('Stop Elasticsearch data node') stop_cmd = "service elasticsearch stop" - print 'Stop the Slave' Execute(stop_cmd) def start(self, env, upgrade_type=None): import params env.set_params(params) self.configure(env) + Logger.info('Start Elasticsearch data node') start_cmd = "service elasticsearch start" - print 'Start the Slave' Execute(start_cmd) def status(self, env): import params env.set_params(params) + Logger.info('Check status of Elasticsearch data node') status_cmd = "service elasticsearch status" - print 'Status of the Slave' Execute(status_cmd) def restart(self, env): import params env.set_params(params) self.configure(env) + Logger.info('Restart Elasticsearch data node') restart_cmd = "service elasticsearch restart" - print 'Restarting the Slave' Execute(restart_cmd) diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/package/scripts/params.py b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/scripts/params.py similarity index 82% rename from metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/package/scripts/params.py rename to metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/scripts/params.py index e7b8d85c0f..4adcf43dc5 100755 --- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/package/scripts/params.py +++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/scripts/params.py @@ -20,6 +20,12 @@ from resource_management.libraries.script import Script +def yamlify_variables(var) : + if isinstance(var, type(True)): + return str(var).lower() + else: + return var + # server configurations config = Script.get_config() @@ -53,7 +59,6 @@ recover_after_time = config['configurations']['elastic-site']['recover_after_time'] gateway_recover_after_data_nodes = config['configurations']['elastic-site']['gateway_recover_after_data_nodes'] expected_data_nodes = config['configurations']['elastic-site']['expected_data_nodes'] -discovery_zen_ping_multicast_enabled = config['configurations']['elastic-site']['discovery_zen_ping_multicast_enabled'] index_merge_scheduler_max_thread_count = config['configurations']['elastic-site']['index_merge_scheduler_max_thread_count'] index_translog_flush_threshold_size = config['configurations']['elastic-site']['index_translog_flush_threshold_size'] index_refresh_interval = config['configurations']['elastic-site']['index_refresh_interval'] @@ -61,14 +66,14 @@ index_number_of_shards = config['configurations']['elastic-site']['index_number_of_shards'] index_number_of_replicas = config['configurations']['elastic-site']['index_number_of_replicas'] indices_memory_index_buffer_size = config['configurations']['elastic-site']['indices_memory_index_buffer_size'] -bootstrap_mlockall = config['configurations']['elastic-site']['bootstrap_mlockall'] +bootstrap_memory_lock = yamlify_variables(config['configurations']['elastic-site']['bootstrap_memory_lock']) threadpool_bulk_queue_size = config['configurations']['elastic-site']['threadpool_bulk_queue_size'] cluster_routing_allocation_node_concurrent_recoveries = config['configurations']['elastic-site']['cluster_routing_allocation_node_concurrent_recoveries'] cluster_routing_allocation_disk_watermark_low = config['configurations']['elastic-site']['cluster_routing_allocation_disk_watermark_low'] -cluster_routing_allocation_disk_threshold_enabled = config['configurations']['elastic-site']['cluster_routing_allocation_disk_threshold_enabled'] +cluster_routing_allocation_disk_threshold_enabled = yamlify_variables(config['configurations']['elastic-site']['cluster_routing_allocation_disk_threshold_enabled']) cluster_routing_allocation_disk_watermark_high = config['configurations']['elastic-site']['cluster_routing_allocation_disk_watermark_high'] indices_fielddata_cache_size = config['configurations']['elastic-site']['indices_fielddata_cache_size'] -indices_cluster_send_refresh_mapping = config['configurations']['elastic-site']['indices_cluster_send_refresh_mapping'] +indices_cluster_send_refresh_mapping = yamlify_variables(config['configurations']['elastic-site']['indices_cluster_send_refresh_mapping']) threadpool_index_queue_size = config['configurations']['elastic-site']['threadpool_index_queue_size'] discovery_zen_ping_timeout = config['configurations']['elastic-site']['discovery_zen_ping_timeout'] @@ -78,3 +83,10 @@ network_host = config['configurations']['elastic-site']['network_host'] network_publish_host = config['configurations']['elastic-site']['network_publish_host'] + +limits_conf_dir = "/etc/security/limits.d" +limits_conf_file = limits_conf_dir + "/elasticsearch.conf" +elastic_user_nofile_limit = config['configurations']['elastic-env']['elastic_user_nofile_limit'] +elastic_user_nproc_limit = config['configurations']['elastic-env']['elastic_user_nproc_limit'] +elastic_user_memlock_soft_limit = config['configurations']['elastic-env']['elastic_user_memlock_soft_limit'] +elastic_user_memlock_hard_limit = config['configurations']['elastic-env']['elastic_user_memlock_hard_limit'] diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/package/scripts/properties_config.py b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/scripts/properties_config.py similarity index 100% rename from metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/package/scripts/properties_config.py rename to metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/scripts/properties_config.py diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/package/scripts/service_check.py b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/scripts/service_check.py similarity index 86% rename from metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/package/scripts/service_check.py rename to metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/scripts/service_check.py index e84fb010ee..d59954f837 100755 --- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/package/scripts/service_check.py +++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/scripts/service_check.py @@ -17,14 +17,12 @@ limitations under the License. """ -from __future__ import print_function - import subprocess import sys from resource_management.core.resources.system import Execute from resource_management.libraries.script import Script - +from resource_management.core.logger import Logger class ServiceCheck(Script): def service_check(self, env): @@ -34,7 +32,7 @@ def service_check(self, env): doc = '{"name": "Ambari Smoke test"}' index = "ambari_smoke_test" - print("Running Elastic search service check", file=sys.stdout) + Logger.info("Running Elastic search service check", file=sys.stdout) # Make sure the service is actually up. We can live without everything allocated. # Need both the retry and ES timeout. Can hit the URL before ES is ready at all and get no response, but can @@ -47,7 +45,6 @@ def service_check(self, env): ) # Put a document into a new index. - Execute("curl -XPUT '%s/%s/test/1' -d '%s'" % (host, index, doc), logoutput=True) # Retrieve the document. Use subprocess because we actually need the results here. @@ -55,7 +52,7 @@ def service_check(self, env): proc = subprocess.Popen(cmd_retrieve, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) (stdout, stderr) = proc.communicate() response_retrieve = stdout - print("Retrieval response is: %s" % response_retrieve) + Logger.info("Retrieval response is: %s" % response_retrieve) expected_retrieve = '{"_index":"%s","_type":"test","_id":"1","_version":1,"found":true,"_source":%s}' \ % (index, doc) @@ -64,13 +61,13 @@ def service_check(self, env): proc = subprocess.Popen(cmd_delete, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) (stdout, stderr) = proc.communicate() response_delete = stdout - print("Delete index response is: %s" % response_retrieve) + Logger.info("Delete index response is: %s" % response_retrieve) expected_delete = '{"acknowledged":true}' if (expected_retrieve == response_retrieve) and (expected_delete == response_delete): - print("Smoke test able to communicate with Elasticsearch") + Logger.info("Smoke test able to communicate with Elasticsearch") else: - print("Elasticsearch service unable to retrieve document.") + Logger.info("Elasticsearch service unable to retrieve document.") sys.exit(1) exit(0) diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/package/scripts/slave.py b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/scripts/slave.py similarity index 71% rename from metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/package/scripts/slave.py rename to metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/scripts/slave.py index 15a5cf50f0..a19989eddc 100755 --- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/package/scripts/slave.py +++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/scripts/slave.py @@ -23,18 +23,21 @@ from resource_management.core.source import InlineTemplate from resource_management.core.source import Template from resource_management.core.resources import User +from resource_management.core.logger import Logger def slave(): import params + Logger.info("Creating user: {0}:{1}".format(params.elastic_user, params.elastic_group)) User(params.elastic_user, action = "create", groups = params.elastic_group) + params.path_data = params.path_data.replace('"', '') data_path = params.path_data.replace(' ', '').split(',') data_path[:] = [x.replace('"', '') for x in data_path] - directories = [params.log_dir, params.pid_dir, params.conf_dir] directories = directories + data_path + Logger.info("Creating directories: {0}".format(directories)) Directory(directories, create_parents=True, mode=0755, @@ -48,19 +51,30 @@ def slave(): content=InlineTemplate(params.elastic_env_sh_template) ) - configurations = params.config['configurations']['elastic-site'] - - File("{0}/elasticsearch.yml".format(params.conf_dir), + elastic_site = params.config['configurations']['elastic-site'] + path = "{0}/elasticsearch.yml".format(params.conf_dir) + Logger.info("Creating ES slave configuration.") + File(path, content=Template( "elasticsearch.slave.yaml.j2", - configurations=configurations), + configurations=elastic_site), owner=params.elastic_user, group=params.elastic_group ) - print "Master sysconfig: /etc/sysconfig/elasticsearch" + Logger.info("Slave sysconfig: /etc/sysconfig/elasticsearch") File(format("/etc/sysconfig/elasticsearch"), owner="root", group="root", content=InlineTemplate(params.sysconfig_template) ) + + elastic_env = params.config['configurations']['elastic-env'] + Logger.info("Slave PAM limits: {0}".format(params.limits_conf_file)) + File(params.limits_conf_file, + content=Template( + 'elasticsearch_limits.conf.j2', + configurations=elastic_env), + owner="root", + group="root" + ) diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/package/scripts/status_params.py b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/scripts/status_params.py similarity index 100% rename from metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/package/scripts/status_params.py rename to metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/scripts/status_params.py diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/package/templates/elasticsearch.master.yaml.j2 b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/templates/elasticsearch.master.yaml.j2 similarity index 77% rename from metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/package/templates/elasticsearch.master.yaml.j2 rename to metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/templates/elasticsearch.master.yaml.j2 index f0d2a8f30d..8e20ba2b26 100755 --- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/package/templates/elasticsearch.master.yaml.j2 +++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/templates/elasticsearch.master.yaml.j2 @@ -27,8 +27,6 @@ cluster: discovery: zen: ping: - multicast: - enabled: {{ discovery_zen_ping_multicast_enabled }} unicast: hosts: {{zen_discovery_ping_unicast_hosts}} @@ -39,9 +37,10 @@ node: path: data: {{path_data}} -http.cors.enabled: {{http_cors_enabled}} +http: + port: {{http_port}} + cors.enabled: {{http_cors_enabled}} -port: {{http_port}} transport: tcp: @@ -51,26 +50,19 @@ gateway: recover_after_data_nodes: {{gateway_recover_after_data_nodes}} recover_after_time: {{recover_after_time}} expected_data_nodes: {{expected_data_nodes}} - -index: - number_of_shards: {{index_number_of_shards}} - merge.scheduler.max_thread_count: {{index_merge_scheduler_max_thread_count}} - translog.flush_threshold_size: {{index_translog_flush_threshold_size}} - refresh_interval: {{index_refresh_interval}} - number_of_replicas: {{index_number_of_replicas}} - +# https://www.elastic.co/guide/en/elasticsearch/guide/current/indexing-performance.html indices: + store.throttle.type: {{indices_memory_index_store_throttle_type}} memory: index_buffer_size: {{indices_memory_index_buffer_size}} - store.throttle.type: {{indices_memory_index_store_throttle_type}} fielddata: cache.size: {{indices_fielddata_cache_size}} - cluster: - send_refresh_mapping: {{indices_cluster_send_refresh_mapping}} -bootstrap.mlockall: {{bootstrap_mlockall}} +bootstrap: + memory_lock: {{bootstrap_memory_lock}} + system_call_filter: false -threadpool: +thread_pool: bulk: queue_size: {{threadpool_bulk_queue_size}} index: diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/package/templates/elasticsearch.slave.yaml.j2 b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/templates/elasticsearch.slave.yaml.j2 similarity index 77% rename from metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/package/templates/elasticsearch.slave.yaml.j2 rename to metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/templates/elasticsearch.slave.yaml.j2 index 7d2d0cf8a0..6bf8399d31 100755 --- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/package/templates/elasticsearch.slave.yaml.j2 +++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/templates/elasticsearch.slave.yaml.j2 @@ -27,8 +27,6 @@ cluster: discovery: zen: ping: - multicast: - enabled: {{discovery_zen_ping_multicast_enabled}} unicast: hosts: {{zen_discovery_ping_unicast_hosts}} @@ -39,9 +37,10 @@ node: path: data: {{path_data}} -http.cors.enabled: {{http_cors_enabled}} +http: + port: {{http_port}} + cors.enabled: {{http_cors_enabled}} -port: {{http_port}} transport: tcp: @@ -51,26 +50,20 @@ gateway: recover_after_data_nodes: {{gateway_recover_after_data_nodes}} recover_after_time: {{recover_after_time}} expected_data_nodes: {{expected_data_nodes}} - -index: - number_of_shards: {{index_number_of_shards}} - merge.scheduler.max_thread_count: {{index_merge_scheduler_max_thread_count}} - translog.flush_threshold_size: {{index_translog_flush_threshold_size}} - refresh_interval: {{index_refresh_interval}} - number_of_replicas: {{index_number_of_replicas}} - + +# https://www.elastic.co/guide/en/elasticsearch/guide/current/indexing-performance.html indices: + store.throttle.type: {{indices_memory_index_store_throttle_type}} memory: index_buffer_size: {{indices_memory_index_buffer_size}} - store.throttle.type: {{indices_memory_index_store_throttle_type}} fielddata: cache.size: {{indices_fielddata_cache_size}} - cluster: - send_refresh_mapping: {{indices_cluster_send_refresh_mapping}} -bootstrap.mlockall: {{bootstrap_mlockall}} +bootstrap: + memory_lock: {{bootstrap_memory_lock}} + system_call_filter: false -threadpool: +thread_pool: bulk: queue_size: {{threadpool_bulk_queue_size}} index: diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/templates/elasticsearch_limits.conf.j2 b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/templates/elasticsearch_limits.conf.j2 new file mode 100644 index 0000000000..99f72e1c2d --- /dev/null +++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/templates/elasticsearch_limits.conf.j2 @@ -0,0 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. + +{{elastic_user}} - nproc {{elastic_user_nproc_limit}} +{{elastic_user}} - nofile {{elastic_user_nofile_limit}} +{{elastic_user}} soft memlock {{elastic_user_memlock_soft_limit}} +{{elastic_user}} hard memlock {{elastic_user_memlock_hard_limit}} diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/quicklinks/quicklinks.json b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/quicklinks/quicklinks.json similarity index 100% rename from metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/quicklinks/quicklinks.json rename to metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/quicklinks/quicklinks.json diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/role_command_order.json b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/role_command_order.json similarity index 100% rename from metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/2.3.3/role_command_order.json rename to metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/role_command_order.json diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/4.5.1/package/scripts/dashboard/dashboard.p b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/4.5.1/package/scripts/dashboard/dashboard.p deleted file mode 100644 index efff33d42f..0000000000 --- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/4.5.1/package/scripts/dashboard/dashboard.p +++ /dev/null @@ -1,2341 +0,0 @@ -(lp1 -(dp2 -V_score -p3 -F1 -sV_type -p4 -Vindex-pattern -p5 -sV_id -p6 -Vbro* -p7 -sV_source -p8 -(dp9 -Vfields -p10 -V[{"name":"TTLs","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"qclass_name","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"bro_timestamp","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":true,"doc_values":false},{"name":"enrichments:geo:ip_dst_addr:location_point","type":"geo_point","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"answers","type":"ip","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"enrichmentjoinbolt:joiner:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"adapter:geoadapter:begin:ts","type":"date","count":1,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"resp_mime_types","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":true,"doc_values":false},{"name":"protocol","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"original_string","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":true,"doc_values":false},{"name":"adapter:threatinteladapter:end:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"host","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"adapter:geoadapter:end:ts","type":"date","count":1,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"AA","type":"boolean","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"method","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"enrichmentsplitterbolt:splitter:end:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"query","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"enrichments:geo:ip_dst_addr:city","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"rcode","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"adapter:hostfromjsonlistadapter:begin:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"orig_mime_types","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":true,"doc_values":false},{"name":"RA","type":"boolean","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"RD","type":"boolean","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"orig_fuids","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":true,"doc_values":false},{"name":"proto","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"adapter:threatinteladapter:begin:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"_source","type":"_source","count":0,"scripted":false,"indexed":false,"analyzed":false,"doc_values":false},{"name":"enrichments:geo:ip_dst_addr:country","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"response_body_len","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"enrichments:geo:ip_dst_addr:locID","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"qtype_name","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"status_code","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"_index","type":"string","count":0,"scripted":false,"indexed":false,"analyzed":false,"doc_values":false},{"name":"ip_dst_port","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"enrichments:geo:ip_dst_addr:dmaCode","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"threatinteljoinbolt:joiner:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"rejected","type":"boolean","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"qtype","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"enrichmentsplitterbolt:splitter:begin:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"trans_id","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"enrichments:geo:ip_dst_addr:latitude","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"uid","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"source:type","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"trans_depth","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"ip_dst_addr","type":"ip","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"adapter:hostfromjsonlistadapter:end:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"Z","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"ip_src_addr","type":"ip","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"threatintelsplitterbolt:splitter:end:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"enrichments:geo:ip_dst_addr:longitude","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"user_agent","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":true,"doc_values":false},{"name":"qclass","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"timestamp","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"resp_fuids","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":true,"doc_values":false},{"name":"request_body_len","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"enrichments:geo:ip_dst_addr:postalCode","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"uri","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"rcode_name","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"TC","type":"boolean","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"referrer","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"ip_src_port","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"status_msg","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"threatintelsplitterbolt:splitter:begin:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"_id","type":"string","count":0,"scripted":false,"indexed":false,"analyzed":false,"doc_values":false},{"name":"_type","type":"string","count":1,"scripted":false,"indexed":false,"analyzed":false,"doc_values":false},{"name":"_score","type":"number","count":2,"scripted":false,"indexed":false,"analyzed":false,"doc_values":false}] -p11 -sVtimeFieldName -p12 -Vtimestamp -p13 -sVtitle -p14 -Vbro* -p15 -ssV_index -p16 -V.kibana -p17 -sa(dp18 -V_score -p19 -F1 -sV_type -p20 -Vsearch -p21 -sV_id -p22 -Vsnort-search -p23 -sV_source -p24 -(dp25 -Vsort -p26 -(lp27 -Vtimestamp -p28 -aVdesc -p29 -asVhits -p30 -I0 -sVdescription -p31 -V -sVtitle -p32 -VSnort Alerts -p33 -sVversion -p34 -I1 -sVkibanaSavedObjectMeta -p35 -(dp36 -VsearchSourceJSON -p37 -V{"index":"snort*","query":{"query_string":{"analyze_wildcard":true,"query":"*"}},"filter":[],"highlight":{"pre_tags":["@kibana-highlighted-field@"],"post_tags":["@/kibana-highlighted-field@"],"fields":{"*":{}},"require_field_match":false,"fragment_size":2147483647}} -p38 -ssVcolumns -p39 -(lp40 -Vmsg -p41 -aVsig_id -p42 -aVip_src_addr -p43 -aVip_src_port -p44 -aVip_dst_addr -p45 -aVip_dst_port -p46 -assV_index -p47 -V.kibana -p48 -sa(dp49 -V_score -p50 -F1 -sV_type -p51 -Vsearch -p52 -sV_id -p53 -Vyaf-search -p54 -sV_source -p55 -(dp56 -Vsort -p57 -(lp58 -Vtimestamp -p59 -aVdesc -p60 -asVhits -p61 -I0 -sVdescription -p62 -V -sVtitle -p63 -VYAF -p64 -sVversion -p65 -I1 -sVkibanaSavedObjectMeta -p66 -(dp67 -VsearchSourceJSON -p68 -V{"index":"yaf*","filter":[],"highlight":{"pre_tags":["@kibana-highlighted-field@"],"post_tags":["@/kibana-highlighted-field@"],"fields":{"*":{}},"require_field_match":false,"fragment_size":2147483647},"query":{"query_string":{"query":"*","analyze_wildcard":true}}} -p69 -ssVcolumns -p70 -(lp71 -Vip_src_addr -p72 -aVip_src_port -p73 -aVip_dst_addr -p74 -aVip_dst_port -p75 -aVprotocol -p76 -aVduration -p77 -aVpkt -p78 -assV_index -p79 -V.kibana -p80 -sa(dp81 -V_score -p82 -F1 -sV_type -p83 -Vvisualization -p84 -sV_id -p85 -VWelcome -p86 -sV_source -p87 -(dp88 -VvisState -p89 -V{"title":"Welcome to Apache Metron","type":"markdown","params":{"markdown":"This dashboard enables the validation of Apache Metron and the end-to-end functioning of its default sensor suite. The default sensor suite includes [Snort](https://www.snort.org/), [Bro](https://www.bro.org/), and [YAF](https://tools.netsa.cert.org/yaf/). One of Apache Metron's primary goals is to simplify the onboarding of additional sources of telemetry. In a production deployment these default sensors should be replaced with ones applicable to the target environment.\u005cn\u005cnApache Metron enables disparate sources of telemetry to all be viewed under a 'single pane of glass.' Telemetry from each of the default sensors can be searched, aggregated, summarized, and viewed within this dashboard. This dashboard should be used as a springboard upon which to create your own customized dashboards.\u005cn\u005cnThe panels below highlight the volume and variety of events that are currently being consumed by Apache Metron."},"aggs":[],"listeners":{}} -p90 -sVdescription -p91 -V -sVtitle -p92 -VWelcome to Apache Metron -p93 -sVuiStateJSON -p94 -V{} -p95 -sVversion -p96 -I1 -sVkibanaSavedObjectMeta -p97 -(dp98 -VsearchSourceJSON -p99 -V{"query":{"query_string":{"analyze_wildcard":true,"query":"*"}},"filter":[]} -p100 -sssV_index -p101 -V.kibana -p102 -sa(dp103 -V_score -p104 -F1 -sV_type -p105 -Vvisualization -p106 -sV_id -p107 -VTop-Snort-Alerts-by-Source -p108 -sV_source -p109 -(dp110 -VvisState -p111 -V{"title":"Top Snort Alerts by Source","type":"table","params":{"perPage":10,"showPartialRows":false,"showMeticsAtAllLevels":false},"aggs":[{"id":"1","type":"count","schema":"metric","params":{}},{"id":"2","type":"terms","schema":"bucket","params":{"field":"ip_src_addr","size":10,"order":"desc","orderBy":"1","customLabel":"Source IP"}}],"listeners":{}} -p112 -sVdescription -p113 -V -sVtitle -p114 -VTop Snort Alerts by Source -p115 -sVuiStateJSON -p116 -V{} -p117 -sVversion -p118 -I1 -sVkibanaSavedObjectMeta -p119 -(dp120 -VsearchSourceJSON -p121 -V{"index":"snort*","query":{"query_string":{"query":"*","analyze_wildcard":true}},"filter":[]} -p122 -sssV_index -p123 -V.kibana -p124 -sa(dp125 -V_score -p126 -F1 -sV_type -p127 -Vvisualization -p128 -sV_id -p129 -VWeb-Request-Type -p130 -sV_source -p131 -(dp132 -VvisState -p133 -V{"title":"Web Request Type","type":"pie","params":{"shareYAxis":true,"addTooltip":true,"addLegend":true,"isDonut":false},"aggs":[{"id":"1","type":"count","schema":"metric","params":{}},{"id":"2","type":"terms","schema":"segment","params":{"field":"method","size":5,"order":"desc","orderBy":"1"}}],"listeners":{}} -p134 -sVdescription -p135 -V -sVtitle -p136 -VWeb Request Type -p137 -sVuiStateJSON -p138 -V{} -p139 -sVversion -p140 -I1 -sVsavedSearchId -p141 -Vweb-search -p142 -sVkibanaSavedObjectMeta -p143 -(dp144 -VsearchSourceJSON -p145 -V{"filter":[]} -p146 -sssV_index -p147 -V.kibana -p148 -sa(dp149 -V_score -p150 -F1 -sV_type -p151 -Vconfig -p152 -sV_id -p153 -V4.5.1 -p154 -sV_source -p155 -(dp156 -VbuildNum -p157 -I9892 -sVdefaultIndex -p158 -Vbro* -p159 -ssV_index -p160 -V.kibana -p161 -sa(dp162 -V_score -p163 -F1 -sV_type -p164 -Vvisualization -p165 -sV_id -p166 -VErrors-By-Hostname -p167 -sV_source -p168 -(dp169 -VvisState -p170 -V{\u000a "title": "Errors By Error Type",\u000a "type": "histogram",\u000a "params": {\u000a "addLegend": true,\u000a "addTimeMarker": false,\u000a "addTooltip": true,\u000a "defaultYExtents": false,\u000a "mode": "grouped",\u000a "scale": "linear",\u000a "setYExtents": false,\u000a "shareYAxis": true,\u000a "times": [],\u000a "yAxis": {}\u000a },\u000a "aggs": [\u000a {\u000a "id": "1",\u000a "type": "count",\u000a "schema": "metric",\u000a "params": {\u000a "customLabel": "Count"\u000a }\u000a },\u000a {\u000a "id": "2",\u000a "type": "terms",\u000a "schema": "segment",\u000a "params": {\u000a "field": "hostname",\u000a "size": 5,\u000a "order": "desc",\u000a "orderBy": "1"\u000a }\u000a },\u000a {\u000a "id": "4",\u000a "type": "cardinality",\u000a "schema": "metric",\u000a "params": {\u000a "field": "error_hash",\u000a "customLabel": "Unique Datapoint Count"\u000a }\u000a }\u000a ],\u000a "listeners": {}\u000a} -p171 -sVdescription -p172 -V -sVtitle -p173 -VErrors By Hostname -p174 -sVuiStateJSON -p175 -V{\u000a "vis": {\u000a "colors": {\u000a "Unique Datapoint Count": "#9AC48A",\u000a "Count": "#629E51"\u000a }\u000a }\u000a} -p176 -sVversion -p177 -I1 -sVkibanaSavedObjectMeta -p178 -(dp179 -VsearchSourceJSON -p180 -V{\u000a "index": "error*",\u000a "query": {\u000a "query_string": {\u000a "analyze_wildcard": true,\u000a "query": "*"\u000a }\u000a },\u000a "filter": []\u000a} -p181 -sssV_index -p182 -V.kibana -p183 -sa(dp184 -V_score -p185 -F1 -sV_type -p186 -Vvisualization -p187 -sV_id -p188 -VWeb-Request-Header -p189 -sV_source -p190 -(dp191 -VvisState -p192 -V{"title":"Web Request Header","type":"markdown","params":{"markdown":"The [Bro Network Security Monitor](https://www.bro.org/) is extracting application-level information from raw network packets. In this example, Bro is extracting HTTP(S) requests being made over the network. "},"aggs":[],"listeners":{}} -p193 -sVdescription -p194 -V -sVtitle -p195 -VWeb Request Header -p196 -sVuiStateJSON -p197 -V{} -p198 -sVversion -p199 -I1 -sVkibanaSavedObjectMeta -p200 -(dp201 -VsearchSourceJSON -p202 -V{"query":{"query_string":{"query":"*","analyze_wildcard":true}},"filter":[]} -p203 -sssV_index -p204 -V.kibana -p205 -sa(dp206 -V_score -p207 -F1 -sV_type -p208 -Vvisualization -p209 -sV_id -p210 -VError-Type-Proportion -p211 -sV_source -p212 -(dp213 -VvisState -p214 -V{"title":"Error Type Proportion","type":"pie","params":{"shareYAxis":true,"addTooltip":true,"addLegend":true,"isDonut":false},"aggs":[{"id":"1","type":"count","schema":"metric","params":{}},{"id":"2","type":"terms","schema":"segment","params":{"field":"error_type","size":5,"order":"desc","orderBy":"1"}}],"listeners":{}} -p215 -sVdescription -p216 -V -sVtitle -p217 -VError Type Proportion -p218 -sVuiStateJSON -p219 -V{} -p220 -sVversion -p221 -I1 -sVkibanaSavedObjectMeta -p222 -(dp223 -VsearchSourceJSON -p224 -V{"index":"error*","query":{"query_string":{"query":"*","analyze_wildcard":true}},"filter":[]} -p225 -sssV_index -p226 -V.kibana -p227 -sa(dp228 -V_score -p229 -F1 -sV_type -p230 -Vvisualization -p231 -sV_id -p232 -VFlow-Duration -p233 -sV_source -p234 -(dp235 -VvisState -p236 -V{"title":"Flow Duration","type":"area","params":{"shareYAxis":true,"addTooltip":true,"addLegend":true,"smoothLines":false,"scale":"linear","interpolate":"linear","mode":"stacked","times":[],"addTimeMarker":false,"defaultYExtents":false,"setYExtents":false,"yAxis":{}},"aggs":[{"id":"1","type":"count","schema":"metric","params":{}},{"id":"2","type":"histogram","schema":"segment","params":{"field":"duration","interval":10,"extended_bounds":{},"customLabel":"Flow Duration (seconds)"}}],"listeners":{}} -p237 -sVdescription -p238 -V -sVtitle -p239 -VFlow Duration -p240 -sVuiStateJSON -p241 -V{"vis":{"legendOpen":false}} -p242 -sVversion -p243 -I1 -sVkibanaSavedObjectMeta -p244 -(dp245 -VsearchSourceJSON -p246 -V{"index":"yaf*","query":{"query_string":{"query":"*","analyze_wildcard":true}},"filter":[]} -p247 -sssV_index -p248 -V.kibana -p249 -sa(dp250 -V_score -p251 -F1 -sV_type -p252 -Vvisualization -p253 -sV_id -p254 -VErrors-By-Source -p255 -sV_source -p256 -(dp257 -VvisState -p258 -V{"title":"Errors By Source","type":"histogram","params":{"shareYAxis":true,"addTooltip":true,"addLegend":true,"scale":"linear","mode":"stacked","times":[],"addTimeMarker":false,"defaultYExtents":false,"setYExtents":false,"yAxis":{}},"aggs":[{"id":"1","type":"count","schema":"metric","params":{}},{"id":"2","type":"terms","schema":"segment","params":{"field":"source_type","size":5,"order":"desc","orderBy":"1","customLabel":"Source"}}],"listeners":{}} -p259 -sVdescription -p260 -V -sVtitle -p261 -VErrors By Source -p262 -sVuiStateJSON -p263 -V{} -p264 -sVversion -p265 -I1 -sVkibanaSavedObjectMeta -p266 -(dp267 -VsearchSourceJSON -p268 -V{"index":"error*","query":{"query_string":{"query":"*","analyze_wildcard":true}},"filter":[]} -p269 -sssV_index -p270 -V.kibana -p271 -sa(dp272 -V_score -p273 -F1 -sV_type -p274 -Vvisualization -p275 -sV_id -p276 -VEvents -p277 -sV_source -p278 -(dp279 -VvisState -p280 -V{"title":"Events","type":"histogram","params":{"shareYAxis":true,"addTooltip":true,"addLegend":true,"scale":"linear","mode":"stacked","times":[],"addTimeMarker":false,"defaultYExtents":false,"setYExtents":false,"yAxis":{}},"aggs":[{"id":"1","type":"count","schema":"metric","params":{}},{"id":"2","type":"date_histogram","schema":"segment","params":{"field":"timestamp","interval":"auto","customInterval":"2h","min_doc_count":1,"extended_bounds":{}}},{"id":"3","type":"terms","schema":"group","params":{"field":"source:type","size":5,"order":"desc","orderBy":"1"}}],"listeners":{}} -p281 -sVdescription -p282 -V -sVtitle -p283 -VEvents -p284 -sVuiStateJSON -p285 -V{"vis":{"legendOpen":false}} -p286 -sVversion -p287 -I1 -sVkibanaSavedObjectMeta -p288 -(dp289 -VsearchSourceJSON -p290 -V{"index":["yaf*","bro*","snort*"],"query":{"query_string":{"query":"*","analyze_wildcard":true}},"filter":[]} -p291 -sssV_index -p292 -V.kibana -p293 -sa(dp294 -V_score -p295 -F1 -sV_type -p296 -Vvisualization -p297 -sV_id -p298 -VError-Hostname-Proportion -p299 -sV_source -p300 -(dp301 -VvisState -p302 -V{"aggs":[{"id":"1","params":{},"schema":"metric","type":"count"},{"id":"2","params":{"customLabel":"Sensor","field":"hostname","order":"desc","orderBy":"1","size":5},"schema":"segment","type":"terms"}],"listeners":{},"params":{"addLegend":true,"addTooltip":true,"isDonut":false,"shareYAxis":true},"title":"Error Source Proportion","type":"pie"} -p303 -sVdescription -p304 -V -sVtitle -p305 -VError Hostname Proportion -p306 -sVuiStateJSON -p307 -V{"vis":{"colors":{"host":"#629E51","host2":"#9AC48A","hostAnother":"#7EB26D","hostNew":"#B7DBAB"}}} -p308 -sVversion -p309 -I1 -sVkibanaSavedObjectMeta -p310 -(dp311 -VsearchSourceJSON -p312 -V{"index":"error*","query":{"query_string":{"analyze_wildcard":true,"query":"*"}},"filter":[]} -p313 -sssV_index -p314 -V.kibana -p315 -sa(dp316 -V_score -p317 -F1 -sV_type -p318 -Vvisualization -p319 -sV_id -p320 -VUnique-Error-Messages -p321 -sV_source -p322 -(dp323 -VvisState -p324 -V{\u000a "title": "Total Unique Error Messages",\u000a "type": "metric",\u000a "params": {\u000a "handleNoResults": true,\u000a "fontSize": 60\u000a },\u000a "aggs": [\u000a {\u000a "id": "1",\u000a "type": "cardinality",\u000a "schema": "metric",\u000a "params": {\u000a "field": "error_hash",\u000a "customLabel": "Unique Error Messages"\u000a }\u000a }\u000a ],\u000a "listeners": {}\u000a} -p325 -sVdescription -p326 -V -sVtitle -p327 -VUnique Error Messages -p328 -sVuiStateJSON -p329 -V{} -p330 -sVversion -p331 -I1 -sVkibanaSavedObjectMeta -p332 -(dp333 -VsearchSourceJSON -p334 -V{\u000a "index": "error*",\u000a "query": {\u000a "query_string": {\u000a "query": "*",\u000a "analyze_wildcard": true\u000a }\u000a },\u000a "filter": []\u000a} -p335 -sssV_index -p336 -V.kibana -p337 -sa(dp338 -V_score -p339 -F1 -sV_type -p340 -Vvisualization -p341 -sV_id -p342 -VErrors-By-Error-Type -p343 -sV_source -p344 -(dp345 -VvisState -p346 -V{\u000a "title": "Errors By Error Type",\u000a "type": "histogram",\u000a "params": {\u000a "addLegend": true,\u000a "addTimeMarker": false,\u000a "addTooltip": true,\u000a "defaultYExtents": false,\u000a "mode": "grouped",\u000a "scale": "linear",\u000a "setYExtents": false,\u000a "shareYAxis": true,\u000a "times": [],\u000a "yAxis": {}\u000a },\u000a "aggs": [\u000a {\u000a "id": "1",\u000a "type": "count",\u000a "schema": "metric",\u000a "params": {\u000a "customLabel": "Count"\u000a }\u000a },\u000a {\u000a "id": "2",\u000a "type": "terms",\u000a "schema": "segment",\u000a "params": {\u000a "field": "error_type",\u000a "size": 5,\u000a "order": "desc",\u000a "orderBy": "1"\u000a }\u000a },\u000a {\u000a "id": "4",\u000a "type": "cardinality",\u000a "schema": "metric",\u000a "params": {\u000a "field": "error_hash",\u000a "customLabel": "Unique Datapoint Count"\u000a }\u000a }\u000a ],\u000a "listeners": {}\u000a} -p347 -sVdescription -p348 -V -sVtitle -p349 -VErrors By Error Type -p350 -sVuiStateJSON -p351 -V{\u000a "vis": {\u000a "colors": {\u000a "Unique Datapoint Count": "#806EB7",\u000a "Count": "#614D93"\u000a }\u000a }\u000a} -p352 -sVversion -p353 -I1 -sVkibanaSavedObjectMeta -p354 -(dp355 -VsearchSourceJSON -p356 -V{\u000a "index": "error*",\u000a "query": {\u000a "query_string": {\u000a "analyze_wildcard": true,\u000a "query": "*"\u000a }\u000a },\u000a "filter": []\u000a} -p357 -sssV_index -p358 -V.kibana -p359 -sa(dp360 -V_score -p361 -F1 -sV_type -p362 -Vsearch -p363 -sV_id -p364 -VErrors -p365 -sV_source -p366 -(dp367 -Vsort -p368 -(lp369 -Vtimestamp -p370 -aVdesc -p371 -asVhits -p372 -I0 -sVdescription -p373 -V -sVtitle -p374 -VErrors -p375 -sVversion -p376 -I1 -sVkibanaSavedObjectMeta -p377 -(dp378 -VsearchSourceJSON -p379 -V{"index":"error*","query":{"query_string":{"analyze_wildcard":true,"query":"*"}},"filter":[],"highlight":{"pre_tags":["@kibana-highlighted-field@"],"post_tags":["@/kibana-highlighted-field@"],"fields":{"*":{}},"require_field_match":false,"fragment_size":2147483647}} -p380 -ssVcolumns -p381 -(lp382 -Vfailed_sensor_type -p383 -aVerror_type -p384 -aVexception -p385 -aVhostname -p386 -aVmessage -p387 -aVraw_message -p388 -aVerror_hash -p389 -assV_index -p390 -V.kibana -p391 -sa(dp392 -V_score -p393 -F1 -sV_type -p394 -Vvisualization -p395 -sV_id -p396 -VSnort-Header -p397 -sV_source -p398 -(dp399 -VvisState -p400 -V{"title":"Snort","type":"markdown","params":{"markdown":"[Snort](https://www.snort.org/) is a Network Intrusion Detection System (NIDS) that is being used to generate alerts identifying known bad events. Snort relies on a fixed set of rules that act as signatures for identifying abnormal events."},"aggs":[],"listeners":{}} -p401 -sVdescription -p402 -V -sVtitle -p403 -VSnort -p404 -sVuiStateJSON -p405 -V{} -p406 -sVversion -p407 -I1 -sVkibanaSavedObjectMeta -p408 -(dp409 -VsearchSourceJSON -p410 -V{"query":{"query_string":{"query":"*","analyze_wildcard":true}},"filter":[]} -p411 -sssV_index -p412 -V.kibana -p413 -sa(dp414 -V_score -p415 -F1 -sV_type -p416 -Vvisualization -p417 -sV_id -p418 -VYAF-Flow(s) -p419 -sV_source -p420 -(dp421 -VvisState -p422 -V{"title":"YAF Flows","type":"metric","params":{"handleNoResults":true,"fontSize":60},"aggs":[{"id":"1","type":"count","schema":"metric","params":{}}],"listeners":{}} -p423 -sVdescription -p424 -V -sVtitle -p425 -VYAF Flows -p426 -sVuiStateJSON -p427 -V{} -p428 -sVversion -p429 -I1 -sVkibanaSavedObjectMeta -p430 -(dp431 -VsearchSourceJSON -p432 -V{"index":"yaf*","query":{"query_string":{"query":"*","analyze_wildcard":true}},"filter":[]} -p433 -sssV_index -p434 -V.kibana -p435 -sa(dp436 -V_score -p437 -F1 -sV_type -p438 -Vvisualization -p439 -sV_id -p440 -VTop-DNS-Query -p441 -sV_source -p442 -(dp443 -VvisState -p444 -V{"title":"Top DNS Query","type":"table","params":{"perPage":10,"showPartialRows":false,"showMeticsAtAllLevels":false},"aggs":[{"id":"1","type":"count","schema":"metric","params":{}},{"id":"2","type":"terms","schema":"bucket","params":{"field":"query","size":10,"order":"desc","orderBy":"1"}}],"listeners":{}} -p445 -sVdescription -p446 -V -sVtitle -p447 -VTop DNS Query -p448 -sVuiStateJSON -p449 -V{} -p450 -sVversion -p451 -I1 -sVkibanaSavedObjectMeta -p452 -(dp453 -VsearchSourceJSON -p454 -V{"index":"bro*","query":{"query_string":{"query":"*","analyze_wildcard":true}},"filter":[]} -p455 -sssV_index -p456 -V.kibana -p457 -sa(dp458 -V_score -p459 -F1 -sV_type -p460 -Vvisualization -p461 -sV_id -p462 -VEvent-Types -p463 -sV_source -p464 -(dp465 -VvisState -p466 -V{"title":"Event Sources","type":"pie","params":{"shareYAxis":true,"addTooltip":true,"addLegend":true,"isDonut":false},"aggs":[{"id":"1","type":"count","schema":"metric","params":{}},{"id":"2","type":"terms","schema":"segment","params":{"field":"source:type","size":10,"order":"desc","orderBy":"1"}}],"listeners":{}} -p467 -sVdescription -p468 -V -sVtitle -p469 -VEvent Sources -p470 -sVuiStateJSON -p471 -V{} -p472 -sVversion -p473 -I1 -sVkibanaSavedObjectMeta -p474 -(dp475 -VsearchSourceJSON -p476 -V{"index":["yaf*","bro*","snort*"],"query":{"query_string":{"query":"*","analyze_wildcard":true}},"filter":[]} -p477 -sssV_index -p478 -V.kibana -p479 -sa(dp480 -V_score -p481 -F1 -sV_type -p482 -Vvisualization -p483 -sV_id -p484 -VTotal-Events -p485 -sV_source -p486 -(dp487 -VvisState -p488 -V{"title":"Event Count","type":"metric","params":{"handleNoResults":true,"fontSize":60},"aggs":[{"id":"1","type":"count","schema":"metric","params":{"customLabel":"Events"}}],"listeners":{}} -p489 -sVdescription -p490 -V -sVtitle -p491 -VEvent Count -p492 -sVuiStateJSON -p493 -V{} -p494 -sVversion -p495 -I1 -sVkibanaSavedObjectMeta -p496 -(dp497 -VsearchSourceJSON -p498 -V{"index":["yaf*","bro*","snort*"],"query":{"query_string":{"query":"*","analyze_wildcard":true}},"filter":[]} -p499 -sssV_index -p500 -V.kibana -p501 -sa(dp502 -V_score -p503 -F1 -sV_type -p504 -Vvisualization -p505 -sV_id -p506 -VUnique-Location(s) -p507 -sV_source -p508 -(dp509 -VvisState -p510 -V{"title":"Geo-IP Locations","type":"metric","params":{"handleNoResults":true,"fontSize":60},"aggs":[{"id":"1","type":"cardinality","schema":"metric","params":{"field":"enrichments:geo:ip_src_addr:locID","customLabel":"Unique Location(s)"}}],"listeners":{}} -p511 -sVdescription -p512 -V -sVtitle -p513 -VGeo-IP Locations -p514 -sVuiStateJSON -p515 -V{} -p516 -sVversion -p517 -I1 -sVkibanaSavedObjectMeta -p518 -(dp519 -VsearchSourceJSON -p520 -V{"index":["yaf*","bro*","snort*"],"query":{"query_string":{"query":"*","analyze_wildcard":true}},"filter":[]} -p521 -sssV_index -p522 -V.kibana -p523 -sa(dp524 -V_score -p525 -F1 -sV_type -p526 -Vvisualization -p527 -sV_id -p528 -VTop-Alerts-By-Host -p529 -sV_source -p530 -(dp531 -VvisState -p532 -V{"title":"Top Alerts By Host","type":"table","params":{"perPage":10,"showPartialRows":false,"showMeticsAtAllLevels":false},"aggs":[{"id":"1","type":"count","schema":"metric","params":{}},{"id":"2","type":"terms","schema":"bucket","params":{"field":"ip_src_addr","size":5,"order":"desc","orderBy":"1","customLabel":"Source"}},{"id":"3","type":"terms","schema":"bucket","params":{"field":"ip_dst_addr","size":5,"order":"desc","orderBy":"1","customLabel":"Destination"}}],"listeners":{}} -p533 -sVdescription -p534 -V -sVtitle -p535 -VTop Alerts By Host -p536 -sVuiStateJSON -p537 -V{} -p538 -sVversion -p539 -I1 -sVsavedSearchId -p540 -Vsnort-search -p541 -sVkibanaSavedObjectMeta -p542 -(dp543 -VsearchSourceJSON -p544 -V{"filter":[]} -p545 -sssV_index -p546 -V.kibana -p547 -sa(dp548 -V_score -p549 -F1 -sV_type -p550 -Vvisualization -p551 -sV_id -p552 -VTotal-Error-Messages -p553 -sV_source -p554 -(dp555 -VvisState -p556 -V{"title":"Total Errored Messages","type":"metric","params":{"handleNoResults":true,"fontSize":60},"aggs":[{"id":"1","type":"count","schema":"metric","params":{"customLabel":"Total Error Messages"}}],"listeners":{}} -p557 -sVdescription -p558 -V -sVtitle -p559 -VTotal Error Messages -p560 -sVuiStateJSON -p561 -V{} -p562 -sVversion -p563 -I1 -sVkibanaSavedObjectMeta -p564 -(dp565 -VsearchSourceJSON -p566 -V{"index":"error*","query":{"query_string":{"query":"*","analyze_wildcard":true}},"filter":[]} -p567 -sssV_index -p568 -V.kibana -p569 -sa(dp570 -V_score -p571 -F1 -sV_type -p572 -Vvisualization -p573 -sV_id -p574 -VErrors-By-Source-Type -p575 -sV_source -p576 -(dp577 -VvisState -p578 -V{\u000a "title": "Errors By Source Type",\u000a "type": "histogram",\u000a "params": {\u000a "shareYAxis": true,\u000a "addTooltip": true,\u000a "addLegend": true,\u000a "scale": "linear",\u000a "mode": "grouped",\u000a "times": [],\u000a "addTimeMarker": false,\u000a "defaultYExtents": false,\u000a "setYExtents": false,\u000a "yAxis": {}\u000a },\u000a "aggs": [\u000a {\u000a "id": "1",\u000a "type": "count",\u000a "schema": "metric",\u000a "params": {\u000a "customLabel": "Count"\u000a }\u000a },\u000a {\u000a "id": "2",\u000a "type": "terms",\u000a "schema": "segment",\u000a "params": {\u000a "field": "failed_sensor_type",\u000a "size": 5,\u000a "order": "desc",\u000a "orderBy": "1"\u000a }\u000a },\u000a {\u000a "id": "4",\u000a "type": "cardinality",\u000a "schema": "metric",\u000a "params": {\u000a "field": "error_hash",\u000a "customLabel": "Unique Datapoint Count"\u000a }\u000a }\u000a ],\u000a "listeners": {}\u000a} -p579 -sVdescription -p580 -V -sVtitle -p581 -VErrors By Source Type -p582 -sVuiStateJSON -p583 -V{\u000a "vis": {\u000a "colors": {\u000a "Unique Datapoint Count": "#0A50A1",\u000a "Count": "#5195CE"\u000a }\u000a }\u000a} -p584 -sVversion -p585 -I1 -sVkibanaSavedObjectMeta -p586 -(dp587 -VsearchSourceJSON -p588 -V{\u000a "index": "error*",\u000a "query": {\u000a "query_string": {\u000a "analyze_wildcard": true,\u000a "query": "*"\u000a }\u000a },\u000a "filter": []\u000a} -p589 -sssV_index -p590 -V.kibana -p591 -sa(dp592 -V_score -p593 -F1 -sV_type -p594 -Vvisualization -p595 -sV_id -p596 -VError-Histogram-By-Sensor-Type -p597 -sV_source -p598 -(dp599 -VvisState -p600 -V{"title":"Error Histogram By Sensor Type","type":"histogram","params":{"shareYAxis":true,"addTooltip":true,"addLegend":true,"scale":"linear","mode":"grouped","times":[],"addTimeMarker":false,"defaultYExtents":false,"setYExtents":false,"yAxis":{}},"aggs":[{"id":"1","type":"count","schema":"metric","params":{}},{"id":"2","type":"date_histogram","schema":"segment","params":{"field":"timestamp","interval":"auto","customInterval":"2h","min_doc_count":1,"extended_bounds":{},"customLabel":"Time"}},{"id":"3","type":"terms","schema":"group","params":{"field":"failed_sensor_type","size":5,"order":"desc","orderBy":"1"}}],"listeners":{}} -p601 -sVdescription -p602 -V -sVtitle -p603 -VError Histogram By Sensor Type -p604 -sVuiStateJSON -p605 -V{} -p606 -sVversion -p607 -I1 -sVsavedSearchId -p608 -VErrors -p609 -sVkibanaSavedObjectMeta -p610 -(dp611 -VsearchSourceJSON -p612 -V{"filter":[]} -p613 -sssV_index -p614 -V.kibana -p615 -sa(dp616 -V_score -p617 -F1 -sV_type -p618 -Vdashboard -p619 -sV_id -p620 -VMetron-Dashboard -p621 -sV_source -p622 -(dp623 -Vhits -p624 -I0 -sVtimeRestore -p625 -I00 -sVdescription -p626 -V -sVtitle -p627 -VMetron Dashboard -p628 -sVuiStateJSON -p629 -V{"P-23":{"spy":{"mode":{"name":null,"fill":false}}},"P-34":{"vis":{"legendOpen":false}}} -p630 -sVpanelsJSON -p631 -V[{"col":1,"id":"Welcome","panelIndex":30,"row":1,"size_x":11,"size_y":2,"type":"visualization"},{"col":1,"id":"Total-Events","panelIndex":6,"row":3,"size_x":3,"size_y":2,"type":"visualization"},{"col":4,"id":"Events","panelIndex":16,"row":3,"size_x":8,"size_y":4,"type":"visualization"},{"col":1,"id":"Event-Types","panelIndex":15,"row":5,"size_x":3,"size_y":2,"type":"visualization"},{"col":1,"id":"Location-Header","panelIndex":24,"row":7,"size_x":3,"size_y":2,"type":"visualization"},{"col":1,"id":"Unique-Location(s)","panelIndex":23,"row":9,"size_x":3,"size_y":2,"type":"visualization"},{"col":4,"id":"Flow-Locations","panelIndex":32,"row":7,"size_x":8,"size_y":6,"type":"visualization"},{"col":1,"id":"Country","panelIndex":8,"row":11,"size_x":3,"size_y":2,"type":"visualization"},{"col":1,"id":"YAF-Flows-Header","panelIndex":27,"row":13,"size_x":3,"size_y":2,"type":"visualization"},{"col":1,"id":"YAF-Flow(s)","panelIndex":21,"row":15,"size_x":3,"size_y":2,"type":"visualization"},{"col":4,"columns":["ip_src_addr","ip_src_port","ip_dst_addr","ip_dst_port","protocol","duration","pkt"],"id":"yaf-search","panelIndex":20,"row":13,"size_x":8,"size_y":6,"sort":["duration","desc"],"type":"search"},{"col":1,"id":"Flow-Duration","panelIndex":31,"row":17,"size_x":3,"size_y":2,"type":"visualization"},{"col":1,"id":"Snort-Header","panelIndex":25,"row":19,"size_x":3,"size_y":2,"type":"visualization"},{"col":4,"columns":["msg","sig_id","ip_src_addr","ip_src_port","ip_dst_addr","ip_dst_port"],"id":"snort-search","panelIndex":3,"row":19,"size_x":8,"size_y":6,"sort":["timestamp","desc"],"type":"search"},{"col":1,"id":"Snort-Alert-Types","panelIndex":10,"row":21,"size_x":3,"size_y":2,"type":"visualization"},{"col":1,"id":"Top-Alerts-By-Host","panelIndex":19,"row":23,"size_x":3,"size_y":2,"type":"visualization"},{"col":1,"id":"Web-Request-Header","panelIndex":26,"row":25,"size_x":3,"size_y":2,"type":"visualization"},{"col":4,"columns":["method","host","uri","referrer","user_agent","ip_src_addr","ip_dst_addr"],"id":"web-search","panelIndex":4,"row":25,"size_x":8,"size_y":6,"sort":["timestamp","desc"],"type":"search"},{"col":1,"id":"HTTP(S)-Requests","panelIndex":17,"row":27,"size_x":3,"size_y":2,"type":"visualization"},{"col":1,"id":"DNS-Requests-Header","panelIndex":29,"row":31,"size_x":3,"size_y":2,"type":"visualization"},{"col":4,"columns":["query","qtype_name","answers","ip_src_addr","ip_dst_addr"],"id":"dns-search","panelIndex":5,"row":31,"size_x":8,"size_y":6,"sort":["timestamp","desc"],"type":"search"},{"col":1,"id":"DNS-Request(s)","panelIndex":14,"row":33,"size_x":3,"size_y":2,"type":"visualization"},{"col":1,"id":"Web-Request-Type","panelIndex":33,"row":29,"size_x":3,"size_y":2,"type":"visualization"}] -p632 -sVoptionsJSON -p633 -V{"darkTheme":false} -p634 -sVversion -p635 -I1 -sVkibanaSavedObjectMeta -p636 -(dp637 -VsearchSourceJSON -p638 -V{"filter":[{"query":{"query_string":{"analyze_wildcard":true,"query":"*"}}}]} -p639 -sssV_index -p640 -V.kibana -p641 -sa(dp642 -V_score -p643 -F1 -sV_type -p644 -Vindex-pattern -p645 -sV_id -p646 -Vsnort* -p647 -sV_source -p648 -(dp649 -Vfields -p650 -V[{"name":"msg","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":true,"doc_values":false},{"name":"enrichments:geo:ip_dst_addr:location_point","type":"geo_point","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"dgmlen","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"enrichments:geo:ip_src_addr:longitude","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"enrichmentjoinbolt:joiner:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"enrichments:geo:ip_src_addr:dmaCode","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"adapter:geoadapter:begin:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"tcpack","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":true,"doc_values":false},{"name":"protocol","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"adapter:threatinteladapter:end:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"enrichments:geo:ip_src_addr:locID","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"original_string","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":true,"doc_values":false},{"name":"adapter:geoadapter:end:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"id","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"enrichments:geo:ip_src_addr:location_point","type":"geo_point","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"enrichmentsplitterbolt:splitter:end:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"enrichments:geo:ip_dst_addr:city","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"adapter:hostfromjsonlistadapter:begin:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"enrichments:geo:ip_src_addr:postalCode","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"ethlen","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"threat:triage:level","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"tcpflags","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":true,"doc_values":false},{"name":"adapter:threatinteladapter:begin:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"_source","type":"_source","count":0,"scripted":false,"indexed":false,"analyzed":false,"doc_values":false},{"name":"enrichments:geo:ip_dst_addr:country","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"enrichments:geo:ip_dst_addr:locID","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"_index","type":"string","count":0,"scripted":false,"indexed":false,"analyzed":false,"doc_values":false},{"name":"ip_dst_port","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"threatinteljoinbolt:joiner:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"enrichments:geo:ip_dst_addr:dmaCode","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"sig_rev","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":true,"doc_values":false},{"name":"ethsrc","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"tcpseq","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":true,"doc_values":false},{"name":"enrichmentsplitterbolt:splitter:begin:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"tcpwindow","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":true,"doc_values":false},{"name":"enrichments:geo:ip_dst_addr:latitude","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"source:type","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"ip_dst_addr","type":"ip","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"adapter:hostfromjsonlistadapter:end:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"tos","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"ip_src_addr","type":"ip","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"threatintelsplitterbolt:splitter:end:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"enrichments:geo:ip_src_addr:latitude","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"enrichments:geo:ip_dst_addr:longitude","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"timestamp","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"ethdst","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"enrichments:geo:ip_dst_addr:postalCode","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"is_alert","type":"boolean","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"enrichments:geo:ip_src_addr:country","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"ttl","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"iplen","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"ip_src_port","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"threatintelsplitterbolt:splitter:begin:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"sig_id","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"sig_generator","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"enrichments:geo:ip_src_addr:city","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"_id","type":"string","count":0,"scripted":false,"indexed":false,"analyzed":false,"doc_values":false},{"name":"_type","type":"string","count":0,"scripted":false,"indexed":false,"analyzed":false,"doc_values":false},{"name":"_score","type":"number","count":0,"scripted":false,"indexed":false,"analyzed":false,"doc_values":false}] -p651 -sVtimeFieldName -p652 -Vtimestamp -p653 -sVtitle -p654 -Vsnort* -p655 -ssV_index -p656 -V.kibana -p657 -sa(dp658 -V_score -p659 -F1 -sV_type -p660 -Vindex-pattern -p661 -sV_id -p662 -Vyaf* -p663 -sV_source -p664 -(dp665 -Vfields -p666 -V[{"name":"enrichments:geo:ip_dst_addr:location_point","type":"geo_point","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"isn","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"enrichmentjoinbolt:joiner:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"dip","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"adapter:geoadapter:begin:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"dp","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"protocol","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":true,"doc_values":false},{"name":"rpkt","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"original_string","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":true,"doc_values":false},{"name":"adapter:threatinteladapter:end:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"adapter:geoadapter:end:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"tag","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"app","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"oct","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"end_reason","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":true,"doc_values":false},{"name":"enrichmentsplitterbolt:splitter:end:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"enrichments:geo:ip_dst_addr:city","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"adapter:hostfromjsonlistadapter:begin:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"start_time","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"riflags","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":true,"doc_values":false},{"name":"proto","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"adapter:threatinteladapter:begin:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"_source","type":"_source","count":0,"scripted":false,"indexed":false,"analyzed":false,"doc_values":false},{"name":"enrichments:geo:ip_dst_addr:country","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"enrichments:geo:ip_dst_addr:locID","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"iflags","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"_index","type":"string","count":0,"scripted":false,"indexed":false,"analyzed":false,"doc_values":false},{"name":"ip_dst_port","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"enrichments:geo:ip_dst_addr:dmaCode","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"threatinteljoinbolt:joiner:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"uflags","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"enrichmentsplitterbolt:splitter:begin:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"enrichments:geo:ip_dst_addr:latitude","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"duration","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"source:type","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"ip_dst_addr","type":"ip","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"pkt","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"adapter:hostfromjsonlistadapter:end:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"ruflags","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"roct","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"sip","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"sp","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"ip_src_addr","type":"ip","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"rtag","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"threatintelsplitterbolt:splitter:end:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"enrichments:geo:ip_dst_addr:longitude","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"timestamp","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"end-reason","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":true,"doc_values":false},{"name":"risn","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"end_time","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"enrichments:geo:ip_dst_addr:postalCode","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"rtt","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"ip_src_port","type":"number","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"threatintelsplitterbolt:splitter:begin:ts","type":"date","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"_id","type":"string","count":0,"scripted":false,"indexed":false,"analyzed":false,"doc_values":false},{"name":"_type","type":"string","count":0,"scripted":false,"indexed":false,"analyzed":false,"doc_values":false},{"name":"_score","type":"number","count":0,"scripted":false,"indexed":false,"analyzed":false,"doc_values":false}] -p667 -sVtimeFieldName -p668 -Vtimestamp -p669 -sVtitle -p670 -Vyaf* -p671 -ssV_index -p672 -V.kibana -p673 -sa(dp674 -V_score -p675 -F1 -sV_type -p676 -Vsearch -p677 -sV_id -p678 -Vweb-search -p679 -sV_source -p680 -(dp681 -Vsort -p682 -(lp683 -Vtimestamp -p684 -aVdesc -p685 -asVhits -p686 -I0 -sVdescription -p687 -V -sVtitle -p688 -VWeb Requests -p689 -sVversion -p690 -I1 -sVkibanaSavedObjectMeta -p691 -(dp692 -VsearchSourceJSON -p693 -V{"index":"bro*","query":{"query_string":{"query":"protocol: http OR protocol: https","analyze_wildcard":true}},"filter":[],"highlight":{"pre_tags":["@kibana-highlighted-field@"],"post_tags":["@/kibana-highlighted-field@"],"fields":{"*":{}},"require_field_match":false,"fragment_size":2147483647}} -p694 -ssVcolumns -p695 -(lp696 -Vmethod -p697 -aVhost -p698 -aVuri -p699 -aVreferrer -p700 -aVip_src_addr -p701 -aVip_dst_addr -p702 -assV_index -p703 -V.kibana -p704 -sa(dp705 -V_score -p706 -F1 -sV_type -p707 -Vvisualization -p708 -sV_id -p709 -VLocation-Header -p710 -sV_source -p711 -(dp712 -VvisState -p713 -V{"title":"Enrichment","type":"markdown","params":{"markdown":"Apache Metron can perform real-time enrichment of telemetry data as it is consumed. To highlight this feature, all of the IP address fields collected from the default sensor suite were used to perform geo-ip lookups. This data was then used to pinpoint each location on the map."},"aggs":[],"listeners":{}} -p714 -sVdescription -p715 -V -sVtitle -p716 -VEnrichment -p717 -sVuiStateJSON -p718 -V{} -p719 -sVversion -p720 -I1 -sVkibanaSavedObjectMeta -p721 -(dp722 -VsearchSourceJSON -p723 -V{"query":{"query_string":{"query":"*","analyze_wildcard":true}},"filter":[]} -p724 -sssV_index -p725 -V.kibana -p726 -sa(dp727 -V_score -p728 -F1 -sV_type -p729 -Vvisualization -p730 -sV_id -p731 -VSnort-Alert-Types -p732 -sV_source -p733 -(dp734 -VvisState -p735 -V{"title":"Snort Alert Types","type":"metric","params":{"handleNoResults":true,"fontSize":60},"aggs":[{"id":"1","type":"cardinality","schema":"metric","params":{"field":"sig_id","customLabel":"Alert Type(s)"}}],"listeners":{}} -p736 -sVdescription -p737 -V -sVtitle -p738 -VSnort Alert Types -p739 -sVuiStateJSON -p740 -V{} -p741 -sVversion -p742 -I1 -sVkibanaSavedObjectMeta -p743 -(dp744 -VsearchSourceJSON -p745 -V{"index":"snort*","query":{"query_string":{"query":"*","analyze_wildcard":true}},"filter":[]} -p746 -sssV_index -p747 -V.kibana -p748 -sa(dp749 -V_score -p750 -F1 -sV_type -p751 -Vvisualization -p752 -sV_id -p753 -VFrequent-DNS-Queries -p754 -sV_source -p755 -(dp756 -VvisState -p757 -V{"title":"Frequent DNS Requests","type":"table","params":{"perPage":10,"showPartialRows":false,"showMeticsAtAllLevels":false},"aggs":[{"id":"1","type":"count","schema":"metric","params":{}},{"id":"2","type":"terms","schema":"bucket","params":{"field":"query","size":5,"order":"desc","orderBy":"1"}}],"listeners":{}} -p758 -sVdescription -p759 -V -sVtitle -p760 -VFrequent DNS Requests -p761 -sVuiStateJSON -p762 -V{} -p763 -sVversion -p764 -I1 -sVkibanaSavedObjectMeta -p765 -(dp766 -VsearchSourceJSON -p767 -V{"index":"bro*","query":{"query_string":{"query":"*","analyze_wildcard":true}},"filter":[]} -p768 -sssV_index -p769 -V.kibana -p770 -sa(dp771 -V_score -p772 -F1 -sV_type -p773 -Vvisualization -p774 -sV_id -p775 -VDNS-Request(s) -p776 -sV_source -p777 -(dp778 -VvisState -p779 -V{"title":"DNS Requests","type":"metric","params":{"handleNoResults":true,"fontSize":60},"aggs":[{"id":"1","type":"count","schema":"metric","params":{}}],"listeners":{}} -p780 -sVdescription -p781 -V -sVtitle -p782 -VDNS Requests -p783 -sVuiStateJSON -p784 -V{} -p785 -sVversion -p786 -I1 -sVsavedSearchId -p787 -Vdns-search -p788 -sVkibanaSavedObjectMeta -p789 -(dp790 -VsearchSourceJSON -p791 -V{"filter":[]} -p792 -sssV_index -p793 -V.kibana -p794 -sa(dp795 -V_score -p796 -F1 -sV_type -p797 -Vvisualization -p798 -sV_id -p799 -VHTTP(S)-Requests -p800 -sV_source -p801 -(dp802 -VvisState -p803 -V{"title":"Web Requests","type":"metric","params":{"handleNoResults":true,"fontSize":60},"aggs":[{"id":"1","type":"count","schema":"metric","params":{}}],"listeners":{}} -p804 -sVdescription -p805 -V -sVtitle -p806 -VWeb Requests -p807 -sVuiStateJSON -p808 -V{} -p809 -sVversion -p810 -I1 -sVsavedSearchId -p811 -Vweb-search -p812 -sVkibanaSavedObjectMeta -p813 -(dp814 -VsearchSourceJSON -p815 -V{"filter":[]} -p816 -sssV_index -p817 -V.kibana -p818 -sa(dp819 -V_score -p820 -F1 -sV_type -p821 -Vvisualization -p822 -sV_id -p823 -VErrors-Over-Time -p824 -sV_source -p825 -(dp826 -VvisState -p827 -V{\u000a "title": "Error Over Time",\u000a "type": "line",\u000a "params": {\u000a "shareYAxis": true,\u000a "addTooltip": true,\u000a "addLegend": true,\u000a "showCircles": true,\u000a "smoothLines": false,\u000a "interpolate": "linear",\u000a "scale": "linear",\u000a "drawLinesBetweenPoints": true,\u000a "radiusRatio": 9,\u000a "times": [],\u000a "addTimeMarker": true,\u000a "defaultYExtents": false,\u000a "setYExtents": false,\u000a "yAxis": {\u000a "min": 0\u000a }\u000a },\u000a "aggs": [\u000a {\u000a "id": "1",\u000a "type": "count",\u000a "schema": "metric",\u000a "params": {}\u000a },\u000a {\u000a "id": "2",\u000a "type": "date_histogram",\u000a "schema": "segment",\u000a "params": {\u000a "field": "timestamp",\u000a "interval": "auto",\u000a "customInterval": "2h",\u000a "min_doc_count": 1,\u000a "extended_bounds": {}\u000a }\u000a }\u000a ],\u000a "listeners": {}\u000a} -p828 -sVdescription -p829 -V -sVtitle -p830 -VErrors Over Time -p831 -sVuiStateJSON -p832 -V{} -p833 -sVversion -p834 -I1 -sVkibanaSavedObjectMeta -p835 -(dp836 -VsearchSourceJSON -p837 -V{\u000a "index": "error*",\u000a "query": {\u000a "query_string": {\u000a "query": "*",\u000a "analyze_wildcard": true\u000a }\u000a },\u000a "filter": []\u000a} -p838 -sssV_index -p839 -V.kibana -p840 -sa(dp841 -V_score -p842 -F1 -sV_type -p843 -Vvisualization -p844 -sV_id -p845 -VError-Source-Proportion -p846 -sV_source -p847 -(dp848 -VvisState -p849 -V{\u000a "title": "Sensor Type Proportion",\u000a "type": "pie",\u000a "params": {\u000a "shareYAxis": true,\u000a "addTooltip": true,\u000a "addLegend": true,\u000a "isDonut": false\u000a },\u000a "aggs": [\u000a {\u000a "id": "1",\u000a "type": "count",\u000a "schema": "metric",\u000a "params": {}\u000a },\u000a {\u000a "id": "2",\u000a "type": "terms",\u000a "schema": "segment",\u000a "params": {\u000a "field": "failed_sensor_type",\u000a "size": 5,\u000a "order": "desc",\u000a "orderBy": "1",\u000a "customLabel": "Sensor"\u000a }\u000a }\u000a ],\u000a "listeners": {}\u000a} -p850 -sVdescription -p851 -V -sVtitle -p852 -VError Source Proportion -p853 -sVuiStateJSON -p854 -V{} -p855 -sVversion -p856 -I1 -sVkibanaSavedObjectMeta -p857 -(dp858 -VsearchSourceJSON -p859 -V{\u000a "index": "error*",\u000a "query": {\u000a "query_string": {\u000a "query": "*",\u000a "analyze_wildcard": true\u000a }\u000a },\u000a "filter": []\u000a} -p860 -sssV_index -p861 -V.kibana -p862 -sa(dp863 -V_score -p864 -F1 -sV_type -p865 -Vindex-pattern -p866 -sV_id -p867 -Verror* -p868 -sV_source -p869 -(dp870 -Vfields -p871 -V[{"name":"exception","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"stack","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"_index","type":"string","count":0,"scripted":false,"indexed":false,"analyzed":false,"doc_values":false},{"name":"error_hash","type":"string","count":1,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"raw_message","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"message","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"failed_sensor_type","type":"string","count":1,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"hostname","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"source:type","type":"string","count":1,"scripted":false,"indexed":true,"analyzed":true,"doc_values":false},{"name":"error_type","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"error_fields","type":"string","count":0,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"_source","type":"_source","count":0,"scripted":false,"indexed":false,"analyzed":false,"doc_values":false},{"name":"raw_message_bytes","type":"string","count":0,"scripted":false,"indexed":false,"analyzed":false,"doc_values":false},{"name":"timestamp","type":"date","count":1,"scripted":false,"indexed":true,"analyzed":false,"doc_values":true},{"name":"_id","type":"string","count":0,"scripted":false,"indexed":false,"analyzed":false,"doc_values":false},{"name":"_type","type":"string","count":0,"scripted":false,"indexed":false,"analyzed":false,"doc_values":false},{"name":"_score","type":"number","count":0,"scripted":false,"indexed":false,"analyzed":false,"doc_values":false}] -p872 -sVtimeFieldName -p873 -Vtimestamp -p874 -sVtitle -p875 -Verror* -p876 -ssV_index -p877 -V.kibana -p878 -sa(dp879 -V_score -p880 -F1 -sV_type -p881 -Vvisualization -p882 -sV_id -p883 -VError-Date-Histogram -p884 -sV_source -p885 -(dp886 -VvisState -p887 -V{"title":"New Visualization","type":"histogram","params":{"shareYAxis":true,"addTooltip":true,"addLegend":true,"scale":"linear","mode":"stacked","times":[],"addTimeMarker":false,"defaultYExtents":false,"setYExtents":false,"yAxis":{}},"aggs":[{"id":"1","type":"count","schema":"metric","params":{}},{"id":"2","type":"date_histogram","schema":"segment","params":{"field":"timestamp","interval":"auto","customInterval":"2h","min_doc_count":1,"extended_bounds":{},"customLabel":"Time"}}],"listeners":{}} -p888 -sVdescription -p889 -V -sVtitle -p890 -VError Date Histogram -p891 -sVuiStateJSON -p892 -V{} -p893 -sVversion -p894 -I1 -sVsavedSearchId -p895 -VErrors -p896 -sVkibanaSavedObjectMeta -p897 -(dp898 -VsearchSourceJSON -p899 -V{"filter":[]} -p900 -sssV_index -p901 -V.kibana -p902 -sa(dp903 -V_score -p904 -F1 -sV_type -p905 -Vdashboard -p906 -sV_id -p907 -VMetron-Error-Dashboard -p908 -sV_source -p909 -(dp910 -Vhits -p911 -I0 -sVtimeRestore -p912 -I00 -sVdescription -p913 -V -sVtitle -p914 -VMetron Error Dashboard -p915 -sVuiStateJSON -p916 -V{"P-2":{"vis":{"legendOpen":true}},"P-23":{"vis":{"colors":{"amb3.service.consul":"#629E51","host":"#629E51","host2":"#9AC48A","hostAnother":"#7EB26D","hostNew":"#B7DBAB"}}},"P-3":{"vis":{"colors":{"fourth":"#1F78C1","new_error":"#BADFF4","test_error":"#82B5D8"}}},"P-5":{"vis":{"colors":{"another_new_parser_error":"#806EB7","new_parser_error":"#AEA2E0","parser_error":"#614D93"}}}} -p917 -sVpanelsJSON -p918 -V[{"col":5,"id":"Errors-By-Error-Type","panelIndex":2,"row":9,"size_x":8,"size_y":3,"type":"visualization"},{"col":1,"id":"Error-Source-Proportion","panelIndex":3,"row":9,"size_x":4,"size_y":3,"type":"visualization"},{"col":5,"id":"Errors-By-Source-Type","panelIndex":4,"row":12,"size_x":8,"size_y":3,"type":"visualization"},{"col":1,"id":"Error-Type-Proportion","panelIndex":5,"row":12,"size_x":4,"size_y":3,"type":"visualization"},{"col":8,"id":"Unique-Error-Messages","panelIndex":19,"row":1,"size_x":4,"size_y":2,"type":"visualization"},{"col":3,"id":"Total-Error-Messages","panelIndex":20,"row":1,"size_x":4,"size_y":2,"type":"visualization"},{"col":5,"id":"Errors-By-Hostname","panelIndex":22,"row":15,"size_x":8,"size_y":3,"type":"visualization"},{"col":1,"id":"Error-Hostname-Proportion","panelIndex":23,"row":15,"size_x":4,"size_y":3,"type":"visualization"},{"col":1,"columns":["failed_sensor_type","error_type","exception","hostname","message","raw_message","error_hash"],"id":"Errors","panelIndex":25,"row":18,"size_x":12,"size_y":7,"sort":["timestamp","desc"],"type":"search"},{"col":1,"id":"Error-Histogram-By-Sensor-Type","panelIndex":27,"row":3,"size_x":12,"size_y":3,"type":"visualization"},{"id":"Unique-Error-Histogram-By-Sensor-Type","type":"visualization","panelIndex":28,"size_x":12,"size_y":3,"col":1,"row":6}] -p919 -sVoptionsJSON -p920 -V{"darkTheme":false} -p921 -sVversion -p922 -I1 -sVkibanaSavedObjectMeta -p923 -(dp924 -VsearchSourceJSON -p925 -V{"filter":[{"query":{"query_string":{"analyze_wildcard":true,"query":"*"}}}]} -p926 -sssV_index -p927 -V.kibana -p928 -sa(dp929 -V_score -p930 -F1 -sV_type -p931 -Vconfig -p932 -sV_id -p933 -V4.5.3 -p934 -sV_source -p935 -(dp936 -VbuildNum -p937 -I9892 -sVdefaultIndex -p938 -Vbro* -p939 -ssV_index -p940 -V.kibana -p941 -sa(dp942 -V_score -p943 -F1 -sV_type -p944 -Vsearch -p945 -sV_id -p946 -Vdns-search -p947 -sV_source -p948 -(dp949 -Vsort -p950 -(lp951 -Vtimestamp -p952 -aVdesc -p953 -asVhits -p954 -I0 -sVdescription -p955 -V -sVtitle -p956 -VDNS Requests -p957 -sVversion -p958 -I1 -sVkibanaSavedObjectMeta -p959 -(dp960 -VsearchSourceJSON -p961 -V{"index":"bro*","query":{"query_string":{"query":"protocol: dns","analyze_wildcard":true}},"filter":[],"highlight":{"pre_tags":["@kibana-highlighted-field@"],"post_tags":["@/kibana-highlighted-field@"],"fields":{"*":{}},"require_field_match":false,"fragment_size":2147483647}} -p962 -ssVcolumns -p963 -(lp964 -Vquery -p965 -aVqtype_name -p966 -aVanswers -p967 -aVip_src_addr -p968 -aVip_dst_addr -p969 -assV_index -p970 -V.kibana -p971 -sa(dp972 -V_score -p973 -F1 -sV_type -p974 -Vvisualization -p975 -sV_id -p976 -VDNS-Requests-Header -p977 -sV_source -p978 -(dp979 -VvisState -p980 -V{"aggs":[],"listeners":{},"params":{"markdown":"[Bro](https://www.bro.org/) is extracting DNS requests and responses being made over the network. Understanding who is making those requests, the frequency, and types can provide a deep understanding of the actors present on the network."},"title":"DNS Requests","type":"markdown"} -p981 -sVdescription -p982 -V -sVtitle -p983 -VDNS Requests -p984 -sVuiStateJSON -p985 -V{} -p986 -sVversion -p987 -I1 -sVkibanaSavedObjectMeta -p988 -(dp989 -VsearchSourceJSON -p990 -V{"query":{"query_string":{"analyze_wildcard":true,"query":"*"}},"filter":[]} -p991 -sssV_index -p992 -V.kibana -p993 -sa(dp994 -V_score -p995 -F1 -sV_type -p996 -Vvisualization -p997 -sV_id -p998 -VYAF-Flows-Header -p999 -sV_source -p1000 -(dp1001 -VvisState -p1002 -V{"title":"YAF","type":"markdown","params":{"markdown":"[YAF](https://tools.netsa.cert.org/yaf/yaf.html) can be used to generate Netflow-like flow records. These flow records provide significant visibility of the actors communicating over the target network."},"aggs":[],"listeners":{}} -p1003 -sVdescription -p1004 -V -sVtitle -p1005 -VYAF -p1006 -sVuiStateJSON -p1007 -V{} -p1008 -sVversion -p1009 -I1 -sVkibanaSavedObjectMeta -p1010 -(dp1011 -VsearchSourceJSON -p1012 -V{"query":{"query_string":{"analyze_wildcard":true,"query":"*"}},"filter":[]} -p1013 -sssV_index -p1014 -V.kibana -p1015 -sa(dp1016 -V_score -p1017 -F1 -sV_type -p1018 -Vvisualization -p1019 -sV_id -p1020 -VTop-5-Exceptions -p1021 -sV_source -p1022 -(dp1023 -VvisState -p1024 -V{"title":"Top-5 Exceptions","type":"histogram","params":{"shareYAxis":true,"addTooltip":true,"addLegend":true,"scale":"linear","mode":"stacked","times":[],"addTimeMarker":false,"defaultYExtents":false,"setYExtents":false,"yAxis":{}},"aggs":[{"id":"1","type":"count","schema":"metric","params":{}},{"id":"2","type":"terms","schema":"segment","params":{"field":"exception","size":5,"order":"desc","orderBy":"1","customLabel":"Exceptions"}}],"listeners":{}} -p1025 -sVdescription -p1026 -V -sVtitle -p1027 -VTop-5 Exceptions -p1028 -sVuiStateJSON -p1029 -V{} -p1030 -sVversion -p1031 -I1 -sVkibanaSavedObjectMeta -p1032 -(dp1033 -VsearchSourceJSON -p1034 -V{"index":"error*","query":{"query_string":{"query":"*","analyze_wildcard":true}},"filter":[]} -p1035 -sssV_index -p1036 -V.kibana -p1037 -sa(dp1038 -V_score -p1039 -F1 -sV_type -p1040 -Vvisualization -p1041 -sV_id -p1042 -VFrequent-DNS-Requests -p1043 -sV_source -p1044 -(dp1045 -VvisState -p1046 -V{"title":"Frequent DNS Requests","type":"table","params":{"perPage":10,"showPartialRows":false,"showMeticsAtAllLevels":false},"aggs":[{"id":"1","type":"count","schema":"metric","params":{}},{"id":"2","type":"terms","schema":"bucket","params":{"field":"query","size":5,"order":"desc","orderBy":"1","customLabel":"DNS Query"}}],"listeners":{}} -p1047 -sVdescription -p1048 -V -sVtitle -p1049 -VFrequent DNS Requests -p1050 -sVuiStateJSON -p1051 -V{} -p1052 -sVversion -p1053 -I1 -sVkibanaSavedObjectMeta -p1054 -(dp1055 -VsearchSourceJSON -p1056 -V{"index":"bro*","query":{"query_string":{"query":"*","analyze_wildcard":true}},"filter":[]} -p1057 -sssV_index -p1058 -V.kibana -p1059 -sa(dp1060 -V_score -p1061 -F1 -sV_type -p1062 -Vvisualization -p1063 -sV_id -p1064 -VCountry -p1065 -sV_source -p1066 -(dp1067 -VvisState -p1068 -V{"title":"By Country","type":"pie","params":{"shareYAxis":true,"addTooltip":true,"addLegend":true,"isDonut":false},"aggs":[{"id":"1","type":"count","schema":"metric","params":{}},{"id":"2","type":"terms","schema":"segment","params":{"field":"enrichments:geo:ip_src_addr:country","size":5,"order":"desc","orderBy":"1"}}],"listeners":{}} -p1069 -sVdescription -p1070 -V -sVtitle -p1071 -VBy Country -p1072 -sVuiStateJSON -p1073 -V{} -p1074 -sVversion -p1075 -I1 -sVkibanaSavedObjectMeta -p1076 -(dp1077 -VsearchSourceJSON -p1078 -V{"index":["yaf*","bro*","snort*"],"query":{"query_string":{"query":"*","analyze_wildcard":true}},"filter":[]} -p1079 -sssV_index -p1080 -V.kibana -p1081 -sa(dp1082 -V_score -p1083 -F1 -sV_type -p1084 -Vvisualization -p1085 -sV_id -p1086 -VTop-Destinations -p1087 -sV_source -p1088 -(dp1089 -VvisState -p1090 -V{"title":"Top Destinations","type":"table","params":{"perPage":10,"showPartialRows":false,"showMeticsAtAllLevels":false},"aggs":[{"id":"1","type":"count","schema":"metric","params":{}},{"id":"2","type":"terms","schema":"bucket","params":{"field":"ip_dst_addr","size":10,"order":"desc","orderBy":"1","customLabel":"Destination IP"}}],"listeners":{}} -p1091 -sVdescription -p1092 -V -sVtitle -p1093 -VTop Destinations -p1094 -sVuiStateJSON -p1095 -V{} -p1096 -sVversion -p1097 -I1 -sVkibanaSavedObjectMeta -p1098 -(dp1099 -VsearchSourceJSON -p1100 -V{"index":["yaf*","bro*","snort*"],"query":{"query_string":{"query":"*","analyze_wildcard":true}},"filter":[]} -p1101 -sssV_index -p1102 -V.kibana -p1103 -sa(dp1104 -V_score -p1105 -F1 -sV_type -p1106 -Vvisualization -p1107 -sV_id -p1108 -VUnusual-Referrers -p1109 -sV_source -p1110 -(dp1111 -VvisState -p1112 -V{"title":"Unusual Referrers","type":"table","params":{"perPage":10,"showPartialRows":false,"showMeticsAtAllLevels":false},"aggs":[{"id":"1","type":"count","schema":"metric","params":{}},{"id":"2","type":"significant_terms","schema":"bucket","params":{"field":"referrer","size":5,"customLabel":"Top 5 Unusual Referrers"}}],"listeners":{}} -p1113 -sVdescription -p1114 -V -sVtitle -p1115 -VUnusual Referrers -p1116 -sVuiStateJSON -p1117 -V{} -p1118 -sVversion -p1119 -I1 -sVsavedSearchId -p1120 -Vweb-search -p1121 -sVkibanaSavedObjectMeta -p1122 -(dp1123 -VsearchSourceJSON -p1124 -V{"filter":[]} -p1125 -sssV_index -p1126 -V.kibana -p1127 -sa(dp1128 -V_score -p1129 -F1 -sV_type -p1130 -Vvisualization -p1131 -sV_id -p1132 -VUnique-Error-Histogram-By-Sensor-Type -p1133 -sV_source -p1134 -(dp1135 -VvisState -p1136 -V{"title":"Error Histogram By Sensor Type","type":"histogram","params":{"shareYAxis":true,"addTooltip":true,"addLegend":true,"scale":"linear","mode":"grouped","times":[],"addTimeMarker":false,"defaultYExtents":false,"setYExtents":false,"yAxis":{}},"aggs":[{"id":"1","type":"cardinality","schema":"metric","params":{"field":"error_hash"}},{"id":"2","type":"date_histogram","schema":"segment","params":{"field":"timestamp","interval":"auto","customInterval":"2h","min_doc_count":1,"extended_bounds":{},"customLabel":"Time"}},{"id":"3","type":"terms","schema":"group","params":{"field":"failed_sensor_type","size":5,"order":"desc","orderBy":"1"}}],"listeners":{}} -p1137 -sVdescription -p1138 -V -sVtitle -p1139 -VUnique Error Histogram By Sensor Type -p1140 -sVuiStateJSON -p1141 -V{} -p1142 -sVversion -p1143 -I1 -sVsavedSearchId -p1144 -VErrors -p1145 -sVkibanaSavedObjectMeta -p1146 -(dp1147 -VsearchSourceJSON -p1148 -V{"filter":[]} -p1149 -sssV_index -p1150 -V.kibana -p1151 -sa(dp1152 -V_score -p1153 -F1 -sV_type -p1154 -Vvisualization -p1155 -sV_id -p1156 -VFlow-Locations -p1157 -sV_source -p1158 -(dp1159 -VvisState -p1160 -V{"title":"Flow Locations","type":"tile_map","params":{"mapType":"Scaled Circle Markers","isDesaturated":true,"addTooltip":true,"heatMaxZoom":16,"heatMinOpacity":0.1,"heatRadius":25,"heatBlur":15,"heatNormalizeData":true,"wms":{"enabled":true,"url":"https://basemap.nationalmap.gov/arcgis/services/USGSTopo/MapServer/WMSServer","options":{"version":"1.3.0","layers":"0","format":"image/png","transparent":true,"attribution":"Maps provided by USGS","styles":""}}},"aggs":[{"id":"1","type":"count","schema":"metric","params":{}},{"id":"2","type":"geohash_grid","schema":"segment","params":{"field":"enrichments:geo:ip_dst_addr:location_point","autoPrecision":true,"precision":2}}],"listeners":{}} -p1161 -sVdescription -p1162 -V -sVtitle -p1163 -VFlow Locations -p1164 -sVuiStateJSON -p1165 -V{} -p1166 -sVversion -p1167 -I1 -sVkibanaSavedObjectMeta -p1168 -(dp1169 -VsearchSourceJSON -p1170 -V{"index":["yaf*","bro*","snort*"],"query":{"query_string":{"query":"*","analyze_wildcard":true}},"filter":[]} -p1171 -sssV_index -p1172 -V.kibana -p1173 -sa. \ No newline at end of file diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/4.5.1/configuration/kibana-env.xml b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/5.6.2/configuration/kibana-env.xml similarity index 92% rename from metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/4.5.1/configuration/kibana-env.xml rename to metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/5.6.2/configuration/kibana-env.xml index 0adf32ad7a..1246405813 100755 --- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/4.5.1/configuration/kibana-env.xml +++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/5.6.2/configuration/kibana-env.xml @@ -39,6 +39,11 @@ false + + kibana_server_host + 0.0.0.0 + Host name or IP address that Kibana should bind to. + kibana_log_dir /var/log/kibana diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/4.5.1/configuration/kibana-site.xml b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/5.6.2/configuration/kibana-site.xml similarity index 95% rename from metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/4.5.1/configuration/kibana-site.xml rename to metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/5.6.2/configuration/kibana-site.xml index 4373d140f9..d8d05135ea 100755 --- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/4.5.1/configuration/kibana-site.xml +++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/5.6.2/configuration/kibana-site.xml @@ -29,7 +29,8 @@ server.port: {{ kibana_port }} # The host to bind the server to. -# server.host: "0.0.0.0" +# Kibana (like Elasticsearch) now binds to localhost for security purposes instead of 0.0.0.0 (all addresses). Previous binding to 0.0.0.0 also caused issues for Windows users. +server.host: {{ kibana_server_host }} # If you are running kibana behind a proxy, and want to mount it at a path, # specify that path here. The basePath can't end in a slash. diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/4.5.1/metainfo.xml b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/5.6.2/metainfo.xml similarity index 97% rename from metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/4.5.1/metainfo.xml rename to metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/5.6.2/metainfo.xml index f59109c8c7..034f71cfa8 100755 --- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/4.5.1/metainfo.xml +++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/5.6.2/metainfo.xml @@ -22,7 +22,7 @@ KIBANA Kibana Kibana Dashboard - 4.5.1 + 5.6.2 KIBANA_MASTER @@ -54,7 +54,7 @@ python-elasticsearch - kibana-4.5.1 + kibana-5.6.2 diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/4.5.1/package/scripts/dashboard/__init__.py b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/5.6.2/package/scripts/dashboard/__init__.py similarity index 100% rename from metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/4.5.1/package/scripts/dashboard/__init__.py rename to metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/5.6.2/package/scripts/dashboard/__init__.py diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/5.6.2/package/scripts/dashboard/dashboard-bulkload.json b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/5.6.2/package/scripts/dashboard/dashboard-bulkload.json new file mode 100644 index 0000000000..037f1c63d5 --- /dev/null +++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/5.6.2/package/scripts/dashboard/dashboard-bulkload.json @@ -0,0 +1,88 @@ +{ "create" : { "_id": "all-metron-index", "_type": "index-pattern" } } +{"title":"*_index_*","timeFieldName":"timestamp","notExpandable":true,"fields":"[{\"name\":\"AA\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"RA\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"RD\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"TC\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"TTLs\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"Z\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_index\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_source\",\"type\":\"_source\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"actions\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"adapter:geoadapter:begin:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"adapter:geoadapter:end:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"adapter:hostfromjsonlistadapter:begin:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"adapter:hostfromjsonlistadapter:end:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"adapter:threatinteladapter:begin:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"adapter:threatinteladapter:end:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"addl\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"analyzer\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"analyzers\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"answers\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"app\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"arg\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"assigned_ip\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"auth_attempts\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"auth_success\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"basic_constraints:ca\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"basic_constraints:path_len\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"bro_timestamp\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"bro_timestamp.keyword\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"capture_password\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"certificate:curve\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"certificate:exponent\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"certificate:issuer\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"certificate:key_alg\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"certificate:key_length\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"certificate:key_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"certificate:not_valid_after\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"certificate:not_valid_before\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"certificate:serial\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"certificate:sig_alg\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"certificate:subject\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"certificate:version\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"cipher\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"cipher_alg\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"client\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"command\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"compression_alg\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"conn_state\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"conn_uids\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"connect_info\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"curve\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"cwd\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"data_channel:orig_h\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"data_channel:passive\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"data_channel:resp_h\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"data_channel:resp_p\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"date\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"depth\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"dgmlen\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"dhcp_host_name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"dip\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"direction\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"dp\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"dropped\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"dst\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"duration\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"end-reason\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"end_reason\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"end_reason.keyword\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"end_time\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichmentjoinbolt:joiner:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_dst_addr:city\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_dst_addr:country\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_dst_addr:dmaCode\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_dst_addr:latitude\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_dst_addr:locID\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_dst_addr:location_point\",\"type\":\"geo_point\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_dst_addr:longitude\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_dst_addr:postalCode\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_src_addr:city\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_src_addr:country\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_src_addr:dmaCode\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_src_addr:latitude\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_src_addr:locID\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_src_addr:location_point\",\"type\":\"geo_point\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_src_addr:longitude\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_src_addr:postalCode\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichmentsplitterbolt:splitter:begin:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichmentsplitterbolt:splitter:end:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"error_fields\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"error_hash\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"error_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"established\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"ethdst\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"ethlen\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"ethsrc\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"exception\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"failed_sensor_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"failure_reason\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"file_desc\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"file_mime_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"file_size\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"filename\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"first_received\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"from\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"fuid\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"fuids\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"guid\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"guid.keyword\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"helo\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"history\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host_key\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host_key_alg\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host_p\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"hostname\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"id\",\"type\":\"conflict\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false,\"conflictDescriptions\":{\"integer\":[\"snort_index_2017.11.06.19\",\"snort_index_2017.11.06.20\",\"snort_index_2017.11.06.21\",\"snort_index_2017.11.06.22\",\"snort_index_2017.11.06.23\",\"snort_index_2017.11.07.00\",\"snort_index_2017.11.07.01\"],\"keyword\":[\"bro_index_2017.11.02.23\",\"bro_index_2017.11.03.00\",\"bro_index_2017.11.03.01\",\"bro_index_2017.11.03.02\",\"bro_index_2017.11.03.03\",\"bro_index_2017.11.03.04\",\"bro_index_2017.11.03.13\",\"bro_index_2017.11.06.19\",\"bro_index_2017.11.06.20\",\"bro_index_2017.11.06.22\",\"bro_index_2017.11.06.23\",\"bro_index_2017.11.07.00\",\"bro_index_2017.11.07.01\"]}},{\"name\":\"iflags\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"in_reply_to\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"ip_dst_addr\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"ip_dst_port\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"ip_src_addr\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"ip_src_port\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"iplen\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"is_alert\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"is_orig\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"is_webmail\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"isn\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"issuer_subject\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"kex_alg\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"last_alert\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"last_reply\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"lease_time\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"local_orig\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"local_resp\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"mac\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"mac_alg\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"mailfrom\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"md5\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"message\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"method\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"mime_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"missed_bytes\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"missing_bytes\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"msg\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"msg_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"n\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"next_protocol\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"note\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"notice\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"oct\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"orig_bytes\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"orig_fuids\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"orig_fuids.keyword\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"orig_ip_bytes\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"orig_mime_types\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"orig_mime_types.keyword\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"orig_pkts\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"original_string\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"original_string.keyword\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"overflow_bytes\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"p\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"parent_fuid\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"passive\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"password\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"path\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"peer\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"peer_descr\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"pkt\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"port_num\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"proto\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"protocol\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"protocol.keyword\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"qclass\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"qclass_name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"qtype\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"qtype_name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"query\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"raw_message\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"raw_message_bytes\",\"type\":\"unknown\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"rcode\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"rcode_name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"rcptto\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"referrer\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"rejected\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"remote_ip\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"reply_code\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"reply_msg\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"reply_to\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"request_body_len\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"resp_bytes\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"resp_fuids\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"resp_fuids.keyword\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"resp_ip_bytes\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"resp_mime_types\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"resp_mime_types.keyword\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"resp_pkts\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"response_body_len\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"result\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"resumed\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"riflags\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"risn\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"roct\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"rpkt\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"rtag\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"rtt\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"ruflags\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"san:dns\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"san:email\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"san:ip\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"san:uri\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"second_received\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"seen_bytes\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"sensor:type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"sensor:type.keyword\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"serial\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"server\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"server_name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"service\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"sha1\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"sha256\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"sig_generator\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"sig_id\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"sig_rev\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"sip\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"software_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"source\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"source:type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"source:type.keyword\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"sp\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"src\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"src_peer\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"stack\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"start_time\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"status_code\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"status_msg\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"sub\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"subject\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"suppress_for\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"tag\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"tcpack\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"tcpflags\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"tcpseq\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"tcpwindow\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"threat:triage:level\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"threat:triage:rules:0:score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"threat:triage:score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"threatinteljoinbolt:joiner:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"threatintelsplitterbolt:splitter:begin:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"threatintelsplitterbolt:splitter:end:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"timedout\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"timestamp\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"tls\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"to\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"tos\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"total_bytes\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"trans_depth\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"trans_id\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"ttl\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"tunnel_parents\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"uflags\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"uid\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"unparsed_version\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"uri\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"user\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"user_agent\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"username\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"version\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"version:addl\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"version:major\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"version:minor\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"version:minor2\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"version:minor3\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"x_originating_ip\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true}]"} +{ "create" : { "_id": "AV-Sj0e2hKs1cXXnFMqF", "_type": "visualization" } } +{"title":"Welcome to Apache Metron","visState":"{\"title\":\"Welcome to Apache Metron\",\"type\":\"markdown\",\"params\":{\"type\":\"markdown\",\"markdown\":\"This dashboard enables the validation of Apache Metron and the end-to-end functioning of its default sensor suite. The default sensor suite includes [\\n Snort](https://www.snort.org/), [\\n Bro](https://www.bro.org/), and [\\n YAF](https://tools.netsa.cert.org/yaf/). One of Apache Metron's primary goals is to simplify the on-boarding of additional sources of telemetry. In a production deployment these default sensors should be replaced with ones applicable to the target environment.\\n\\nApache Metron enables disparate sources of telemetry to all be viewed under a 'single pane of glass.' Telemetry from each of the default sensors can be searched, aggregated, summarized, and viewed within this dashboard. This dashboard should be used as a springboard upon which to create your own customized dashboards.\\n\\nThe panels below highlight the volume and variety of events that are currently being consumed by Apache Metron.\"},\"aggs\":[],\"listeners\":{}}","uiStateJSON":"{}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"match_all\":{}},\"filter\":[]}"}} +{ "index" : { "_id": "5.6.2", "_type": "config" } } +{"defaultIndex":"AV-S2e81hKs1cXXnFMqN"} +{ "create" : { "_id": "AV-dVurck7f2nZ-iH3Ka", "_type": "visualization" } } +{"title":"Event Count By Type","visState":"{\"title\":\"Event Count By Type\",\"type\":\"histogram\",\"params\":{\"grid\":{\"categoryLines\":false,\"style\":{\"color\":\"#eee\"}},\"categoryAxes\":[{\"id\":\"CategoryAxis-1\",\"type\":\"category\",\"position\":\"bottom\",\"show\":true,\"style\":{},\"scale\":{\"type\":\"linear\"},\"labels\":{\"show\":true,\"truncate\":100},\"title\":{\"text\":\"\"}}],\"valueAxes\":[{\"id\":\"ValueAxis-1\",\"name\":\"LeftAxis-1\",\"type\":\"value\",\"position\":\"left\",\"show\":true,\"style\":{},\"scale\":{\"type\":\"linear\",\"mode\":\"normal\",\"defaultYExtents\":false},\"labels\":{\"show\":true,\"rotate\":0,\"filter\":false,\"truncate\":100},\"title\":{\"text\":\"Count\"}}],\"seriesParams\":[{\"show\":\"true\",\"type\":\"histogram\",\"mode\":\"stacked\",\"data\":{\"label\":\"Count\",\"id\":\"1\"},\"valueAxis\":\"ValueAxis-1\",\"drawLinesBetweenPoints\":true,\"showCircles\":true}],\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"right\",\"times\":[],\"addTimeMarker\":false,\"type\":\"histogram\"},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"3\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"group\",\"params\":{\"field\":\"source:type\",\"size\":20,\"order\":\"desc\",\"orderBy\":\"1\"}}],\"listeners\":{}}","uiStateJSON":"{\"vis\":{\"legendOpen\":true,\"colors\":{\"yaf\":\"#CCA300\",\"snort\":\"#C15C17\",\"bro\":\"#F9934E\"}}}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"index\":\"all-metron-index\",\"query\":{\"match_all\":{}},\"filter\":[{\"meta\":{\"index\":\"all-metron-index\",\"type\":\"phrases\",\"key\":\"source:type\",\"value\":\"bro, yaf, snort\",\"params\":[\"bro\",\"yaf\",\"snort\"],\"negate\":false,\"disabled\":false,\"alias\":null},\"query\":{\"bool\":{\"should\":[{\"match_phrase\":{\"source:type\":\"bro\"}},{\"match_phrase\":{\"source:type\":\"yaf\"}},{\"match_phrase\":{\"source:type\":\"snort\"}}],\"minimum_should_match\":1}},\"$state\":{\"store\":\"appState\"}}]}"}} +{ "create" : { "_id": "AV-YyJw3PfR7HJex-ZdY", "_type": "visualization" } } +{"title":"All index TS event count","visState":"{\"title\":\"All index TS event count\",\"type\":\"metrics\",\"params\":{\"id\":\"eac7cbe0-c411-11e7-a0b9-2137696bd057\",\"type\":\"metric\",\"series\":[{\"id\":\"eac7cbe1-c411-11e7-a0b9-2137696bd057\",\"color\":\"#68BC00\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"eac7cbe2-c411-11e7-a0b9-2137696bd057\",\"type\":\"count\"}],\"seperate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"number\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"label\":\"Event Count\",\"split_filters\":[{\"color\":\"#68BC00\",\"id\":\"89be23f0-c4af-11e7-ac01-25d5c1ff2e49\"}],\"series_drop_last_bucket\":0}],\"time_field\":\"timestamp\",\"index_pattern\":\"bro_index*,snort_index*,yaf_index*\",\"interval\":\"1y\",\"axis_position\":\"left\",\"axis_formatter\":\"number\",\"show_legend\":1,\"background_color_rules\":[{\"id\":\"022dc960-c412-11e7-a0b9-2137696bd057\"}],\"bar_color_rules\":[{\"id\":\"21ffb0f0-c412-11e7-a0b9-2137696bd057\"}],\"filter\":\"\",\"drop_last_bucket\":0},\"aggs\":[],\"listeners\":{}}","uiStateJSON":"{}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"match_all\":{}},\"filter\":[]}"}} +{ "create" : { "_id": "AV-cBm5JFLIoshSSHghu", "_type": "visualization" } } +{"title":"All index TS Chart","visState":"{\"title\":\"All index TS Chart\",\"type\":\"metrics\",\"params\":{\"id\":\"eac7cbe0-c411-11e7-a0b9-2137696bd057\",\"type\":\"timeseries\",\"series\":[{\"id\":\"eac7cbe1-c411-11e7-a0b9-2137696bd057\",\"color\":\"rgba(0,156,224,1)\",\"split_mode\":\"terms\",\"metrics\":[{\"id\":\"eac7cbe2-c411-11e7-a0b9-2137696bd057\",\"type\":\"count\"}],\"seperate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"number\",\"chart_type\":\"bar\",\"line_width\":\"1\",\"point_size\":1,\"fill\":0.5,\"stacked\":\"stacked\",\"label\":\"Events\",\"terms_field\":\"source:type\",\"value_template\":\"{{value}}\"}],\"time_field\":\"timestamp\",\"index_pattern\":\"bro*,snort*,yaf*\",\"interval\":\"30s\",\"axis_position\":\"left\",\"axis_formatter\":\"number\",\"show_legend\":1,\"background_color_rules\":[{\"id\":\"022dc960-c412-11e7-a0b9-2137696bd057\"}],\"bar_color_rules\":[{\"id\":\"21ffb0f0-c412-11e7-a0b9-2137696bd057\"}],\"show_grid\":1,\"drop_last_bucket\":0},\"aggs\":[],\"listeners\":{}}","uiStateJSON":"{}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"match_all\":{}},\"filter\":[]}"}} +{ "create" : { "_id": "AV-dXz9Lk7f2nZ-iH3Kb", "_type": "visualization" } } +{"title":"Event Count Pie Chart","visState":"{\"title\":\"Event Count Pie Chart\",\"type\":\"pie\",\"params\":{\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"right\",\"isDonut\":false,\"type\":\"pie\"},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{\"customLabel\":\"Events by Source Type\"}},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"segment\",\"params\":{\"field\":\"source:type\",\"size\":5,\"order\":\"desc\",\"orderBy\":\"1\"}}],\"listeners\":{}}","uiStateJSON":"{}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"index\":\"all-metron-index\",\"query\":{\"match_all\":{}},\"filter\":[{\"meta\":{\"index\":\"all-metron-index\",\"type\":\"phrases\",\"key\":\"source:type\",\"value\":\"bro, snort, yaf\",\"params\":[\"bro\",\"snort\",\"yaf\"],\"negate\":false,\"disabled\":false,\"alias\":null},\"query\":{\"bool\":{\"should\":[{\"match_phrase\":{\"source:type\":\"bro\"}},{\"match_phrase\":{\"source:type\":\"snort\"}},{\"match_phrase\":{\"source:type\":\"yaf\"}}],\"minimum_should_match\":1}},\"$state\":{\"store\":\"appState\"}}]}"}} +{ "create" : { "_id": "AV-ddhh7k7f2nZ-iH3Kx", "_type": "visualization" } } +{"title":"Flow Location Map","visState":"{\"title\":\"Flow Location Map\",\"type\":\"tile_map\",\"params\":{\"mapType\":\"Scaled Circle Markers\",\"isDesaturated\":true,\"addTooltip\":true,\"heatMaxZoom\":0,\"heatMinOpacity\":0.1,\"heatRadius\":25,\"heatBlur\":15,\"legendPosition\":\"bottomright\",\"mapZoom\":2,\"mapCenter\":[0,0],\"wms\":{\"enabled\":false,\"url\":\"https://basemap.nationalmap.gov/arcgis/services/USGSTopo/MapServer/WMSServer\",\"options\":{\"version\":\"1.3.0\",\"layers\":\"0\",\"format\":\"image/png\",\"transparent\":true,\"attribution\":\"Maps provided by USGS\",\"styles\":\"\"}},\"type\":\"tile_map\"},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"geohash_grid\",\"schema\":\"segment\",\"params\":{\"field\":\"enrichments:geo:ip_src_addr:location_point\",\"autoPrecision\":true,\"useGeocentroid\":true,\"precision\":2,\"customLabel\":\"Flow Source Locations\"}}],\"listeners\":{}}","uiStateJSON":"{}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"index\":\"all-metron-index\",\"query\":{\"match_all\":{}},\"filter\":[{\"meta\":{\"index\":\"all-metron-index\",\"type\":\"phrases\",\"key\":\"source:type\",\"value\":\"bro, snort, yaf\",\"params\":[\"bro\",\"snort\",\"yaf\"],\"negate\":false,\"disabled\":false,\"alias\":null},\"query\":{\"bool\":{\"should\":[{\"match_phrase\":{\"source:type\":\"bro\"}},{\"match_phrase\":{\"source:type\":\"snort\"}},{\"match_phrase\":{\"source:type\":\"yaf\"}}],\"minimum_should_match\":1}},\"$state\":{\"store\":\"appState\"}}]}"}} +{ "create" : { "_id": "AV-dfk_gk7f2nZ-iH3K0", "_type": "visualization" } } +{"title":"Events By Country","visState":"{\"title\":\"Events By Country\",\"type\":\"pie\",\"params\":{\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"right\",\"isDonut\":false,\"type\":\"pie\"},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"segment\",\"params\":{\"field\":\"enrichments:geo:ip_src_addr:country\",\"size\":5,\"order\":\"desc\",\"orderBy\":\"1\"}}],\"listeners\":{}}","uiStateJSON":"{\"spy\":{\"mode\":{\"name\":null,\"fill\":false}}}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"index\":\"all-metron-index\",\"query\":{\"match_all\":{}},\"filter\":[{\"meta\":{\"index\":\"all-metron-index\",\"type\":\"phrases\",\"key\":\"source:type\",\"value\":\"bro, snort, yaf\",\"params\":[\"bro\",\"snort\",\"yaf\"],\"negate\":false,\"disabled\":false,\"alias\":null},\"query\":{\"bool\":{\"should\":[{\"match_phrase\":{\"source:type\":\"bro\"}},{\"match_phrase\":{\"source:type\":\"snort\"}},{\"match_phrase\":{\"source:type\":\"yaf\"}}],\"minimum_should_match\":1}},\"$state\":{\"store\":\"appState\"}}]}"}} +{ "create" : { "_id": "AV-TUPlDgto7-W6O2b3n", "_type": "index-pattern" } } +{"title":"yaf_index*","timeFieldName":"timestamp","notExpandable":true,"fields":"[{\"name\":\"_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_index\",\"type\":\"string\",\"count\":1,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_source\",\"type\":\"_source\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"adapter:geoadapter:begin:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"adapter:geoadapter:end:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"adapter:hostfromjsonlistadapter:begin:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"adapter:hostfromjsonlistadapter:end:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"adapter:threatinteladapter:begin:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"adapter:threatinteladapter:end:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"app\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"dip\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"dp\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"duration\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"end-reason\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"end_reason\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"end_reason.keyword\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"end_time\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichmentjoinbolt:joiner:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_dst_addr:city\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_dst_addr:country\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_dst_addr:dmaCode\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_dst_addr:latitude\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_dst_addr:locID\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_dst_addr:location_point\",\"type\":\"geo_point\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_dst_addr:longitude\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_dst_addr:postalCode\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_src_addr:city\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_src_addr:country\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_src_addr:dmaCode\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_src_addr:latitude\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_src_addr:locID\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_src_addr:location_point\",\"type\":\"geo_point\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_src_addr:longitude\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_src_addr:postalCode\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichmentsplitterbolt:splitter:begin:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichmentsplitterbolt:splitter:end:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"guid\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"guid.keyword\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"iflags\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"ip_dst_addr\",\"type\":\"ip\",\"count\":1,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"ip_dst_port\",\"type\":\"number\",\"count\":1,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"ip_src_addr\",\"type\":\"ip\",\"count\":1,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"ip_src_port\",\"type\":\"number\",\"count\":1,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"isn\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"oct\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"original_string\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"original_string.keyword\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"pkt\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"proto\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"protocol\",\"type\":\"string\",\"count\":1,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"protocol.keyword\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"riflags\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"risn\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"roct\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"rpkt\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"rtag\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"rtt\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"ruflags\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"sip\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"source:type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"sp\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"start_time\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"tag\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"threatinteljoinbolt:joiner:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"threatintelsplitterbolt:splitter:begin:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"threatintelsplitterbolt:splitter:end:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"timestamp\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"uflags\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true}]"} +{ "create" : { "_id": "AV-eebabk7f2nZ-iH3L1", "_type": "visualization" } } +{"title":"YAF Flow Duration","visState":"{\"title\":\"YAF Flow Duration\",\"type\":\"area\",\"params\":{\"grid\":{\"categoryLines\":false,\"style\":{\"color\":\"#eee\"}},\"categoryAxes\":[{\"id\":\"CategoryAxis-1\",\"type\":\"category\",\"position\":\"bottom\",\"show\":true,\"style\":{},\"scale\":{\"type\":\"linear\"},\"labels\":{\"show\":true,\"truncate\":100},\"title\":{\"text\":\"Flow Duration (seconds)\"}}],\"valueAxes\":[{\"id\":\"ValueAxis-1\",\"name\":\"LeftAxis-1\",\"type\":\"value\",\"position\":\"left\",\"show\":true,\"style\":{},\"scale\":{\"type\":\"linear\",\"mode\":\"normal\"},\"labels\":{\"show\":true,\"rotate\":0,\"filter\":false,\"truncate\":100},\"title\":{\"text\":\"Count\"}}],\"seriesParams\":[{\"show\":\"true\",\"type\":\"area\",\"mode\":\"stacked\",\"data\":{\"label\":\"Count\",\"id\":\"1\"},\"drawLinesBetweenPoints\":true,\"showCircles\":true,\"interpolate\":\"linear\",\"valueAxis\":\"ValueAxis-1\"}],\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"right\",\"times\":[],\"addTimeMarker\":false,\"type\":\"area\"},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"segment\",\"params\":{\"field\":\"duration\",\"size\":5,\"order\":\"desc\",\"orderBy\":\"1\",\"customLabel\":\"Flow Duration (seconds)\"}}],\"listeners\":{}}","uiStateJSON":"{\"vis\":{\"legendOpen\":false}}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"index\":\"AV-TUPlDgto7-W6O2b3n\",\"query\":{\"match_all\":{}},\"filter\":[]}"}} +{ "create" : { "_id": "AV-deDqXk7f2nZ-iH3Ky", "_type": "visualization" } } +{"title":"Geo-IP Locations","visState":"{\"title\":\"Geo-IP Locations\",\"type\":\"metric\",\"params\":{\"addTooltip\":true,\"addLegend\":false,\"type\":\"gauge\",\"gauge\":{\"verticalSplit\":false,\"autoExtend\":false,\"percentageMode\":false,\"gaugeType\":\"Metric\",\"gaugeStyle\":\"Full\",\"backStyle\":\"Full\",\"orientation\":\"vertical\",\"colorSchema\":\"Green to Red\",\"gaugeColorMode\":\"None\",\"useRange\":false,\"colorsRange\":[{\"from\":0,\"to\":100}],\"invertColors\":false,\"labels\":{\"show\":false,\"color\":\"black\"},\"scale\":{\"show\":false,\"labels\":false,\"color\":\"#333\",\"width\":2},\"type\":\"simple\",\"style\":{\"fontSize\":\"60\",\"bgColor\":false,\"labelColor\":false,\"subText\":\"\"}}},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"cardinality\",\"schema\":\"metric\",\"params\":{\"field\":\"enrichments:geo:ip_src_addr:country\",\"customLabel\":\"Unique Location(s)\"}}],\"listeners\":{}}","uiStateJSON":"{\"vis\":{\"defaultColors\":{\"0 - 100\":\"rgb(0,104,55)\"}}}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"index\":\"all-metron-index\",\"query\":{\"match_all\":{}},\"filter\":[{\"meta\":{\"index\":\"all-metron-index\",\"type\":\"phrases\",\"key\":\"source:type\",\"value\":\"bro, snort, yaf\",\"params\":[\"bro\",\"snort\",\"yaf\"],\"negate\":false,\"disabled\":false,\"alias\":null},\"query\":{\"bool\":{\"should\":[{\"match_phrase\":{\"source:type\":\"bro\"}},{\"match_phrase\":{\"source:type\":\"snort\"}},{\"match_phrase\":{\"source:type\":\"yaf\"}}],\"minimum_should_match\":1}},\"$state\":{\"store\":\"appState\"}}]}"}} +{ "create" : { "_id": "AV-YvG0DPfR7HJex-ZaS", "_type": "visualization" } } +{"title":"Event Count","visState":"{\"title\":\"Event Count\",\"type\":\"metric\",\"params\":{\"addLegend\":false,\"addTooltip\":true,\"gauge\":{\"autoExtend\":false,\"backStyle\":\"Full\",\"colorSchema\":\"Green to Red\",\"colorsRange\":[{\"from\":0,\"to\":100}],\"gaugeColorMode\":\"None\",\"gaugeStyle\":\"Full\",\"gaugeType\":\"Metric\",\"invertColors\":false,\"labels\":{\"color\":\"black\",\"show\":false},\"orientation\":\"vertical\",\"percentageMode\":false,\"scale\":{\"color\":\"#333\",\"labels\":false,\"show\":false,\"width\":2},\"style\":{\"bgColor\":false,\"fontSize\":\"60\",\"labelColor\":false,\"subText\":\"\",\"bgFill\":\"\"},\"type\":\"simple\",\"useRange\":false,\"verticalSplit\":false},\"type\":\"gauge\"},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{\"customLabel\":\"Event Count\"}}],\"listeners\":{}}","uiStateJSON":"{\"vis\":{\"defaultColors\":{\"0 - 100\":\"rgb(0,104,55)\"}}}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"index\":\"all-metron-index\",\"query\":{\"match_all\":{}},\"filter\":[{\"meta\":{\"index\":\"all-metron-index\",\"type\":\"phrases\",\"key\":\"source:type\",\"value\":\"bro, snort, yaf\",\"params\":[\"bro\",\"snort\",\"yaf\"],\"negate\":false,\"disabled\":false,\"alias\":null},\"query\":{\"bool\":{\"should\":[{\"match_phrase\":{\"source:type\":\"bro\"}},{\"match_phrase\":{\"source:type\":\"snort\"}},{\"match_phrase\":{\"source:type\":\"yaf\"}}],\"minimum_should_match\":1}},\"$state\":{\"store\":\"appState\"}}]}"}} +{ "create" : { "_id": "AV-ejKEdk7f2nZ-iH3MI", "_type": "visualization" } } +{"title":"Web Requests","visState":"{\"title\":\"Web Requests\",\"type\":\"metric\",\"params\":{\"addTooltip\":true,\"addLegend\":false,\"type\":\"gauge\",\"gauge\":{\"verticalSplit\":false,\"autoExtend\":false,\"percentageMode\":false,\"gaugeType\":\"Metric\",\"gaugeStyle\":\"Full\",\"backStyle\":\"Full\",\"orientation\":\"vertical\",\"colorSchema\":\"Green to Red\",\"gaugeColorMode\":\"None\",\"useRange\":false,\"colorsRange\":[{\"from\":0,\"to\":100}],\"invertColors\":false,\"labels\":{\"show\":false,\"color\":\"black\"},\"scale\":{\"show\":false,\"labels\":false,\"color\":\"#333\",\"width\":2},\"type\":\"simple\",\"style\":{\"fontSize\":60,\"bgColor\":false,\"labelColor\":false,\"subText\":\"\"}}},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}}],\"listeners\":{}}","uiStateJSON":"{\"vis\":{\"defaultColors\":{\"0 - 100\":\"rgb(0,104,55)\"}}}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"index\":\"AV-S2e81hKs1cXXnFMqN\",\"query\":{\"match_all\":{}},\"filter\":[{\"meta\":{\"index\":\"AV-S2e81hKs1cXXnFMqN\",\"type\":\"phrases\",\"key\":\"protocol\",\"value\":\"http, https\",\"params\":[\"http\",\"https\"],\"negate\":false,\"disabled\":false,\"alias\":null},\"query\":{\"bool\":{\"should\":[{\"match_phrase\":{\"protocol\":\"http\"}},{\"match_phrase\":{\"protocol\":\"https\"}}],\"minimum_should_match\":1}},\"$state\":{\"store\":\"appState\"}}]}"}} +{ "create" : { "_id": "AV-ejbG6k7f2nZ-iH3MJ", "_type": "visualization" } } +{"title":"DNS Requests","visState":"{\"title\":\"DNS Requests\",\"type\":\"metric\",\"params\":{\"addTooltip\":true,\"addLegend\":false,\"type\":\"gauge\",\"gauge\":{\"verticalSplit\":false,\"autoExtend\":false,\"percentageMode\":false,\"gaugeType\":\"Metric\",\"gaugeStyle\":\"Full\",\"backStyle\":\"Full\",\"orientation\":\"vertical\",\"colorSchema\":\"Green to Red\",\"gaugeColorMode\":\"None\",\"useRange\":false,\"colorsRange\":[{\"from\":0,\"to\":100}],\"invertColors\":false,\"labels\":{\"show\":false,\"color\":\"black\"},\"scale\":{\"show\":false,\"labels\":false,\"color\":\"#333\",\"width\":2},\"type\":\"simple\",\"style\":{\"fontSize\":60,\"bgColor\":false,\"labelColor\":false,\"subText\":\"\"}}},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}}],\"listeners\":{}}","uiStateJSON":"{\"vis\":{\"defaultColors\":{\"0 - 100\":\"rgb(0,104,55)\"}}}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"index\":\"AV-S2e81hKs1cXXnFMqN\",\"query\":{\"match_all\":{}},\"filter\":[{\"meta\":{\"index\":\"AV-S2e81hKs1cXXnFMqN\",\"negate\":false,\"disabled\":false,\"alias\":null,\"type\":\"phrase\",\"key\":\"protocol\",\"value\":\"dns\"},\"query\":{\"match\":{\"protocol\":{\"query\":\"dns\",\"type\":\"phrase\"}}},\"$state\":{\"store\":\"appState\"}}]}"}} +{ "create" : { "_id": "AV-eh5Wgk7f2nZ-iH3MG", "_type": "visualization" } } +{"title":"Snort Alert Types","visState":"{\"title\":\"Snort Alert Types\",\"type\":\"metric\",\"params\":{\"addTooltip\":true,\"addLegend\":false,\"type\":\"gauge\",\"gauge\":{\"verticalSplit\":false,\"autoExtend\":false,\"percentageMode\":false,\"gaugeType\":\"Metric\",\"gaugeStyle\":\"Full\",\"backStyle\":\"Full\",\"orientation\":\"vertical\",\"colorSchema\":\"Green to Red\",\"gaugeColorMode\":\"None\",\"useRange\":false,\"colorsRange\":[{\"from\":0,\"to\":100}],\"invertColors\":false,\"labels\":{\"show\":false,\"color\":\"black\"},\"scale\":{\"show\":false,\"labels\":false,\"color\":\"#333\",\"width\":2},\"type\":\"simple\",\"style\":{\"fontSize\":60,\"bgColor\":false,\"labelColor\":false,\"subText\":\"\"}}},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"cardinality\",\"schema\":\"metric\",\"params\":{\"field\":\"sig_id\",\"customLabel\":\"Alert Type(s)\"}}],\"listeners\":{}}","uiStateJSON":"{\"vis\":{\"defaultColors\":{\"0 - 100\":\"rgb(0,104,55)\"}}}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"index\":\"AV-TAoyPhKs1cXXnFMqi\",\"query\":{\"match_all\":{}},\"filter\":[]}"}} +{ "create" : { "_id": "AV-ecrFkk7f2nZ-iH3L0", "_type": "visualization" } } +{"title":"Yaf Flows Count","visState":"{\"title\":\"Yaf Flows Count\",\"type\":\"metric\",\"params\":{\"addTooltip\":true,\"addLegend\":false,\"type\":\"gauge\",\"gauge\":{\"verticalSplit\":false,\"autoExtend\":false,\"percentageMode\":false,\"gaugeType\":\"Metric\",\"gaugeStyle\":\"Full\",\"backStyle\":\"Full\",\"orientation\":\"vertical\",\"colorSchema\":\"Green to Red\",\"gaugeColorMode\":\"None\",\"useRange\":false,\"colorsRange\":[{\"from\":0,\"to\":100}],\"invertColors\":false,\"labels\":{\"show\":false,\"color\":\"black\"},\"scale\":{\"show\":false,\"labels\":false,\"color\":\"#333\",\"width\":2},\"type\":\"simple\",\"style\":{\"fontSize\":60,\"bgColor\":false,\"labelColor\":false,\"subText\":\"\"}}},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}}],\"listeners\":{}}","uiStateJSON":"{\"vis\":{\"defaultColors\":{\"0 - 100\":\"rgb(0,104,55)\"}}}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"index\":\"AV-TUPlDgto7-W6O2b3n\",\"query\":{\"match_all\":{}},\"filter\":[]}"}} +{ "create" : { "_id": "AV-ek_Jnk7f2nZ-iH3MK", "_type": "visualization" } } +{"title":"Web Request Type","visState":"{\"title\":\"Web Request Type\",\"type\":\"pie\",\"params\":{\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"right\",\"isDonut\":false,\"type\":\"pie\"},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"segment\",\"params\":{\"field\":\"method\",\"size\":5,\"order\":\"desc\",\"orderBy\":\"1\"}}],\"listeners\":{}}","uiStateJSON":"{}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"index\":\"AV-S2e81hKs1cXXnFMqN\",\"query\":{\"match_all\":{}},\"filter\":[{\"meta\":{\"index\":\"AV-S2e81hKs1cXXnFMqN\",\"type\":\"phrases\",\"key\":\"protocol\",\"value\":\"http, https\",\"params\":[\"http\",\"https\"],\"negate\":false,\"disabled\":false,\"alias\":null},\"query\":{\"bool\":{\"should\":[{\"match_phrase\":{\"protocol\":\"http\"}},{\"match_phrase\":{\"protocol\":\"https\"}}],\"minimum_should_match\":1}},\"$state\":{\"store\":\"appState\"}}]}"}} +{ "create" : { "_id": "AV-S2e81hKs1cXXnFMqN", "_type": "index-pattern" } } +{"title":"bro_index*","timeFieldName":"timestamp","notExpandable":true,"fields":"[{\"name\":\"AA\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"RA\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"RD\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"TC\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"TTLs\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"Z\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_index\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_source\",\"type\":\"_source\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"actions\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"adapter:geoadapter:begin:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"adapter:geoadapter:end:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"adapter:hostfromjsonlistadapter:begin:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"adapter:hostfromjsonlistadapter:end:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"adapter:threatinteladapter:begin:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"adapter:threatinteladapter:end:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"addl\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"analyzer\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"analyzers\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"answers\",\"type\":\"string\",\"count\":1,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"arg\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"assigned_ip\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"auth_attempts\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"auth_success\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"basic_constraints:ca\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"basic_constraints:path_len\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"bro_timestamp\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"bro_timestamp.keyword\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"capture_password\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"certificate:curve\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"certificate:exponent\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"certificate:issuer\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"certificate:key_alg\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"certificate:key_length\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"certificate:key_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"certificate:not_valid_after\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"certificate:not_valid_before\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"certificate:serial\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"certificate:sig_alg\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"certificate:subject\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"certificate:version\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"cipher\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"cipher_alg\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"client\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"command\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"compression_alg\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"conn_state\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"conn_uids\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"connect_info\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"curve\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"cwd\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"data_channel:orig_h\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"data_channel:passive\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"data_channel:resp_h\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"data_channel:resp_p\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"date\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"depth\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"dhcp_host_name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"direction\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"dropped\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"dst\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"duration\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichmentjoinbolt:joiner:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_dst_addr:city\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_dst_addr:country\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_dst_addr:dmaCode\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_dst_addr:latitude\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_dst_addr:locID\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_dst_addr:location_point\",\"type\":\"geo_point\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_dst_addr:longitude\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_dst_addr:postalCode\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichmentsplitterbolt:splitter:begin:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichmentsplitterbolt:splitter:end:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"established\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"failure_reason\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"file_desc\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"file_mime_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"file_size\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"filename\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"first_received\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"from\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"fuid\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"fuids\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"guid\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"guid.keyword\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"helo\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"history\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host\",\"type\":\"string\",\"count\":2,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host_key\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host_key_alg\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host_p\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"in_reply_to\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"ip_dst_addr\",\"type\":\"ip\",\"count\":2,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"ip_dst_port\",\"type\":\"number\",\"count\":1,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"ip_src_addr\",\"type\":\"ip\",\"count\":2,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"ip_src_port\",\"type\":\"number\",\"count\":1,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"is_orig\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"is_webmail\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"issuer_subject\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"kex_alg\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"last_alert\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"last_reply\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"lease_time\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"local_orig\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"local_resp\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"mac\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"mac_alg\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"mailfrom\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"md5\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"method\",\"type\":\"string\",\"count\":2,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"mime_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"missed_bytes\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"missing_bytes\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"msg\",\"type\":\"string\",\"count\":1,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"msg_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"n\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"next_protocol\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"note\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"notice\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"orig_bytes\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"orig_fuids\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"orig_fuids.keyword\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"orig_ip_bytes\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"orig_mime_types\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"orig_mime_types.keyword\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"orig_pkts\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"original_string\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"original_string.keyword\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"overflow_bytes\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"p\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"parent_fuid\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"passive\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"password\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"path\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"peer\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"peer_descr\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"port_num\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"proto\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"protocol\",\"type\":\"string\",\"count\":1,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"protocol.keyword\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"qclass\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"qclass_name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"qtype\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"qtype_name\",\"type\":\"string\",\"count\":1,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"query\",\"type\":\"string\",\"count\":1,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"rcode\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"rcode_name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"rcptto\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"referrer\",\"type\":\"string\",\"count\":2,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"rejected\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"remote_ip\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"reply_code\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"reply_msg\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"reply_to\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"request_body_len\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"resp_bytes\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"resp_fuids\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"resp_fuids.keyword\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"resp_ip_bytes\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"resp_mime_types\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"resp_mime_types.keyword\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"resp_pkts\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"response_body_len\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"result\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"resumed\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"san:dns\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"san:email\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"san:ip\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"san:uri\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"second_received\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"seen_bytes\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"serial\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"server\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"server_name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"service\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"sha1\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"sha256\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"software_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"source\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"source:type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"src\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"src_peer\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"status_code\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"status_msg\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"sub\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"subject\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"suppress_for\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"threatinteljoinbolt:joiner:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"threatintelsplitterbolt:splitter:begin:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"threatintelsplitterbolt:splitter:end:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"timedout\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"timestamp\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"tls\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"to\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"total_bytes\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"trans_depth\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"trans_id\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"tunnel_parents\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"uid\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"unparsed_version\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"uri\",\"type\":\"string\",\"count\":2,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"user\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"user_agent\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"username\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"version\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"version:addl\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"version:major\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"version:minor\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"version:minor2\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"version:minor3\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"x_originating_ip\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true}]"} +{ "create" : { "_id": "AV-TAoyPhKs1cXXnFMqi", "_type": "index-pattern" } } +{"title":"snort_index*","timeFieldName":"timestamp","notExpandable":true,"fields":"[{\"name\":\"_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_index\",\"type\":\"string\",\"count\":1,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_source\",\"type\":\"_source\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"adapter:geoadapter:begin:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"adapter:geoadapter:end:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"adapter:hostfromjsonlistadapter:begin:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"adapter:hostfromjsonlistadapter:end:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"adapter:threatinteladapter:begin:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"adapter:threatinteladapter:end:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"dgmlen\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichmentjoinbolt:joiner:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_dst_addr:city\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_dst_addr:country\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_dst_addr:dmaCode\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_dst_addr:latitude\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_dst_addr:locID\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_dst_addr:location_point\",\"type\":\"geo_point\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_dst_addr:longitude\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_dst_addr:postalCode\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_src_addr:city\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_src_addr:country\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_src_addr:dmaCode\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_src_addr:latitude\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_src_addr:locID\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_src_addr:location_point\",\"type\":\"geo_point\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_src_addr:longitude\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichments:geo:ip_src_addr:postalCode\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichmentsplitterbolt:splitter:begin:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"enrichmentsplitterbolt:splitter:end:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"ethdst\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"ethlen\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"ethsrc\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"guid\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"guid.keyword\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"id\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"ip_dst_addr\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"ip_dst_port\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"ip_src_addr\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"ip_src_port\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"iplen\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"is_alert\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"msg\",\"type\":\"string\",\"count\":1,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"original_string\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"original_string.keyword\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"protocol\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"sig_generator\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"sig_id\",\"type\":\"number\",\"count\":1,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"sig_rev\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"source:type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"tcpack\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"tcpflags\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"tcpseq\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"tcpwindow\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"threat:triage:level\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"threat:triage:rules:0:score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"threat:triage:score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"threatinteljoinbolt:joiner:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"threatintelsplitterbolt:splitter:begin:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"threatintelsplitterbolt:splitter:end:ts\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"timestamp\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"tos\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"ttl\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true}]"} +{ "create" : { "_id": "AV-YpDmwdXwc6Ua9Muh9", "_type": "dashboard" } } +{"title":"Metron-Dashboard","hits":0,"description":"","panelsJSON":"[{\"col\":1,\"id\":\"AV-Sj0e2hKs1cXXnFMqF\",\"panelIndex\":1,\"row\":1,\"size_x\":12,\"size_y\":3,\"type\":\"visualization\"},{\"col\":4,\"id\":\"AV-cBm5JFLIoshSSHghu\",\"panelIndex\":3,\"row\":4,\"size_x\":9,\"size_y\":6,\"type\":\"visualization\"},{\"col\":1,\"id\":\"AV-YvG0DPfR7HJex-ZaS\",\"panelIndex\":4,\"row\":4,\"size_x\":3,\"size_y\":3,\"type\":\"visualization\"},{\"col\":1,\"id\":\"AV-dXz9Lk7f2nZ-iH3Kb\",\"panelIndex\":5,\"row\":7,\"size_x\":3,\"size_y\":3,\"type\":\"visualization\"},{\"col\":1,\"id\":\"AV-dYnlek7f2nZ-iH3Kc\",\"panelIndex\":6,\"row\":10,\"size_x\":3,\"size_y\":2,\"type\":\"visualization\"},{\"col\":1,\"id\":\"AV-deDqXk7f2nZ-iH3Ky\",\"panelIndex\":7,\"row\":12,\"size_x\":3,\"size_y\":3,\"type\":\"visualization\"},{\"col\":1,\"id\":\"AV-dfk_gk7f2nZ-iH3K0\",\"panelIndex\":8,\"row\":15,\"size_x\":3,\"size_y\":2,\"type\":\"visualization\"},{\"col\":4,\"id\":\"AV-ddhh7k7f2nZ-iH3Kx\",\"panelIndex\":9,\"row\":10,\"size_x\":9,\"size_y\":7,\"type\":\"visualization\"},{\"col\":1,\"id\":\"AV-dYtN5k7f2nZ-iH3Kd\",\"panelIndex\":10,\"row\":17,\"size_x\":3,\"size_y\":2,\"type\":\"visualization\"},{\"col\":1,\"id\":\"AV-dYxfHk7f2nZ-iH3Ke\",\"panelIndex\":11,\"row\":24,\"size_x\":3,\"size_y\":2,\"type\":\"visualization\"},{\"col\":1,\"id\":\"AV-dY9zbk7f2nZ-iH3Kf\",\"panelIndex\":12,\"row\":31,\"size_x\":3,\"size_y\":2,\"type\":\"visualization\"},{\"col\":1,\"id\":\"AV-dZKsfk7f2nZ-iH3Kg\",\"panelIndex\":13,\"row\":38,\"size_x\":3,\"size_y\":2,\"type\":\"visualization\"},{\"col\":4,\"columns\":[\"ip_src_addr\",\"ip_src_port\",\"ip_dst_addr\",\"ip_dst_port\",\"protocol\"],\"id\":\"AV-eSl9lk7f2nZ-iH3Lj\",\"panelIndex\":14,\"row\":17,\"size_x\":9,\"size_y\":7,\"sort\":[\"timestamp\",\"desc\"],\"type\":\"search\"},{\"col\":1,\"id\":\"AV-ecrFkk7f2nZ-iH3L0\",\"panelIndex\":15,\"row\":19,\"size_x\":3,\"size_y\":3,\"type\":\"visualization\"},{\"col\":1,\"id\":\"AV-eebabk7f2nZ-iH3L1\",\"panelIndex\":16,\"row\":22,\"size_x\":3,\"size_y\":2,\"type\":\"visualization\"},{\"col\":1,\"id\":\"AV-eh5Wgk7f2nZ-iH3MG\",\"panelIndex\":17,\"row\":26,\"size_x\":3,\"size_y\":3,\"type\":\"visualization\"},{\"col\":1,\"id\":\"AV-ejKEdk7f2nZ-iH3MI\",\"panelIndex\":18,\"row\":33,\"size_x\":3,\"size_y\":3,\"type\":\"visualization\"},{\"col\":1,\"id\":\"AV-ejbG6k7f2nZ-iH3MJ\",\"panelIndex\":19,\"row\":40,\"size_x\":3,\"size_y\":3,\"type\":\"visualization\"},{\"col\":4,\"columns\":[\"msg\",\"sig_id\",\"ip_src_addr\",\"ip_src_port\",\"ip_dst_addr\",\"ip_dst_port\",\"protocol\"],\"id\":\"AV-eloCYk7f2nZ-iH3ML\",\"panelIndex\":20,\"row\":24,\"size_x\":9,\"size_y\":7,\"sort\":[\"timestamp\",\"desc\"],\"type\":\"search\"},{\"col\":4,\"columns\":[\"method\",\"host\",\"uri\",\"referrer\"],\"id\":\"AV-eltB3k7f2nZ-iH3MM\",\"panelIndex\":21,\"row\":31,\"size_x\":9,\"size_y\":7,\"sort\":[\"timestamp\",\"desc\"],\"type\":\"search\"},{\"col\":4,\"columns\":[\"query\",\"qtype_name\",\"answers\",\"ip_src_addr\",\"ip_dst_addr\"],\"id\":\"AV-emMQYk7f2nZ-iH3MN\",\"panelIndex\":22,\"row\":38,\"size_x\":9,\"size_y\":7,\"sort\":[\"timestamp\",\"desc\"],\"type\":\"search\"},{\"col\":1,\"id\":\"AV-ek_Jnk7f2nZ-iH3MK\",\"panelIndex\":23,\"row\":36,\"size_x\":3,\"size_y\":2,\"type\":\"visualization\"},{\"size_x\":3,\"size_y\":2,\"panelIndex\":24,\"type\":\"visualization\",\"id\":\"AV-eoTnqk7f2nZ-iH3MO\",\"col\":1,\"row\":29}]","optionsJSON":"{\"darkTheme\":false}","uiStateJSON":"{\"P-4\":{\"vis\":{\"defaultColors\":{\"0 - 100\":\"rgb(0,104,55)\"},\"legendOpen\":false}},\"P-5\":{\"spy\":{\"mode\":{\"fill\":false,\"name\":null}}},\"P-7\":{\"vis\":{\"defaultColors\":{\"0 - 100\":\"rgb(0,104,55)\"}}},\"P-15\":{\"vis\":{\"defaultColors\":{\"0 - 100\":\"rgb(0,104,55)\"}}},\"P-17\":{\"vis\":{\"defaultColors\":{\"0 - 100\":\"rgb(0,104,55)\"}}},\"P-18\":{\"vis\":{\"defaultColors\":{\"0 - 100\":\"rgb(0,104,55)\"}}},\"P-19\":{\"vis\":{\"defaultColors\":{\"0 - 100\":\"rgb(0,104,55)\"}}},\"P-24\":{\"vis\":{\"params\":{\"sort\":{\"columnIndex\":null,\"direction\":null}}}}}","version":1,"timeRestore":false,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"filter\":[{\"query\":{\"match_all\":{}}}],\"highlightAll\":true,\"version\":true}"}} +{ "create" : { "_id": "AV-eoTnqk7f2nZ-iH3MO", "_type": "visualization" } } +{"title":"Snort Top Alerts By Host","visState":"{\"title\":\"Snort Top Alerts By Host\",\"type\":\"table\",\"params\":{\"perPage\":10,\"showPartialRows\":false,\"showMeticsAtAllLevels\":false,\"sort\":{\"columnIndex\":null,\"direction\":null},\"showTotal\":false,\"totalFunc\":\"sum\",\"type\":\"table\"},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{\"customLabel\":\"Count\"}},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"bucket\",\"params\":{\"field\":\"ip_src_addr\",\"size\":5,\"order\":\"desc\",\"orderBy\":\"1\",\"customLabel\":\"Source\"}},{\"id\":\"3\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"bucket\",\"params\":{\"field\":\"ip_dst_addr\",\"size\":5,\"order\":\"desc\",\"orderBy\":\"1\",\"customLabel\":\"Destination\"}}],\"listeners\":{}}","uiStateJSON":"{\"vis\":{\"params\":{\"sort\":{\"columnIndex\":null,\"direction\":null}}}}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"index\":\"AV-TAoyPhKs1cXXnFMqi\",\"query\":{\"match_all\":{}},\"filter\":[]}"}} +{ "create" : { "_id": "AV-eltB3k7f2nZ-iH3MM", "_type": "search" } } +{"title":"Web Requests","description":"","hits":0,"columns":["method","host","uri","referrer"],"sort":["timestamp","desc"],"version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"index\":\"AV-S2e81hKs1cXXnFMqN\",\"highlightAll\":true,\"version\":true,\"query\":{\"match_all\":{}},\"filter\":[{\"meta\":{\"index\":\"AV-S2e81hKs1cXXnFMqN\",\"type\":\"phrases\",\"key\":\"protocol\",\"value\":\"http, https\",\"params\":[\"http\",\"https\"],\"negate\":false,\"disabled\":false,\"alias\":null},\"query\":{\"bool\":{\"should\":[{\"match_phrase\":{\"protocol\":\"http\"}},{\"match_phrase\":{\"protocol\":\"https\"}}],\"minimum_should_match\":1}},\"$state\":{\"store\":\"appState\"}}]}"}} +{ "create" : { "_id": "AV-emMQYk7f2nZ-iH3MN", "_type": "search" } } +{"title":"DNS Requests","description":"","hits":0,"columns":["query","qtype_name","answers","ip_src_addr","ip_dst_addr"],"sort":["timestamp","desc"],"version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"index\":\"AV-S2e81hKs1cXXnFMqN\",\"highlightAll\":true,\"version\":true,\"query\":{\"match_all\":{}},\"filter\":[{\"meta\":{\"index\":\"AV-S2e81hKs1cXXnFMqN\",\"negate\":false,\"disabled\":false,\"alias\":null,\"type\":\"phrase\",\"key\":\"protocol\",\"value\":\"dns\"},\"query\":{\"match\":{\"protocol\":{\"query\":\"dns\",\"type\":\"phrase\"}}},\"$state\":{\"store\":\"appState\"}}]}"}} +{ "create" : { "_id": "AV-eloCYk7f2nZ-iH3ML", "_type": "search" } } +{"title":"Snort Alerts","description":"","hits":0,"columns":["msg","sig_id","ip_src_addr","ip_src_port","ip_dst_addr","ip_dst_port","protocol"],"sort":["timestamp","desc"],"version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"index\":\"AV-TAoyPhKs1cXXnFMqi\",\"highlightAll\":true,\"version\":true,\"query\":{\"match_all\":{}},\"filter\":[]}"}} +{ "create" : { "_id": "AV-eSl9lk7f2nZ-iH3Lj", "_type": "search" } } +{"title":"YAF Flows","description":"","hits":0,"columns":["ip_src_addr","ip_src_port","ip_dst_addr","ip_dst_port","protocol"],"sort":["timestamp","desc"],"version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"index\":\"AV-TUPlDgto7-W6O2b3n\",\"highlightAll\":true,\"version\":true,\"query\":{\"match_all\":{}},\"filter\":[]}"}} +{ "create" : { "_id": "AV-dZKsfk7f2nZ-iH3Kg", "_type": "visualization" } } +{"title":"DNS Requests Overview","visState":"{\"title\":\"DNS Requests Overview\",\"type\":\"markdown\",\"params\":{\"type\":\"markdown\",\"markdown\":\"[Bro](https://www.bro.org/) is extracting DNS requests and responses being made over the network. Understanding who is making those requests, the frequency, and types can provide a deep understanding of the actors present on the network.\"},\"aggs\":[],\"listeners\":{}}","uiStateJSON":"{}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"match_all\":{}},\"filter\":[]}"}} +{ "create" : { "_id": "AV-dYnlek7f2nZ-iH3Kc", "_type": "visualization" } } +{"title":"Enrichment Overview","visState":"{\"title\":\"Enrichment Overview\",\"type\":\"markdown\",\"params\":{\"type\":\"markdown\",\"markdown\":\"Apache Metron can perform real-time enrichment of telemetry data as it is consumed. To highlight this feature, all of the IP address fields collected from the default sensor suite were used to perform geo-ip lookups. This data was then used to pinpoint each location on the map.\"},\"aggs\":[],\"listeners\":{}}","uiStateJSON":"{}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"match_all\":{}},\"filter\":[]}"}} +{ "create" : { "_id": "AV-dYxfHk7f2nZ-iH3Ke", "_type": "visualization" } } +{"title":"Snort Overview","visState":"{\"title\":\"Snort Overview\",\"type\":\"markdown\",\"params\":{\"type\":\"markdown\",\"markdown\":\"[Snort](https://www.snort.org/) is a Network Intrusion Detection System (NIDS) that is being used to generate alerts identifying known bad events. Snort relies on a fixed set of rules that act as signatures for identifying abnormal events.\"},\"aggs\":[],\"listeners\":{}}","uiStateJSON":"{}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"match_all\":{}},\"filter\":[]}"}} +{ "create" : { "_id": "AV-dY9zbk7f2nZ-iH3Kf", "_type": "visualization" } } +{"title":"Web Request Header Overview","visState":"{\"title\":\"Web Request Header Overview\",\"type\":\"markdown\",\"params\":{\"type\":\"markdown\",\"markdown\":\"The [Bro Network Security Monitor](https://www.bro.org/) is extracting application-level information from raw network packets. In this example, Bro is extracting HTTP(S) requests being made over the network.\"},\"aggs\":[],\"listeners\":{}}","uiStateJSON":"{}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"match_all\":{}},\"filter\":[]}"}} +{ "create" : { "_id": "AV-dYtN5k7f2nZ-iH3Kd", "_type": "visualization" } } +{"title":"YAF Overview","visState":"{\"title\":\"YAF Overview\",\"type\":\"markdown\",\"params\":{\"type\":\"markdown\",\"markdown\":\"[YAF](https://tools.netsa.cert.org/yaf/yaf.html) can be used to generate Netflow-like flow records. These flow records provide significant visibility of the actors communicating over the target network.\"},\"aggs\":[],\"listeners\":{}}","uiStateJSON":"{}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"match_all\":{}},\"filter\":[]}"}} +{ "create" : { "_id": "AWAJrZ63HhN77dHPFvpn", "_type": "visualization" } } +{"title":"Errors By Error Type","visState":"{\"title\":\"Errors By Error Type\",\"type\":\"histogram\",\"params\":{\"grid\":{\"categoryLines\":false,\"style\":{\"color\":\"#eee\"}},\"categoryAxes\":[{\"id\":\"CategoryAxis-1\",\"type\":\"category\",\"position\":\"bottom\",\"show\":true,\"style\":{},\"scale\":{\"type\":\"linear\"},\"labels\":{\"show\":true,\"truncate\":100,\"filter\":false,\"rotate\":0},\"title\":{\"text\":\"error_type: Descending\"}}],\"valueAxes\":[{\"id\":\"ValueAxis-1\",\"name\":\"LeftAxis-1\",\"type\":\"value\",\"position\":\"left\",\"show\":true,\"style\":{},\"scale\":{\"type\":\"linear\",\"mode\":\"normal\"},\"labels\":{\"show\":true,\"rotate\":0,\"filter\":false,\"truncate\":100},\"title\":{\"text\":\"Count\"}}],\"seriesParams\":[{\"show\":\"true\",\"type\":\"histogram\",\"mode\":\"normal\",\"data\":{\"label\":\"Count\",\"id\":\"1\"},\"valueAxis\":\"ValueAxis-1\",\"drawLinesBetweenPoints\":true,\"showCircles\":true},{\"show\":true,\"mode\":\"stacked\",\"type\":\"histogram\",\"drawLinesBetweenPoints\":true,\"showCircles\":true,\"data\":{\"id\":\"3\",\"label\":\"Unique Datapoint Count\"},\"valueAxis\":\"ValueAxis-1\"}],\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"right\",\"times\":[],\"addTimeMarker\":false,\"type\":\"histogram\",\"orderBucketsBySum\":false},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{\"customLabel\":\"Count\"}},{\"id\":\"3\",\"enabled\":true,\"type\":\"cardinality\",\"schema\":\"metric\",\"params\":{\"field\":\"error_hash\",\"customLabel\":\"Unique Datapoint Count\"}},{\"id\":\"5\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"segment\",\"params\":{\"field\":\"error_type\",\"size\":5,\"order\":\"desc\",\"orderBy\":\"1\"}}],\"listeners\":{}}","uiStateJSON":"{\"vis\":{\"colors\":{\"Count\":\"#052B51\",\"Unique Datapoint Count\":\"#1F78C1\"}}}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"index\":\"AV-Yh94VdXwc6Ua9Muh0\",\"query\":{\"match_all\":{}},\"filter\":[]}"}} +{ "create" : { "_id": "AWAJ-a0-HhN77dHPFv8N", "_type": "visualization" } } +{"title":"Errors By Source Type","visState":"{\"title\":\"Errors By Source Type\",\"type\":\"histogram\",\"params\":{\"grid\":{\"categoryLines\":false,\"style\":{\"color\":\"#eee\"}},\"categoryAxes\":[{\"id\":\"CategoryAxis-1\",\"type\":\"category\",\"position\":\"bottom\",\"show\":true,\"style\":{},\"scale\":{\"type\":\"linear\"},\"labels\":{\"show\":true,\"truncate\":100,\"rotate\":0},\"title\":{\"text\":\"failed_sensor_type: Descending\"}}],\"valueAxes\":[{\"id\":\"ValueAxis-1\",\"name\":\"LeftAxis-1\",\"type\":\"value\",\"position\":\"left\",\"show\":true,\"style\":{},\"scale\":{\"type\":\"linear\",\"mode\":\"normal\"},\"labels\":{\"show\":true,\"rotate\":0,\"filter\":false,\"truncate\":100},\"title\":{\"text\":\"Count\"}}],\"seriesParams\":[{\"show\":true,\"mode\":\"normal\",\"type\":\"histogram\",\"drawLinesBetweenPoints\":true,\"showCircles\":true,\"data\":{\"id\":\"2\",\"label\":\"Count\"},\"valueAxis\":\"ValueAxis-1\"},{\"show\":true,\"mode\":\"stacked\",\"type\":\"histogram\",\"drawLinesBetweenPoints\":true,\"showCircles\":true,\"data\":{\"id\":\"4\",\"label\":\"Unique Datapoint Count\"},\"valueAxis\":\"ValueAxis-1\"}],\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"right\",\"times\":[],\"addTimeMarker\":false,\"type\":\"histogram\"},\"aggs\":[{\"id\":\"2\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{\"customLabel\":\"Count\"}},{\"id\":\"3\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"segment\",\"params\":{\"field\":\"failed_sensor_type\",\"size\":5,\"order\":\"desc\",\"orderBy\":\"2\"}},{\"id\":\"4\",\"enabled\":true,\"type\":\"cardinality\",\"schema\":\"metric\",\"params\":{\"field\":\"error_hash\",\"customLabel\":\"Unique Datapoint Count\"}}],\"listeners\":{}}","uiStateJSON":"{\"vis\":{\"colors\":{\"Count\":\"#0A437C\",\"Unique Datapoint Count\":\"#1F78C1\"}}}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"index\":\"AV-Yh94VdXwc6Ua9Muh0\",\"query\":{\"match_all\":{}},\"filter\":[]}"}} +{ "create" : { "_id": "AWAJQwsZHhN77dHPFvPi", "_type": "visualization" } } +{"title":"Error Histogram By Sensor Type","visState":"{\"title\":\"Error Histogram By Sensor Type\",\"type\":\"metrics\",\"params\":{\"id\":\"4543cc20-d53a-11e7-895b-2fd1d92b9d92\",\"type\":\"timeseries\",\"series\":[{\"id\":\"4543cc21-d53a-11e7-895b-2fd1d92b9d92\",\"color\":\"rgba(0,156,224,1)\",\"split_mode\":\"terms\",\"metrics\":[{\"id\":\"4543cc22-d53a-11e7-895b-2fd1d92b9d92\",\"type\":\"count\"}],\"seperate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"number\",\"chart_type\":\"bar\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"stacked\",\"terms_field\":\"failed_sensor_type\",\"label\":\"Count\",\"split_filters\":[{\"color\":\"rgba(0,156,224,1)\",\"id\":\"aaaed220-d53b-11e7-895b-2fd1d92b9d92\"}],\"terms_order_by\":\"_count\"}],\"time_field\":\"timestamp\",\"index_pattern\":\"error_index*\",\"interval\":\"auto\",\"axis_position\":\"left\",\"axis_formatter\":\"number\",\"show_legend\":1,\"bar_color_rules\":[{\"id\":\"7dd75420-d53b-11e7-895b-2fd1d92b9d92\"}],\"gauge_color_rules\":[{\"id\":\"7eadde00-d53b-11e7-895b-2fd1d92b9d92\"}],\"gauge_width\":10,\"gauge_inner_width\":10,\"gauge_style\":\"half\",\"background_color_rules\":[{\"id\":\"811e68d0-d53b-11e7-895b-2fd1d92b9d92\"}]},\"aggs\":[],\"listeners\":{}}","uiStateJSON":"{}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"match_all\":{}},\"filter\":[]}"}} +{ "create" : { "_id": "AWAJNZY3HhN77dHPFvMT", "_type": "visualization" } } +{"title":"Unique Error Messages","visState":"{\"title\":\"Unique Error Messages\",\"type\":\"metric\",\"params\":{\"addTooltip\":true,\"addLegend\":false,\"type\":\"gauge\",\"gauge\":{\"verticalSplit\":false,\"autoExtend\":false,\"percentageMode\":false,\"gaugeType\":\"Metric\",\"gaugeStyle\":\"Full\",\"backStyle\":\"Full\",\"orientation\":\"vertical\",\"colorSchema\":\"Green to Red\",\"gaugeColorMode\":\"None\",\"useRange\":false,\"colorsRange\":[{\"from\":0,\"to\":100}],\"invertColors\":false,\"labels\":{\"show\":true,\"color\":\"black\"},\"scale\":{\"show\":false,\"labels\":false,\"color\":\"#333\",\"width\":2},\"type\":\"simple\",\"style\":{\"fontSize\":60,\"bgColor\":false,\"labelColor\":false,\"subText\":\"\"}}},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"cardinality\",\"schema\":\"metric\",\"params\":{\"field\":\"error_hash\",\"customLabel\":\"Unique Error Messages\"}}],\"listeners\":{}}","uiStateJSON":"{\"vis\":{\"defaultColors\":{\"0 - 100\":\"rgb(0,104,55)\"}}}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"index\":\"AV-Yh94VdXwc6Ua9Muh0\",\"query\":{\"match_all\":{}},\"filter\":[]}"}} +{ "create" : { "_id": "AWAFQPTnHhN77dHPFuOo", "_type": "visualization" } } +{"title":"Total Error Messages","visState":"{\"title\":\"Total Error Messages\",\"type\":\"metric\",\"params\":{\"addLegend\":false,\"addTooltip\":true,\"gauge\":{\"autoExtend\":false,\"backStyle\":\"Full\",\"colorSchema\":\"Green to Red\",\"colorsRange\":[{\"from\":0,\"to\":100}],\"gaugeColorMode\":\"None\",\"gaugeStyle\":\"Full\",\"gaugeType\":\"Metric\",\"invertColors\":false,\"labels\":{\"color\":\"black\",\"show\":true},\"orientation\":\"vertical\",\"percentageMode\":false,\"scale\":{\"color\":\"#333\",\"labels\":false,\"show\":false,\"width\":2},\"style\":{\"bgColor\":false,\"fontSize\":60,\"labelColor\":false,\"subText\":\"\"},\"type\":\"simple\",\"useRange\":false,\"verticalSplit\":false},\"type\":\"gauge\"},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{\"customLabel\":\"Total Error Messages\"}}],\"listeners\":{}}","uiStateJSON":"{\"vis\":{\"defaultColors\":{\"0 - 100\":\"rgb(0,104,55)\"}}}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"index\":\"AV-Yh94VdXwc6Ua9Muh0\",\"query\":{\"match_all\":{}},\"filter\":[]}"}} +{ "create" : { "_id": "AWAJiwTHHhN77dHPFvhJ", "_type": "visualization" } } +{"title":"Unique Error Histogram By Sensor Type","visState":"{\"title\":\"Unique Error Histogram By Sensor Type\",\"type\":\"metrics\",\"params\":{\"id\":\"9009fc50-d546-11e7-9797-db35a5537598\",\"type\":\"timeseries\",\"series\":[{\"id\":\"9009fc51-d546-11e7-9797-db35a5537598\",\"color\":\"rgba(0,156,224,1)\",\"split_mode\":\"terms\",\"metrics\":[{\"id\":\"9009fc52-d546-11e7-9797-db35a5537598\",\"type\":\"cardinality\",\"field\":\"error_hash\"}],\"seperate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"number\",\"chart_type\":\"bar\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"stacked\",\"terms_field\":\"failed_sensor_type\"}],\"time_field\":\"timestamp\",\"index_pattern\":\"error_index*\",\"interval\":\"auto\",\"axis_position\":\"left\",\"axis_formatter\":\"number\",\"show_legend\":1},\"aggs\":[],\"listeners\":{}}","uiStateJSON":"{}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"match_all\":{}},\"filter\":[]}"}} +{ "create" : { "_id": "AWAJkcsQHhN77dHPFviy", "_type": "visualization" } } +{"title":"Error Source Proportion","visState":"{\"title\":\"Error Source Proportion\",\"type\":\"pie\",\"params\":{\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"right\",\"isDonut\":false,\"type\":\"pie\"},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"segment\",\"params\":{\"field\":\"failed_sensor_type\",\"size\":5,\"order\":\"desc\",\"orderBy\":\"1\"}}],\"listeners\":{}}","uiStateJSON":"{\"vis\":{\"colors\":{\"bro\":\"#0A50A1\"}}}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"index\":\"AV-Yh94VdXwc6Ua9Muh0\",\"query\":{\"match_all\":{}},\"filter\":[]}"}} +{ "create" : { "_id": "AWAJsGLXHhN77dHPFvqT", "_type": "visualization" } } +{"title":"Error Type Proportion","visState":"{\"title\":\"Error Type Proportion\",\"type\":\"pie\",\"params\":{\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"right\",\"isDonut\":false,\"type\":\"pie\"},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"segment\",\"params\":{\"field\":\"error_type\",\"size\":5,\"order\":\"desc\",\"orderBy\":\"1\"}}],\"listeners\":{}}","uiStateJSON":"{\"vis\":{\"colors\":{\"parser_error\":\"#0A437C\"}}}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"index\":\"AV-Yh94VdXwc6Ua9Muh0\",\"query\":{\"match_all\":{}},\"filter\":[]}"}} +{ "create" : { "_id": "AWAJ-supHhN77dHPFv8d", "_type": "visualization" } } +{"title":"Error Hostname Proportion","visState":"{\"title\":\"Error Hostname Proportion\",\"type\":\"pie\",\"params\":{\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"right\",\"isDonut\":false,\"type\":\"pie\"},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"segment\",\"params\":{\"field\":\"hostname\",\"size\":5,\"order\":\"desc\",\"orderBy\":\"1\"}}],\"listeners\":{}}","uiStateJSON":"{\"vis\":{\"colors\":{\"parser_error\":\"#0A437C\"}}}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"index\":\"AV-Yh94VdXwc6Ua9Muh0\",\"query\":{\"match_all\":{}},\"filter\":[]}"}} +{ "create" : { "_id": "AWAJ_q99HhN77dHPFv9a", "_type": "visualization" } } +{"title":"Errors By Hostname","visState":"{\"title\":\"Errors By Hostname\",\"type\":\"histogram\",\"params\":{\"grid\":{\"categoryLines\":false,\"style\":{\"color\":\"#eee\"}},\"categoryAxes\":[{\"id\":\"CategoryAxis-1\",\"type\":\"category\",\"position\":\"bottom\",\"show\":true,\"style\":{},\"scale\":{\"type\":\"linear\"},\"labels\":{\"show\":true,\"truncate\":100,\"rotate\":0},\"title\":{\"text\":\"hostname: Descending\"}}],\"valueAxes\":[{\"id\":\"ValueAxis-1\",\"name\":\"LeftAxis-1\",\"type\":\"value\",\"position\":\"left\",\"show\":true,\"style\":{},\"scale\":{\"type\":\"linear\",\"mode\":\"normal\"},\"labels\":{\"show\":true,\"rotate\":0,\"filter\":false,\"truncate\":100},\"title\":{\"text\":\"Count\"}}],\"seriesParams\":[{\"show\":true,\"mode\":\"normal\",\"type\":\"histogram\",\"drawLinesBetweenPoints\":true,\"showCircles\":true,\"data\":{\"id\":\"2\",\"label\":\"Count\"},\"valueAxis\":\"ValueAxis-1\"},{\"show\":true,\"mode\":\"stacked\",\"type\":\"histogram\",\"drawLinesBetweenPoints\":true,\"showCircles\":true,\"data\":{\"id\":\"4\",\"label\":\"Unique Datapoint Count\"},\"valueAxis\":\"ValueAxis-1\"}],\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"right\",\"times\":[],\"addTimeMarker\":false,\"type\":\"histogram\"},\"aggs\":[{\"id\":\"2\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{\"customLabel\":\"Count\"}},{\"id\":\"3\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"segment\",\"params\":{\"field\":\"hostname\",\"size\":5,\"order\":\"desc\",\"orderBy\":\"2\"}},{\"id\":\"4\",\"enabled\":true,\"type\":\"cardinality\",\"schema\":\"metric\",\"params\":{\"field\":\"error_hash\",\"customLabel\":\"Unique Datapoint Count\"}}],\"listeners\":{}}","uiStateJSON":"{\"vis\":{\"colors\":{\"Count\":\"#0A437C\",\"Unique Datapoint Count\":\"#1F78C1\"}}}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"index\":\"AV-Yh94VdXwc6Ua9Muh0\",\"query\":{\"match_all\":{}},\"filter\":[]}"}} +{ "create" : { "_id": "AV-Yh94VdXwc6Ua9Muh0", "_type": "index-pattern" } } +{"title":"error_index*","timeFieldName":"timestamp","notExpandable":true,"fields":"[{\"name\":\"_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_index\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_source\",\"type\":\"_source\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"error_fields\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"error_hash\",\"type\":\"string\",\"count\":1,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"error_type\",\"type\":\"string\",\"count\":1,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"exception\",\"type\":\"string\",\"count\":1,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"failed_sensor_type\",\"type\":\"string\",\"count\":1,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"hostname\",\"type\":\"string\",\"count\":1,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"message\",\"type\":\"string\",\"count\":1,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"raw_message\",\"type\":\"string\",\"count\":1,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"raw_message_bytes\",\"type\":\"unknown\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"source:type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"source:type.keyword\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"stack\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"timestamp\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true}]"} +{ "create" : { "_id": "AWAKF7vIHhN77dHPFwBr", "_type": "search" } } +{"title":"Errors Table","description":"","hits":0,"columns":["failed_sensor_type","error_type","exception","hostname","message","raw_message","error_hash"],"sort":["timestamp","desc"],"version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"index\":\"AV-Yh94VdXwc6Ua9Muh0\",\"highlightAll\":true,\"version\":true,\"query\":{\"match_all\":{}},\"filter\":[]}"}} +{ "create" : { "_id": "AWAFNXP3HhN77dHPFuOm", "_type": "dashboard" } } +{"title":"Metron-Error-Dashboard","hits":0,"description":"Metron error dashboard","panelsJSON":"[{\"col\":1,\"id\":\"AWAFQPTnHhN77dHPFuOo\",\"panelIndex\":1,\"row\":1,\"size_x\":6,\"size_y\":3,\"type\":\"visualization\"},{\"col\":7,\"id\":\"AWAJNZY3HhN77dHPFvMT\",\"panelIndex\":2,\"row\":1,\"size_x\":6,\"size_y\":3,\"type\":\"visualization\"},{\"col\":1,\"id\":\"AWAJQwsZHhN77dHPFvPi\",\"panelIndex\":3,\"row\":4,\"size_x\":12,\"size_y\":4,\"type\":\"visualization\"},{\"col\":1,\"id\":\"AWAJiwTHHhN77dHPFvhJ\",\"panelIndex\":4,\"row\":8,\"size_x\":12,\"size_y\":4,\"type\":\"visualization\"},{\"col\":1,\"id\":\"AWAJkcsQHhN77dHPFviy\",\"panelIndex\":5,\"row\":12,\"size_x\":4,\"size_y\":3,\"type\":\"visualization\"},{\"col\":5,\"id\":\"AWAJrZ63HhN77dHPFvpn\",\"panelIndex\":6,\"row\":12,\"size_x\":8,\"size_y\":3,\"type\":\"visualization\"},{\"col\":1,\"id\":\"AWAJsGLXHhN77dHPFvqT\",\"panelIndex\":7,\"row\":15,\"size_x\":4,\"size_y\":3,\"type\":\"visualization\"},{\"col\":5,\"id\":\"AWAJ-a0-HhN77dHPFv8N\",\"panelIndex\":8,\"row\":15,\"size_x\":8,\"size_y\":3,\"type\":\"visualization\"},{\"col\":1,\"id\":\"AWAJ-supHhN77dHPFv8d\",\"panelIndex\":9,\"row\":18,\"size_x\":4,\"size_y\":3,\"type\":\"visualization\"},{\"col\":5,\"id\":\"AWAJ_q99HhN77dHPFv9a\",\"panelIndex\":10,\"row\":18,\"size_x\":8,\"size_y\":3,\"type\":\"visualization\"},{\"size_x\":12,\"size_y\":7,\"panelIndex\":11,\"type\":\"search\",\"id\":\"AWAKF7vIHhN77dHPFwBr\",\"col\":1,\"row\":21,\"columns\":[\"failed_sensor_type\",\"error_type\",\"exception\",\"hostname\",\"message\",\"raw_message\",\"error_hash\"],\"sort\":[\"timestamp\",\"desc\"]}]","optionsJSON":"{\"darkTheme\":false}","uiStateJSON":"{\"P-1\":{\"vis\":{\"defaultColors\":{\"0 - 100\":\"rgb(0,104,55)\"}}},\"P-2\":{\"vis\":{\"defaultColors\":{\"0 - 100\":\"rgb(0,104,55)\"}}}}","version":1,"timeRestore":false,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"filter\":[{\"query\":{\"match_all\":{}}}],\"highlightAll\":true,\"version\":true}"}} diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/4.5.1/package/scripts/dashboard/dashboardindex.py b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/5.6.2/package/scripts/dashboard/dashboardindex.py similarity index 100% rename from metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/4.5.1/package/scripts/dashboard/dashboardindex.py rename to metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/5.6.2/package/scripts/dashboard/dashboardindex.py diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/5.6.2/package/scripts/dashboard/kibana.template b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/5.6.2/package/scripts/dashboard/kibana.template new file mode 100644 index 0000000000..6f38ed5b98 --- /dev/null +++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/5.6.2/package/scripts/dashboard/kibana.template @@ -0,0 +1,233 @@ +{ + "template" : ".kibana", + "mappings" : { + "search" : { + "dynamic" : "strict", + "properties" : { + "columns" : { + "type" : "keyword" + }, + "description" : { + "type" : "text" + }, + "hits" : { + "type" : "integer" + }, + "kibanaSavedObjectMeta" : { + "properties" : { + "searchSourceJSON" : { + "type" : "text" + } + } + }, + "sort" : { + "type" : "keyword" + }, + "title" : { + "type" : "text" + }, + "version" : { + "type" : "integer" + } + } + }, + "url" : { + "dynamic" : "strict", + "properties" : { + "accessCount" : { + "type" : "long" + }, + "accessDate" : { + "type" : "date" + }, + "createDate" : { + "type" : "date" + }, + "url" : { + "type" : "text", + "fields" : { + "keyword" : { + "type" : "keyword", + "ignore_above" : 2048 + } + } + } + } + }, + "dashboard" : { + "dynamic" : "strict", + "properties" : { + "description" : { + "type" : "text" + }, + "hits" : { + "type" : "integer" + }, + "kibanaSavedObjectMeta" : { + "properties" : { + "searchSourceJSON" : { + "type" : "text" + } + } + }, + "optionsJSON" : { + "type" : "text" + }, + "panelsJSON" : { + "type" : "text" + }, + "refreshInterval" : { + "properties" : { + "display" : { + "type" : "keyword" + }, + "pause" : { + "type" : "boolean" + }, + "section" : { + "type" : "integer" + }, + "value" : { + "type" : "integer" + } + } + }, + "timeFrom" : { + "type" : "keyword" + }, + "timeRestore" : { + "type" : "boolean" + }, + "timeTo" : { + "type" : "keyword" + }, + "title" : { + "type" : "text" + }, + "uiStateJSON" : { + "type" : "text" + }, + "version" : { + "type" : "integer" + } + } + }, + "index-pattern" : { + "dynamic" : "strict", + "properties" : { + "fieldFormatMap" : { + "type" : "text" + }, + "fields" : { + "type" : "text" + }, + "intervalName" : { + "type" : "keyword" + }, + "notExpandable" : { + "type" : "boolean" + }, + "sourceFilters" : { + "type" : "text" + }, + "timeFieldName" : { + "type" : "keyword" + }, + "title" : { + "type" : "text" + } + } + }, + "timelion-sheet" : { + "dynamic" : "strict", + "properties" : { + "description" : { + "type" : "text" + }, + "hits" : { + "type" : "integer" + }, + "kibanaSavedObjectMeta" : { + "properties" : { + "searchSourceJSON" : { + "type" : "text" + } + } + }, + "timelion_chart_height" : { + "type" : "integer" + }, + "timelion_columns" : { + "type" : "integer" + }, + "timelion_interval" : { + "type" : "keyword" + }, + "timelion_other_interval" : { + "type" : "keyword" + }, + "timelion_rows" : { + "type" : "integer" + }, + "timelion_sheet" : { + "type" : "text" + }, + "title" : { + "type" : "text" + }, + "version" : { + "type" : "integer" + } + } + }, + "visualization" : { + "dynamic" : "strict", + "properties" : { + "description" : { + "type" : "text" + }, + "kibanaSavedObjectMeta" : { + "properties" : { + "searchSourceJSON" : { + "type" : "text" + } + } + }, + "savedSearchId" : { + "type" : "keyword" + }, + "title" : { + "type" : "text" + }, + "uiStateJSON" : { + "type" : "text" + }, + "version" : { + "type" : "integer" + }, + "visState" : { + "type" : "text" + } + } + }, + "server" : { + "dynamic" : "strict", + "properties" : { + "uuid" : { + "type" : "keyword" + } + } + }, + "_default_" : { + "dynamic" : "strict" + }, + "config" : { + "dynamic" : "true", + "properties" : { + "buildNum" : { + "type" : "keyword" + } + } + } + } +} diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/4.5.1/package/scripts/kibana_master.py b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/5.6.2/package/scripts/kibana_master.py similarity index 73% rename from metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/4.5.1/package/scripts/kibana_master.py rename to metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/5.6.2/package/scripts/kibana_master.py index faca7a83fc..4c001efece 100755 --- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/4.5.1/package/scripts/kibana_master.py +++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/5.6.2/package/scripts/kibana_master.py @@ -22,7 +22,6 @@ import errno import os -from ambari_commons.os_check import OSCheck from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl from resource_management.core.logger import Logger from resource_management.core.resources.system import Directory @@ -48,7 +47,7 @@ def configure(self, env, upgrade_type=None, config_dir=None): directories = [params.log_dir, params.pid_dir, params.conf_dir] Directory(directories, - # recursive=True, + create_parents=True, mode=0755, owner=params.kibana_user, group=params.kibana_user @@ -98,8 +97,6 @@ def status(self, env): @OsFamilyFuncImpl(os_family=OsFamilyImpl.DEFAULT) def load_template(self, env): - from dashboard.dashboardindex import DashboardIndex - import params env.set_params(params) @@ -107,21 +104,27 @@ def load_template(self, env): port = int(ambari_format("{es_port}")) Logger.info("Connecting to Elasticsearch on host: %s, port: %s" % (hostname, port)) - di = DashboardIndex(host=hostname, port=port) - # Loads Kibana Dashboard definition from disk and replaces .kibana on index - templateFile = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'dashboard', 'dashboard.p') - if not os.path.isfile(templateFile): - raise IOError( - errno.ENOENT, os.strerror(errno.ENOENT), templateFile) + kibanaTemplate = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'dashboard', 'kibana.template') + if not os.path.isfile(kibanaTemplate): + raise IOError( + errno.ENOENT, os.strerror(errno.ENOENT), kibanaTemplate) - Logger.info("Deleting .kibana index from Elasticsearch") + Logger.info("Loading .kibana index template from %s" % kibanaTemplate) + template_cmd = ambari_format( + 'curl -s -XPOST http://{es_host}:{es_port}/_template/.kibana -d @%s' % kibanaTemplate) + Execute(template_cmd, logoutput=True) - di.es.indices.delete(index='.kibana', ignore=[400, 404]) + kibanaDashboardLoad = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'dashboard', 'dashboard-bulkload.json') + if not os.path.isfile(kibanaDashboardLoad): + raise IOError( + errno.ENOENT, os.strerror(errno.ENOENT), kibanaDashboardLoad) - Logger.info("Loading .kibana index from %s" % templateFile) + Logger.info("Loading .kibana dashboard from %s" % kibanaDashboardLoad) - di.put(data=di.load(filespec=templateFile)) + kibana_cmd = ambari_format( + 'curl -s -H "Content-Type: application/x-ndjson" -XPOST http://{es_host}:{es_port}/.kibana/_bulk --data-binary @%s' % kibanaDashboardLoad) + Execute(kibana_cmd, logoutput=True) if __name__ == "__main__": diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/4.5.1/package/scripts/params.py b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/5.6.2/package/scripts/params.py similarity index 94% rename from metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/4.5.1/package/scripts/params.py rename to metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/5.6.2/package/scripts/params.py index a5e0ec96c3..ef4cb622c6 100755 --- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/4.5.1/package/scripts/params.py +++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/5.6.2/package/scripts/params.py @@ -31,7 +31,7 @@ kibana_home = '/usr/share/kibana/' kibana_bin = '/usr/share/kibana/bin/' -conf_dir = "/opt/kibana/config/" +conf_dir = "/etc/kibana" kibana_user = config['configurations']['kibana-env']['kibana_user'] kibana_group = config['configurations']['kibana-env']['kibana_group'] log_dir = config['configurations']['kibana-env']['kibana_log_dir'] @@ -42,6 +42,7 @@ es_host = parsed.netloc.split(':')[0] es_port = parsed.netloc.split(':')[1] kibana_port = config['configurations']['kibana-env']['kibana_server_port'] +kibana_server_host = config['configurations']['kibana-env']['kibana_server_host'] kibana_default_application = config['configurations']['kibana-env']['kibana_default_application'] hostname = config['hostname'] java64_home = config['hostLevelParams']['java_home'] diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/4.5.1/quicklinks/quicklinks.json b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/5.6.2/quicklinks/quicklinks.json similarity index 100% rename from metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/4.5.1/quicklinks/quicklinks.json rename to metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/KIBANA/5.6.2/quicklinks/quicklinks.json diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/bro_index.template b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/bro_index.template index b0103f28a4..01d4f7bae5 100644 --- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/bro_index.template +++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/bro_index.template @@ -2,9 +2,6 @@ "template": "bro_index*", "mappings": { "bro_doc": { - "_timestamp": { - "enabled": true - }, "dynamic_templates": [ { "geo_location_point": { @@ -20,8 +17,7 @@ "match": "enrichments:geo:*:country", "match_mapping_type": "*", "mapping": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" } } }, @@ -30,8 +26,7 @@ "match": "enrichments:geo:*:city", "match_mapping_type": "*", "mapping": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" } } }, @@ -40,8 +35,7 @@ "match": "enrichments:geo:*:locID", "match_mapping_type": "*", "mapping": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" } } }, @@ -50,8 +44,7 @@ "match": "enrichments:geo:*:dmaCode", "match_mapping_type": "*", "mapping": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" } } }, @@ -60,8 +53,7 @@ "match": "enrichments:geo:*:postalCode", "match_mapping_type": "*", "mapping": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" } } }, @@ -105,7 +97,8 @@ { "threat_triage_reason": { "mapping": { - "type": "string" + "type": "text", + "fielddata": "true" }, "match": "threat:triage:rules:*:reason", "match_mapping_type": "*" @@ -114,7 +107,8 @@ { "threat_triage_name": { "mapping": { - "type": "string" + "type": "text", + "fielddata": "true" }, "match": "threat:triage:rules:*:name", "match_mapping_type": "*" @@ -131,14 +125,13 @@ * Be careful when modifying this file to not unintentionally affect other logs. * For instance, the "version" field exists in the HTTP, SSL, and SSH logs. If you * were to only consider the SSH log, you would set the type to integer, but because - * in the SSL and HTTP logs version is a string, we must set the type to string. + * in the SSL and HTTP logs version is a string, we must set the type to keyword. */ /* * Metron-specific fields */ "source:type": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, /* * Widely-used Bro fields (potentially renamed during Metron ingest) @@ -148,8 +141,7 @@ "format": "epoch_millis" }, "uid": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "alert": { "type": "nested" @@ -214,28 +206,24 @@ "type": "integer" }, "method": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "host": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "uri": { - "type": "string", - "index": "not_analyzed", + "type": "keyword", "ignore_above": 8191 }, "referrer": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "version": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "user_agent": { - "type": "string" + "type": "text", + "fielddata": "true" }, "request_body_len": { "type": "long" @@ -247,8 +235,7 @@ "type": "integer" }, "status_msg": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "info_code": { "type": "integer" @@ -262,12 +249,10 @@ "index": "not_analyzed" }, "username": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "password": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "proxied": { "type": "string", @@ -307,8 +292,7 @@ * https://www.bro.org/sphinx-git/script-reference/types.html#type-interval */ "proto": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "trans_id": { "type": "long" @@ -318,29 +302,25 @@ "index": "not_analyzed" }, "query": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "qclass": { "type": "integer" }, "qclass_name": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "qtype": { "type": "integer" }, "qtype_name": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "rcode": { "type": "integer" }, "rcode_name": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "AA": { "type": "boolean" @@ -358,7 +338,8 @@ "type": "integer" }, "answers": { - "type": "string" + "type": "text", + "fielddata": "true" }, "TTLs": { "type": "string" @@ -381,58 +362,46 @@ * Notes: Field exists in the Conn and Files logs */ "service": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "duration": { "type": "float" }, "orig_bytes": { - "type": "long", - "index": "not_analyzed" + "type": "long" }, "resp_bytes": { - "type": "long", - "index": "not_analyzed" + "type": "long" }, "conn_state": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "local_orig": { "type": "boolean" }, "local_resp": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "missed_bytes": { - "type": "long", - "index": "not_analyzed" + "type": "long" }, "history": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "orig_pkts": { - "type": "long", - "index": "not_analyzed" + "type": "long" }, "orig_ip_bytes": { - "type": "long", - "index": "not_analyzed" + "type": "long" }, "resp_pkts": { - "type": "long", - "index": "not_analyzed" + "type": "long" }, "resp_ip_bytes": { - "type": "long", - "index": "not_analyzed" + "type": "long" }, "tunnel_parents": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, /* * DPD log support @@ -443,12 +412,10 @@ * Notes: Field exists in the DNS, Conn, DPD, and Notice logs */ "analyzer": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "failure_reason": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, /* * FTP log support @@ -468,19 +435,19 @@ * Notes: Field exists in the FTP, Files, and Notice logs */ "user": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "command": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "arg": { - "type": "string", + "type": "text", + "fielddata": "true", "analyzer": "simple" }, "mime_type": { - "type": "string", + "type": "text", + "fielddata": "true", "analyzer": "simple" }, "file_size": { @@ -490,8 +457,7 @@ "type": "integer" }, "reply_msg": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "data_channel:passive": { "type": "boolean" @@ -506,15 +472,15 @@ "type": "integer" }, "cwd": { - "type": "string", + "type": "text", + "fielddata": "true", "analyzer": "simple" }, "passive": { "type": "boolean" }, "fuid": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, /* * Files log support @@ -540,23 +506,23 @@ * Notes: Field exists in the FTP, Files, and Notice logs */ "conn_uids": { - "type": "string", + "type": "text", + "fielddata": "true", "analyzer": "simple" }, "source": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "depth": { "type": "integer" }, "analyzers": { - "type": "string", + "type": "text", + "fielddata": "true", "analyzer": "simple" }, "filename": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "is_orig": { "type": "boolean" @@ -577,20 +543,16 @@ "type": "boolean" }, "parent_fuid": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "md5": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "sha1": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "sha256": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "extracted": { "type": "string", @@ -617,16 +579,17 @@ "type": "integer" }, "subject": { - "type": "string", + "type": "text", + "fielddata": "true", "analyzer": "simple" }, "issuer_subject": { - "type": "string", + "type": "text", + "fielddata": "true", "analyzer": "simple" }, "serial": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, /* * SMTP log support @@ -649,27 +612,31 @@ * Notes: Field exists in the HTTP, SMTP, and SIP logs */ "helo": { - "type": "string", + "type": "text", + "fielddata": "true", "analyzer": "simple" }, "mailfrom": { - "type": "string", + "type": "text", + "fielddata": "true", "analyzer": "simple" }, "rcptto": { - "type": "string", + "type": "text", + "fielddata": "true", "analyzer": "simple" }, "date": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "from": { - "type": "string", + "type": "text", + "fielddata": "true", "analyzer": "simple" }, "to": { - "type": "string", + "type": "text", + "fielddata": "true", "analyzer": "simple" }, "cc": { @@ -677,42 +644,42 @@ "analyzer": "simple" }, "reply_to": { - "type": "string", + "type": "text", + "fielddata": "true", "analyzer": "simple" }, "msg_id": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "in_reply_to": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "x_originating_ip": { "type": "ip" }, "first_received": { - "type": "string", + "type": "text", + "fielddata": "true", "analyzer": "simple" }, "second_received": { - "type": "string", + "type": "text", + "fielddata": "true", "analyzer": "simple" }, "last_reply": { - "type": "string", + "type": "text", + "fielddata": "true", "analyzer": "simple" }, "path": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "tls": { "type": "boolean" }, "fuids": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "is_webmail": { "type": "boolean" @@ -729,16 +696,13 @@ * Notes: Field exists in the KnownCerts, SMTP, SIP, and SSL logs */ "cipher": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "curve": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "server_name": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "resumed": { "type": "boolean" @@ -751,12 +715,10 @@ "type": "boolean" }, "last_alert": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "next_protocol": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "established": { "type": "boolean" @@ -795,19 +757,16 @@ * Notes: Field exists in the Weird and LoadedScripts logs */ "name": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "addl": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "notice": { "type": "boolean" }, "peer": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, /* * Notice log support @@ -836,24 +795,19 @@ * Notes: Field exists in the Notice and SSH logs */ "file_mime_type": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "file_desc": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "note": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "msg": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "sub": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "src": { "type": "ip" @@ -862,27 +816,22 @@ "type": "ip" }, "p": { - "type": "integer", - "index": "not_analyzed" + "type": "integer" }, "n": { - "type": "integer", - "index": "not_analyzed" + "type": "integer" }, "src_peer": { "type": "ip" }, "peer_descr": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "actions": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "suppress_for": { - "type": "double", - "index": "not_analyzed" + "type": "double" }, "dropped": { "type": "boolean" @@ -914,15 +863,13 @@ * Notes: Field exists in the DNS and DHCP logs */ "mac": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "assigned_ip": { "type": "ip" }, "lease_time": { - "type": "float", - "index": "not_analyzed" + "type": "float" }, /* * SSH log support @@ -951,44 +898,34 @@ "type": "boolean" }, "auth_attempts": { - "type": "integer", - "index": "not_analyzed" + "type": "integer" }, "direction": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "client": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "server": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "cipher_alg": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "mac_alg": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "compression_alg": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "kex_alg": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "host_key_alg": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "host_key": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, /* * Software log support @@ -999,35 +936,29 @@ * Notes: Field exists in the HTTP, KnownCerts, and Software logs */ "host_p": { - "type": "integer", - "index": "not_analyzed" + "type": "integer" }, "software_type": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "version:major": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "version:minor": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "version:minor2": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "version:minor3": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "version:addl": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "unparsed_version": { - "type": "string", + "type": "text", + "fielddata": "true", "analyzer": "simple" }, /* @@ -1052,16 +983,14 @@ "type": "ip" }, "connect_info": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "reply_msg": { "type": "string", "index": "not_analyzed" }, "result": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "ttl": { "type": "string", @@ -1076,82 +1005,64 @@ * Notes: In other bro records, the id field is of type conn_id, so it is * expanded before being logged into 4 fields, all of which are addressed * under the "Widely-used Bro fields" section of this template. In X509 - * logs, however, id is a string to identify the certificate file id. + * logs, however, id is a keyword to identify the certificate file id. */ "id": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "certificate:version": { - "type": "integer", - "index": "not_analyzed" + "type": "integer" }, "certificate:serial": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "certificate:subject": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "certificate:issuer": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "certificate:not_valid_before": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "certificate:not_valid_after": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "certificate:key_alg": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "certificate:sig_alg": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "certificate:key_type": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "certificate:key_length": { - "type": "integer", - "index": "not_analyzed" + "type": "integer" }, "certificate:exponent": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "certificate:curve": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "san:dns": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "san:uri": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "san:email": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "san:ip": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "basic_constraints:ca": { "type": "boolean" }, "basic_constraints:path_len": { - "type": "integer", - "index": "not_analyzed" + "type": "integer" }, /* * Known::DevicesInfo log support @@ -1162,32 +1073,26 @@ * Notes: Field exists in the DHCP, RADIUS, and KnownDevices logs */ "dhcp_host_name": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, /* * RFB::Info log support * https://www.bro.org/sphinx-git/scripts/base/protocols/rfb/main.bro.html#type-RFB::Info */ "client_major_version": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "client_minor_version": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "server_major_version": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "server_minor_version": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "authentication_method": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "auth": { "type": "boolean" @@ -1196,8 +1101,7 @@ "type": "boolean" }, "desktop_name": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "width": { "type": "integer" @@ -1233,8 +1137,7 @@ "type": "integer" }, "pkt_lag": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "events_proc": { "type": "integer" @@ -1303,8 +1206,7 @@ * Notes: Field exists in the Weird, CaptureLoss, and Stats logs */ "ts_delta": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "gaps": { "type": "integer", @@ -1323,15 +1225,15 @@ * https://www.bro.org/sphinx/scripts/base/frameworks/reporter/main.bro.html#type-Reporter::Info */ "level": { - "type": "string" + "type": "text", + "fielddata": "true", + "analyzer": "simple" }, "message": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "location": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, /* * SIP::Info log support @@ -1372,42 +1274,41 @@ * Notes: Field exists in the HTTP and SIP logs */ "request_from": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "request_to": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "response_from": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "response_to": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "call_id": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "seq": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "request_path": { - "type": "string" + "type": "text", + "fielddata": "true", + "analyzer": "simple" }, "response_path": { - "type": "string" + "type": "text", + "fielddata": "true", + "analyzer": "simple" }, "warning": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "content_type": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" + }, + "guid": { + "type": "keyword" } } } diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/error_index.template b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/error_index.template index e79d4820ad..00aaf87dd3 100644 --- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/error_index.template +++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/error_index.template @@ -2,54 +2,41 @@ "template": "error_index*", "mappings": { "error_doc": { - "_timestamp": { - "enabled": true - }, "properties": { "exception": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "hostname": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "stack": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "timestamp": { "type": "date", "format": "epoch_millis" }, "message": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "raw_message": { - "type": "string", - "index": "not_analyzed", + "type": "keyword", "ignore_above": 8191 }, "raw_message_bytes": { - "type": "binary", - "index": "no" + "type": "binary" }, "error_fields": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "error_hash": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "failed_sensor_type": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "error_type": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "alert": { "type": "nested" diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/metaalert_index.template b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/metaalert_index.template index 5af9251efa..24e8357ea6 100644 --- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/metaalert_index.template +++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/metaalert_index.template @@ -2,17 +2,13 @@ "template": "metaalert_index*", "mappings": { "metaalert_doc": { - "_timestamp": { - "enabled": true - }, "dynamic_templates": [ { "alert_template": { "path_match": "alert.*", "match_mapping_type": "string", "mapping": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" } } }, @@ -28,16 +24,13 @@ ], "properties": { "guid": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "score": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "status": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "timestamp": { "type": "date", @@ -47,8 +40,7 @@ "type": "nested" }, "source:type": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" } } } diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/snort_index.template b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/snort_index.template index 7c6b40125b..43b3ca40f4 100644 --- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/snort_index.template +++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/snort_index.template @@ -2,9 +2,6 @@ "template": "snort_index*", "mappings": { "snort_doc": { - "_timestamp": { - "enabled": true - }, "dynamic_templates": [ { "geo_location_point": { @@ -20,8 +17,7 @@ "match": "enrichments:geo:*:country", "match_mapping_type": "*", "mapping": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" } } }, @@ -30,8 +26,7 @@ "match": "enrichments:geo:*:city", "match_mapping_type": "*", "mapping": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" } } }, @@ -40,8 +35,7 @@ "match": "enrichments:geo:*:locID", "match_mapping_type": "*", "mapping": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" } } }, @@ -50,8 +44,7 @@ "match": "enrichments:geo:*:dmaCode", "match_mapping_type": "*", "mapping": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" } } }, @@ -60,8 +53,7 @@ "match": "enrichments:geo:*:postalCode", "match_mapping_type": "*", "mapping": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" } } }, @@ -102,24 +94,26 @@ "match_mapping_type": "*" } }, - { - "threat_triage_reason": { - "mapping": { - "type": "string" - }, - "match": "threat:triage:rules:*:reason", - "match_mapping_type": "*" - } - }, - { - "threat_triage_name": { - "mapping": { - "type": "string" - }, - "match": "threat:triage:rules:*:name", - "match_mapping_type": "*" + { + "threat_triage_reason": { + "mapping": { + "type": "text", + "fielddata": "true" + }, + "match": "threat.triage.rules:*:reason", + "match_mapping_type": "*" + } + }, + { + "threat_triage_name": { + "mapping": { + "type": "text", + "fielddata": "true" + }, + "match": "threat.triage.rules:*:name", + "match_mapping_type": "*" + } } - } ], "properties": { "timestamp": { @@ -127,8 +121,7 @@ "format": "epoch_millis" }, "source:type": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "ip_dst_addr": { "type": "ip" @@ -146,16 +139,13 @@ "type": "integer" }, "ethdst": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "ethlen": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "ethsrc": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "id": { "type": "integer" @@ -167,33 +157,37 @@ "type": "boolean" }, "msg": { - "type": "string" + "type": "text", + "fielddata": "true" }, "protocol": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "sig_generator": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "sig_id": { "type": "integer" }, "sig_rev": { - "type": "string" + "type": "text", + "fielddata": "true" }, "tcpack": { - "type": "string" + "type": "text", + "fielddata": "true" }, "tcpflags": { - "type": "string" + "type": "text", + "fielddata": "true" }, "tcpseq": { - "type": "string" + "type": "text", + "fielddata": "true" }, "tcpwindow": { - "type": "string" + "type": "text", + "fielddata": "true" }, "tos": { "type": "integer" @@ -201,6 +195,9 @@ "ttl": { "type": "integer" }, + "guid": { + "type": "keyword" + }, "alert": { "type": "nested" } diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/yaf_index.template b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/yaf_index.template index d100eb083f..b6965f9ea7 100644 --- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/yaf_index.template +++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/yaf_index.template @@ -2,9 +2,6 @@ "template": "yaf_index*", "mappings": { "yaf_doc": { - "_timestamp": { - "enabled": true - }, "dynamic_templates": [ { "geo_location_point": { @@ -20,8 +17,7 @@ "match": "enrichments:geo:*:country", "match_mapping_type": "*", "mapping": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" } } }, @@ -30,8 +26,7 @@ "match": "enrichments:geo:*:city", "match_mapping_type": "*", "mapping": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" } } }, @@ -40,8 +35,7 @@ "match": "enrichments:geo:*:locID", "match_mapping_type": "*", "mapping": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" } } }, @@ -50,8 +44,7 @@ "match": "enrichments:geo:*:dmaCode", "match_mapping_type": "*", "mapping": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" } } }, @@ -60,8 +53,7 @@ "match": "enrichments:geo:*:postalCode", "match_mapping_type": "*", "mapping": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" } } }, @@ -105,7 +97,8 @@ { "threat_triage_reason": { "mapping": { - "type": "string" + "type": "text", + "fielddata": "true" }, "match": "threat:triage:rules:*:reason", "match_mapping_type": "*" @@ -114,7 +107,8 @@ { "threat_triage_name": { "mapping": { - "type": "string" + "type": "text", + "fielddata": "true" }, "match": "threat:triage:rules:*:name", "match_mapping_type": "*" @@ -127,8 +121,7 @@ "format": "epoch_millis" }, "source:type": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "ip_dst_addr": { "type": "ip" @@ -157,55 +150,44 @@ "type": "double" }, "proto": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "sip": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "sp": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "dip": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "dp": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "iflags": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "uflags": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "riflags": { - "type": "string" + "type": "text", + "fielddata": "true" }, "ruflags": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "isn": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "risn": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "tag": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "rtag": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "pkt": { "type": "integer" @@ -220,14 +202,17 @@ "type": "integer" }, "app": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "end-reason": { - "type": "string" + "type": "text", + "fielddata": "true" }, "alert": { "type": "nested" + }, + "guid": { + "type": "keyword" } } } diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/indexing_master.py b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/indexing_master.py index c79dfd5efd..e92785a89b 100755 --- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/indexing_master.py +++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/indexing_master.py @@ -138,7 +138,6 @@ def elasticsearch_template_delete(self, env): commands = IndexingCommands(params) for template_name in commands.get_templates(): - # delete the index template cmd = "curl -s -XDELETE \"http://{0}/_template/{1}\"" Execute( diff --git a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/mpack.json b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/mpack.json index bf665f217b..7a9d8927d9 100644 --- a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/mpack.json +++ b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/mpack.json @@ -25,7 +25,7 @@ "service_versions_map": [ { "service_name" : "KIBANA", - "service_version" : "4.5.1", + "service_version" : "5.6.2", "applicable_stacks" : [ { "stack_name" : "HDP", @@ -43,7 +43,7 @@ }, { "service_name" : "ELASTICSEARCH", - "service_version" : "2.3.3", + "service_version" : "5.6.2", "applicable_stacks" : [ { "stack_name" : "HDP", diff --git a/metron-deployment/roles/ambari_config/vars/single_node_vm.yml b/metron-deployment/roles/ambari_config/vars/single_node_vm.yml index 024582cb13..839e04db22 100644 --- a/metron-deployment/roles/ambari_config/vars/single_node_vm.yml +++ b/metron-deployment/roles/ambari_config/vars/single_node_vm.yml @@ -120,7 +120,8 @@ required_configurations: kibana_es_url: http://{{ groups.search[0] }}:9200 kibana_log_dir: /var/log/kibana kibana_server_port: 5000 - kibana_default_application: "dashboard/Metron-Dashboard" + kibana_default_application: "dashboard/AV-YpDmwdXwc6Ua9Muh9" + kibana_server_host: 0.0.0.0 blueprint: stack_name: HDP diff --git a/metron-deployment/roles/ambari_config/vars/small_cluster.yml b/metron-deployment/roles/ambari_config/vars/small_cluster.yml index 1e652da0f9..568b41be68 100644 --- a/metron-deployment/roles/ambari_config/vars/small_cluster.yml +++ b/metron-deployment/roles/ambari_config/vars/small_cluster.yml @@ -114,7 +114,8 @@ required_configurations: kibana_es_url: http://{{ groups.web[0] }}:9200 kibana_log_dir: /var/log/kibana kibana_server_port: 5000 - kibana_default_application: "dashboard/Metron-Dashboard" + kibana_default_application: "dashboard/AV-YpDmwdXwc6Ua9Muh9" + kibana_server_host: 0.0.0.0 blueprint: stack_name: HDP diff --git a/metron-interface/metron-alerts/e2e/mock-data/alerts_ui_e2e_index.template b/metron-interface/metron-alerts/e2e/mock-data/alerts_ui_e2e_index.template index 773759286e..caf593c987 100644 --- a/metron-interface/metron-alerts/e2e/mock-data/alerts_ui_e2e_index.template +++ b/metron-interface/metron-alerts/e2e/mock-data/alerts_ui_e2e_index.template @@ -2,9 +2,6 @@ "template": "alerts_ui_e2e_index", "mappings": { "alerts_ui_e2e_doc": { - "_timestamp": { - "enabled": true - }, "dynamic_templates": [ { "geo_location_point": { @@ -20,8 +17,7 @@ "match": "enrichments:geo:*:country", "match_mapping_type": "*", "mapping": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" } } }, @@ -30,8 +26,7 @@ "match": "enrichments:geo:*:city", "match_mapping_type": "*", "mapping": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" } } }, @@ -40,8 +35,7 @@ "match": "enrichments:geo:*:locID", "match_mapping_type": "*", "mapping": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" } } }, @@ -50,8 +44,7 @@ "match": "enrichments:geo:*:dmaCode", "match_mapping_type": "*", "mapping": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" } } }, @@ -60,8 +53,7 @@ "match": "enrichments:geo:*:postalCode", "match_mapping_type": "*", "mapping": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" } } }, @@ -98,25 +90,27 @@ "mapping": { "type": "float" }, - "match": "threat.triage.rules:*:score", + "match": "threat:triage:*score", "match_mapping_type": "*" } }, { "threat_triage_reason": { "mapping": { - "type": "string" + "type": "text", + "fielddata": "true" }, - "match": "threat.triage.rules:*:reason", + "match": "threat:triage:rules:*:reason", "match_mapping_type": "*" } }, { "threat_triage_name": { "mapping": { - "type": "string" + "type": "text", + "fielddata": "true" }, - "match": "threat.triage.rules:*:name", + "match": "threat:triage:rules:*:name", "match_mapping_type": "*" } } @@ -131,14 +125,13 @@ * Be careful when modifying this file to not unintentionally affect other logs. * For instance, the "version" field exists in the HTTP, SSL, and SSH logs. If you * were to only consider the SSH log, you would set the type to integer, but because - * in the SSL and HTTP logs version is a string, we must set the type to string. + * in the SSL and HTTP logs version is a string, we must set the type to keyword. */ /* * Metron-specific fields */ "source:type": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, /* * Widely-used Bro fields (potentially renamed during Metron ingest) @@ -148,8 +141,7 @@ "format": "epoch_millis" }, "uid": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "alert": { "type": "nested" @@ -171,6 +163,12 @@ * https://www.bro.org/sphinx/scripts/base/protocols/http/main.bro.html#type-HTTP::Info * * Notable Fields + * Field: method + * Notes: Field exists in the HTTP and SIP logs + * + * Field: uri + * Notes: Field exists in the HTTP and SIP logs + * * Field: password * Notes: Field exists in the HTTP and FTP logs * @@ -178,46 +176,54 @@ * Notes: Field exists in the HTTP and FTP logs * * Field: trans_depth - * Notes: Field exists in the HTTP and SMTP logs + * Notes: Field exists in the HTTP, SMTP, and SIP logs * * Field: user_agent - * Notes: Field exists in the HTTP and SMTP logs + * Notes: Field exists in the HTTP, SMTP, and SIP logs * * Field: version * Notes: Field exists in the HTTP, SSL, and SSH logs * * Field: host - * Notes: Field exists in the HTTP and Software logs + * Notes: Field exists in the HTTP, KnownCerts, and Software logs * * Field: username * Notes: Field exists in the HTTP and RADIUS logs + * + * Field: status_code + * Notes: Field exists in the HTTP and SIP logs + * + * Field: status_msg + * Notes: Field exists in the HTTP and SIP logs + * + * Field: request_body_len + * Notes: Field exists in the HTTP and SIP logs + * + * Field: response_body_len + * Notes: Field exists in the HTTP and SIP logs */ "trans_depth": { "type": "integer" }, "method": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "host": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "uri": { - "type": "string", - "index": "not_analyzed", + "type": "keyword", "ignore_above": 8191 }, "referrer": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "version": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "user_agent": { - "type": "string" + "type": "text", + "fielddata": "true" }, "request_body_len": { "type": "long" @@ -229,19 +235,46 @@ "type": "integer" }, "status_msg": { + "type": "keyword" + }, + "info_code": { + "type": "integer" + }, + "info_msg": { "type": "string", "index": "not_analyzed" }, - "username": { + "tags": { "type": "string", "index": "not_analyzed" }, + "username": { + "type": "keyword" + }, "password": { + "type": "keyword" + }, + "proxied": { "type": "string", "index": "not_analyzed" }, - "capture_password": { - "type": "boolean" + "orig_fuids": { + "type": "string" + }, + "orig_filenames": { + "type": "string" + }, + "orig_mime_types": { + "type": "string" + }, + "resp_fuids": { + "type": "string" + }, + "resp_filenames": { + "type": "string" + }, + "resp_mime_types": { + "type": "string" }, /* * DNS log support @@ -253,38 +286,41 @@ * * Field: trans_id * Notes: Field exists in the DNS and DHCP logs + * + * Field: rtt + * Notes: This field uses the "interval" type, which may need handled differently. + * https://www.bro.org/sphinx-git/script-reference/types.html#type-interval */ "proto": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "trans_id": { "type": "long" }, - "query": { + "rtt": { "type": "string", "index": "not_analyzed" }, + "query": { + "type": "keyword" + }, "qclass": { "type": "integer" }, "qclass_name": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "qtype": { "type": "integer" }, "qtype_name": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "rcode": { "type": "integer" }, "rcode_name": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "AA": { "type": "boolean" @@ -302,6 +338,10 @@ "type": "integer" }, "answers": { + "type": "text", + "fielddata": "true" + }, + "TTLs": { "type": "string" }, "rejected": { @@ -322,58 +362,46 @@ * Notes: Field exists in the Conn and Files logs */ "service": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "duration": { "type": "float" }, "orig_bytes": { - "type": "long", - "index": "not_analyzed" + "type": "long" }, "resp_bytes": { - "type": "long", - "index": "not_analyzed" + "type": "long" }, "conn_state": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "local_orig": { "type": "boolean" }, "local_resp": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "missed_bytes": { - "type": "long", - "index": "not_analyzed" + "type": "long" }, "history": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "orig_pkts": { - "type": "long", - "index": "not_analyzed" + "type": "long" }, "orig_ip_bytes": { - "type": "long", - "index": "not_analyzed" + "type": "long" }, "resp_pkts": { - "type": "long", - "index": "not_analyzed" + "type": "long" }, "resp_ip_bytes": { - "type": "long", - "index": "not_analyzed" + "type": "long" }, "tunnel_parents": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, /* * DPD log support @@ -384,12 +412,10 @@ * Notes: Field exists in the DNS, Conn, DPD, and Notice logs */ "analyzer": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "failure_reason": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, /* * FTP log support @@ -406,22 +432,22 @@ * Notes: Field exists in the FTP and Files logs * * Field: fuid - * Notes: Field exists in the FTP and Notice logs + * Notes: Field exists in the FTP, Files, and Notice logs */ "user": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "command": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "arg": { - "type": "string", + "type": "text", + "fielddata": "true", "analyzer": "simple" }, "mime_type": { - "type": "string", + "type": "text", + "fielddata": "true", "analyzer": "simple" }, "file_size": { @@ -431,8 +457,7 @@ "type": "integer" }, "reply_msg": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "data_channel:passive": { "type": "boolean" @@ -447,15 +472,15 @@ "type": "integer" }, "cwd": { - "type": "string", + "type": "text", + "fielddata": "true", "analyzer": "simple" }, "passive": { "type": "boolean" }, "fuid": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, /* * Files log support @@ -470,25 +495,34 @@ * * Field: mime_type * Notes: Field exists in the FTP and Files logs + * + * Field: duration + * Notes: Field exists in the Conn and Files logs + * + * Field: local_orig + * Notes: Field exists in the Conn and Files logs + * + * Field: fuid + * Notes: Field exists in the FTP, Files, and Notice logs */ "conn_uids": { - "type": "string", + "type": "text", + "fielddata": "true", "analyzer": "simple" }, "source": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "depth": { "type": "integer" }, "analyzers": { - "type": "string", + "type": "text", + "fielddata": "true", "analyzer": "simple" }, "filename": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "is_orig": { "type": "boolean" @@ -509,113 +543,143 @@ "type": "boolean" }, "parent_fuid": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "md5": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "sha1": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "sha256": { + "type": "keyword" + }, + "extracted": { "type": "string", "index": "not_analyzed" }, + "extracted_cutoff": { + "type": "boolean" + }, + "extracted_size": { + "type": "long" + }, /* * Known::CertInfo log support * https://www.bro.org/sphinx/scripts/policy/protocols/ssl/known-certs.bro.html#type-Known::CertsInfo * * Notable Fields + * Field: host + * Notes: Field exists in the HTTP, KnownCerts, and Software logs + * * Field: subject - * Notes: Field exists in the Known::CertInfo and SMTP logs + * Notes: Field exists in the KnownCerts, SMTP, SIP, and SSL logs */ "port_num": { "type": "integer" }, "subject": { - "type": "string", + "type": "text", + "fielddata": "true", "analyzer": "simple" }, "issuer_subject": { - "type": "string", + "type": "text", + "fielddata": "true", "analyzer": "simple" }, "serial": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, /* * SMTP log support * https://www.bro.org/sphinx/scripts/base/protocols/smtp/main.bro.html#type-SMTP::Info * * Notable Fields + * Field: trans_depth + * Notes: Field exists in the HTTP, SMTP, and SIP logs + * + * Field: date + * Notes: Field exists in the SMTP and SIP logs + * * Field: subject - * Notes: Field exists in the Known::CertInfo and SMTP logs + * Notes: Field exists in the KnownCerts, SMTP, SIP, and SSL logs + * + * Field: reply_to + * Notes: Field exists in the SMTP and SIP logs + * + * Field: user_agent + * Notes: Field exists in the HTTP, SMTP, and SIP logs */ "helo": { - "type": "string", + "type": "text", + "fielddata": "true", "analyzer": "simple" }, "mailfrom": { - "type": "string", + "type": "text", + "fielddata": "true", "analyzer": "simple" }, "rcptto": { - "type": "string", + "type": "text", + "fielddata": "true", "analyzer": "simple" }, "date": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "from": { - "type": "string", + "type": "text", + "fielddata": "true", "analyzer": "simple" }, "to": { + "type": "text", + "fielddata": "true", + "analyzer": "simple" + }, + "cc": { "type": "string", "analyzer": "simple" }, "reply_to": { - "type": "string", + "type": "text", + "fielddata": "true", "analyzer": "simple" }, "msg_id": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "in_reply_to": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "x_originating_ip": { "type": "ip" }, "first_received": { - "type": "string", + "type": "text", + "fielddata": "true", "analyzer": "simple" }, "second_received": { - "type": "string", + "type": "text", + "fielddata": "true", "analyzer": "simple" }, "last_reply": { - "type": "string", + "type": "text", + "fielddata": "true", "analyzer": "simple" }, "path": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "tls": { "type": "boolean" }, "fuids": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "is_webmail": { "type": "boolean" @@ -627,51 +691,82 @@ * Notable Fields * Field: version * Notes: Field exists in the HTTP, SSL, and SSH logs + * + * Field: subject + * Notes: Field exists in the KnownCerts, SMTP, SIP, and SSL logs */ "cipher": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "curve": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "server_name": { + "type": "keyword" + }, + "resumed": { + "type": "boolean" + }, + "server_appdata": { "type": "string", "index": "not_analyzed" }, - "resumed": { + "client_appdata": { "type": "boolean" }, "last_alert": { + "type": "keyword" + }, + "next_protocol": { + "type": "keyword" + }, + "established": { + "type": "boolean" + }, + "cert_chain_fuids": { + "type": "string" + }, + "client_cert_chain_fuids": { + "type": "string" + }, + "issuer": { "type": "string", "index": "not_analyzed" }, - "next_protocol": { + "client_subject": { "type": "string", "index": "not_analyzed" }, - "established": { - "type": "boolean" + "client_issuer": { + "type": "string", + "index": "not_analyzed" + }, + "validation_status": { + "type": "string", + "index": "not_analyzed" }, /* * Weird log support * https://www.bro.org/sphinx/scripts/base/frameworks/notice/weird.bro.html#type-Weird::Info + * + * Notable Fields + * Field: peer + * Notes: Field exists in the Weird, CaptureLoss, and Stats logs + * + * Field: name + * Notes: Field exists in the Weird and LoadedScripts logs */ "name": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "addl": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "notice": { "type": "boolean" }, "peer": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, /* * Notice log support @@ -679,30 +774,40 @@ * * Notable Fields * Field: fuid - * Notes: Field exists in the FTP and Notice logs + * Notes: Field exists in the FTP, Files, and Notice logs * * Field: proto * Notes: Field exists in the DNS, Conn, DPD, and Notice logs + * + * Field: remote_location:country_code + * Notes: Field exists in the Notice and SSH logs + * + * Field: remote_location:region + * Notes: Field exists in the Notice and SSH logs + * + * Field: remote_location:city + * Notes: Field exists in the Notice and SSH logs + * + * Field: remote_location:latitude + * Notes: Field exists in the Notice and SSH logs + * + * Field: remote_location:longitude + * Notes: Field exists in the Notice and SSH logs */ "file_mime_type": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "file_desc": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "note": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "msg": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "sub": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "src": { "type": "ip" @@ -711,52 +816,60 @@ "type": "ip" }, "p": { - "type": "integer", - "index": "not_analyzed" + "type": "integer" }, "n": { - "type": "integer", - "index": "not_analyzed" + "type": "integer" }, "src_peer": { "type": "ip" }, "peer_descr": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "actions": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "suppress_for": { - "type": "double", - "index": "not_analyzed" + "type": "double" }, "dropped": { "type": "boolean" }, + "remote_location:country_code": { + "type": "string" + }, + "remote_location:region": { + "type": "string" + }, + "remote_location:city": { + "type": "string" + }, + "remote_location:latitude": { + "type": "double" + }, + "remote_location:longitude": { + "type": "double" + }, /* * DHCP log support * https://www.bro.org/sphinx/scripts/base/protocols/dhcp/main.bro.html#type-DHCP::Info * * Notable Fields + * Field: mac + * Notes: Field exists in the DHCP, RADIUS, and KnownDevices logs + * * Field: trans_id * Notes: Field exists in the DNS and DHCP logs - * - * Field: mac - * Notes: Field exists in the DHCP, RADIUS, and Known::DevicesInfo logs */ "mac": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "assigned_ip": { "type": "ip" }, "lease_time": { - "type": "float", - "index": "not_analyzed" + "type": "float" }, /* * SSH log support @@ -765,49 +878,54 @@ * Notable Fields * Field: version * Notes: Field exists in the HTTP, SSL, and SSH logs + * + * Field: remote_location:country_code + * Notes: Field exists in the Notice and SSH logs + * + * Field: remote_location:region + * Notes: Field exists in the Notice and SSH logs + * + * Field: remote_location:city + * Notes: Field exists in the Notice and SSH logs + * + * Field: remote_location:latitude + * Notes: Field exists in the Notice and SSH logs + * + * Field: remote_location:longitude + * Notes: Field exists in the Notice and SSH logs */ "auth_success": { "type": "boolean" }, "auth_attempts": { - "type": "integer", - "index": "not_analyzed" + "type": "integer" }, "direction": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "client": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "server": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "cipher_alg": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "mac_alg": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "compression_alg": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "kex_alg": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "host_key_alg": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "host_key": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, /* * Software log support @@ -815,38 +933,32 @@ * * Notable Fields * Field: host - * Notes: Field exists in the HTTP and Software logs + * Notes: Field exists in the HTTP, KnownCerts, and Software logs */ "host_p": { - "type": "integer", - "index": "not_analyzed" + "type": "integer" }, "software_type": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "version:major": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "version:minor": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "version:minor2": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "version:minor3": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "version:addl": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "unparsed_version": { - "type": "string", + "type": "text", + "fielddata": "true", "analyzer": "simple" }, /* @@ -858,16 +970,29 @@ * Notes: Field exists in the HTTP and RADIUS logs * * Field: mac - * Notes: Field exists in the DHCP, RADIUS, and Known::DevicesInfo logs + * Notes: Field exists in the DHCP, RADIUS, and KnownDevices logs + * + * Field: ttl + * Notes: This field uses the "interval" type, which may need handled differently. + * https://www.bro.org/sphinx-git/script-reference/types.html#type-interval */ + "framed_addr": { + "type": "ip" + }, "remote_ip": { "type": "ip" }, "connect_info": { + "type": "keyword" + }, + "reply_msg": { "type": "string", "index": "not_analyzed" }, "result": { + "type": "keyword" + }, + "ttl": { "type": "string", "index": "not_analyzed" }, @@ -880,82 +1005,64 @@ * Notes: In other bro records, the id field is of type conn_id, so it is * expanded before being logged into 4 fields, all of which are addressed * under the "Widely-used Bro fields" section of this template. In X509 - * logs, however, id is a string to identify the certificate file id. + * logs, however, id is a keyword to identify the certificate file id. */ "id": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "certificate:version": { - "type": "integer", - "index": "not_analyzed" + "type": "integer" }, "certificate:serial": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "certificate:subject": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "certificate:issuer": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "certificate:not_valid_before": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "certificate:not_valid_after": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "certificate:key_alg": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "certificate:sig_alg": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "certificate:key_type": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "certificate:key_length": { - "type": "integer", - "index": "not_analyzed" + "type": "integer" }, "certificate:exponent": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "certificate:curve": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "san:dns": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "san:uri": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "san:email": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "san:ip": { - "type": "string", - "index": "not_analyzed" + "type": "keyword" }, "basic_constraints:ca": { "type": "boolean" }, "basic_constraints:path_len": { - "type": "integer", - "index": "not_analyzed" + "type": "integer" }, /* * Known::DevicesInfo log support @@ -963,11 +1070,245 @@ * * Notable Fields * Field: mac - * Notes: Field exists in the DHCP, RADIUS, and Known::DevicesInfo logs + * Notes: Field exists in the DHCP, RADIUS, and KnownDevices logs */ "dhcp_host_name": { - "type": "string", + "type": "keyword" + }, + /* + * RFB::Info log support + * https://www.bro.org/sphinx-git/scripts/base/protocols/rfb/main.bro.html#type-RFB::Info + */ + "client_major_version": { + "type": "keyword" + }, + "client_minor_version": { + "type": "keyword" + }, + "server_major_version": { + "type": "keyword" + }, + "server_minor_version": { + "type": "keyword" + }, + "authentication_method": { + "type": "keyword" + }, + "auth": { + "type": "boolean" + }, + "share_flag": { + "type": "boolean" + }, + "desktop_name": { + "type": "keyword" + }, + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + }, + /* + * Stats::Info log support + * https://www.bro.org/sphinx/scripts/policy/misc/stats.bro.html#type-Stats::Info + * + * Notable Fields + * Field: peer + * Notes: Field exists in the Weird, CaptureLoss, and Stats logs + * + * Field: pkt_lag + * Notes: This field uses the "interval" type, which may need handled differently. + * https://www.bro.org/sphinx-git/script-reference/types.html#type-interval + */ + "mem": { + "type": "integer" + }, + "pkts_proc": { + "type": "integer" + }, + "bytes_recv": { + "type": "integer" + }, + "pkts_dropped": { + "type": "integer" + }, + "pkts_link": { + "type": "integer" + }, + "pkt_lag": { + "type": "keyword" + }, + "events_proc": { + "type": "integer" + }, + "events_queued": { + "type": "integer" + }, + "active_tcp_conns": { + "type": "integer" + }, + "active_udp_conns": { + "type": "integer" + }, + "active_icmp_conns": { + "type": "integer" + }, + "tcp_conns": { + "type": "integer" + }, + "udp_conns": { + "type": "integer" + }, + "icmp_conns": { + "type": "integer" + }, + "timers": { + "type": "integer" + }, + "active_timers": { + "type": "integer" + }, + "files": { + "type": "integer" + }, + "active_files": { + "type": "integer" + }, + "dns_requests": { + "type": "integer" + }, + "active_dns_requests": { + "type": "integer" + }, + "reassem_tcp_size": { + "type": "integer" + }, + "reassem_file_size": { + "type": "integer" + }, + "reassem_frag_size": { + "type": "integer" + }, + "reassem_unknown_size": { + "type": "integer" + }, + /* + * CaptureLoss::Info log support + * https://www.bro.org/sphinx/scripts/policy/misc/capture-loss.bro.html#type-CaptureLoss::Info + * + * Notable Fields + * Field: ts_delta + * Notes: This field uses the "interval" type, which may need handled differently. + * https://www.bro.org/sphinx-git/script-reference/types.html#type-interval + * + * Field: peer + * Notes: Field exists in the Weird, CaptureLoss, and Stats logs + */ + "ts_delta": { + "type": "keyword" + }, + "gaps": { + "type": "integer", "index": "not_analyzed" + }, + "acks": { + "type": "integer", + "index": "not_analyzed" + }, + "percent_lost": { + "type": "double", + "index": "not_analyzed" + }, + /* + * Reporter::Info log support + * https://www.bro.org/sphinx/scripts/base/frameworks/reporter/main.bro.html#type-Reporter::Info + */ + "level": { + "type": "text", + "fielddata": "true", + "analyzer": "simple" + }, + "message": { + "type": "keyword" + }, + "location": { + "type": "keyword" + }, + /* + * SIP::Info log support + * https://www.bro.org/sphinx/scripts/base/protocols/sip/main.bro.html#type-SIP::Info + * + * Notable Fields + * Field: trans_depth + * Notes: Field exists in the HTTP, SMTP, and SIP logs + * + * Field: method + * Notes: Field exists in the HTTP and SIP logs + * + * Field: uri + * Notes: Field exists in the HTTP and SIP logs + * + * Field: date + * Notes: Field exists in the SMTP and SIP logs + * + * Field: reply_to + * Notes: Field exists in the SMTP and SIP logs + * + * Field: subject + * Notes: Field exists in the KnownCerts, SMTP, SIP, and SSL logs + * + * Field: user_agent + * Notes: Field exists in the HTTP, SMTP, and SIP logs + * + * Field: status_code + * Notes: Field exists in the HTTP and SIP logs + * + * Field: status_msg + * Notes: Field exists in the HTTP and SIP logs + * + * Field: request_body_len + * Notes: Field exists in the HTTP and SIP logs + * + * Field: response_body_len + * Notes: Field exists in the HTTP and SIP logs + */ + "request_from": { + "type": "keyword" + }, + "request_to": { + "type": "keyword" + }, + "response_from": { + "type": "keyword" + }, + "response_to": { + "type": "keyword" + }, + "call_id": { + "type": "keyword" + }, + "seq": { + "type": "keyword" + }, + "request_path": { + "type": "text", + "fielddata": "true", + "analyzer": "simple" + }, + "response_path": { + "type": "text", + "fielddata": "true", + "analyzer": "simple" + }, + "warning": { + "type": "keyword" + }, + "content_type": { + "type": "keyword" + }, + "guid": { + "type": "keyword" } } } diff --git a/metron-interface/metron-alerts/e2e/utils/e2e_util.ts b/metron-interface/metron-alerts/e2e/utils/e2e_util.ts index 92476a4e04..8ae1de1c3d 100644 --- a/metron-interface/metron-alerts/e2e/utils/e2e_util.ts +++ b/metron-interface/metron-alerts/e2e/utils/e2e_util.ts @@ -48,10 +48,23 @@ export function waitForStalenessOf (_element ) { export function loadTestData() { deleteTestData(); - fs.createReadStream('e2e/mock-data/alerts_ui_e2e_index.template') - .pipe(request.post('http://node1:9200/_template/alerts_ui_e2e_index')); - fs.createReadStream('e2e/mock-data/alerts_ui_e2e_index.data') - .pipe(request.post('http://node1:9200/alerts_ui_e2e_index/alerts_ui_e2e_doc/_bulk')); + let template = fs.readFileSync('e2e/mock-data/alerts_ui_e2e_index.template', 'utf8'); + request({ + url: 'http://node1:9200/_template/alerts_ui_e2e_index', + method: 'POST', + body: template + }, function(error, response, body) { + // add logging if desired + }); + + let data = fs.readFileSync('e2e/mock-data/alerts_ui_e2e_index.data', 'utf8'); + request({ + url: 'http://node1:9200/alerts_ui_e2e_index/alerts_ui_e2e_doc/_bulk', + method: 'POST', + body: data + }, function(error, response, body) { + // add logging if desired + }); } export function deleteTestData() { @@ -60,8 +73,15 @@ export function deleteTestData() { export function createMetaAlertsIndex() { deleteMetaAlertsIndex(); - fs.createReadStream('./../../metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/metaalert_index.template') - .pipe(request.post('http://node1:9200/metaalert_index')); + + let template = fs.readFileSync('./../../metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/files/metaalert_index.template', 'utf8'); + request({ + url: 'http://node1:9200/_template/metaalert_index', + method: 'POST', + body: template + }, function(error, response, body) { + // add logging if desired + }); } export function deleteMetaAlertsIndex() { diff --git a/metron-interface/metron-rest/src/main/java/org/apache/metron/rest/controller/RestExceptionHandler.java b/metron-interface/metron-rest/src/main/java/org/apache/metron/rest/controller/RestExceptionHandler.java index 5e6f7e741b..a3bab30343 100644 --- a/metron-interface/metron-rest/src/main/java/org/apache/metron/rest/controller/RestExceptionHandler.java +++ b/metron-interface/metron-rest/src/main/java/org/apache/metron/rest/controller/RestExceptionHandler.java @@ -20,6 +20,8 @@ import org.apache.commons.lang3.exception.ExceptionUtils; import org.apache.metron.rest.RestException; import org.apache.metron.rest.model.RestError; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.ControllerAdvice; @@ -28,14 +30,17 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler; import javax.servlet.http.HttpServletRequest; +import java.lang.invoke.MethodHandles; @ControllerAdvice(basePackages = "org.apache.metron.rest.controller") public class RestExceptionHandler extends ResponseEntityExceptionHandler { + private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @ExceptionHandler(RestException.class) @ResponseBody ResponseEntity handleControllerException(HttpServletRequest request, Throwable ex) { HttpStatus status = getStatus(request); + LOG.error("Encountered error: " + ex.getMessage(), ex); return new ResponseEntity<>(new RestError(status.value(), ex.getMessage(), ExceptionUtils.getRootCauseMessage(ex)), status); } diff --git a/metron-interface/metron-rest/src/main/java/org/apache/metron/rest/service/impl/UpdateServiceImpl.java b/metron-interface/metron-rest/src/main/java/org/apache/metron/rest/service/impl/UpdateServiceImpl.java index 847173e716..76ac75db6a 100644 --- a/metron-interface/metron-rest/src/main/java/org/apache/metron/rest/service/impl/UpdateServiceImpl.java +++ b/metron-interface/metron-rest/src/main/java/org/apache/metron/rest/service/impl/UpdateServiceImpl.java @@ -23,15 +23,18 @@ import org.apache.metron.indexing.dao.update.ReplaceRequest; import org.apache.metron.rest.RestException; import org.apache.metron.rest.service.UpdateService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.lang.invoke.MethodHandles; import java.util.Optional; @Service public class UpdateServiceImpl implements UpdateService { private IndexDao dao; - + private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Autowired public UpdateServiceImpl(IndexDao dao) { this.dao = dao; @@ -43,6 +46,7 @@ public void patch(PatchRequest request) throws RestException, OriginalNotFoundEx try { dao.patch(request, Optional.of(System.currentTimeMillis())); } catch (Exception e) { + throw new RestException(e.getMessage(), e); } } diff --git a/metron-interface/metron-rest/src/test/java/org/apache/metron/rest/controller/SearchControllerIntegrationTest.java b/metron-interface/metron-rest/src/test/java/org/apache/metron/rest/controller/SearchControllerIntegrationTest.java index f83fe0068f..d8758cdfa1 100644 --- a/metron-interface/metron-rest/src/test/java/org/apache/metron/rest/controller/SearchControllerIntegrationTest.java +++ b/metron-interface/metron-rest/src/test/java/org/apache/metron/rest/controller/SearchControllerIntegrationTest.java @@ -17,7 +17,20 @@ */ package org.apache.metron.rest.controller; +import static org.apache.metron.integration.utils.TestUtils.assertEventually; +import static org.apache.metron.rest.MetronRestConstants.TEST_PROFILE; +import static org.hamcrest.Matchers.hasSize; +import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.csrf; +import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.httpBasic; +import static org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.springSecurity; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + import com.google.common.collect.ImmutableMap; +import java.util.HashMap; +import java.util.Map; import org.adrianwalker.multilinestring.Multiline; import org.apache.metron.indexing.dao.InMemoryDao; import org.apache.metron.indexing.dao.SearchIntegrationTest; @@ -37,20 +50,6 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.web.context.WebApplicationContext; -import java.util.HashMap; -import java.util.Map; - -import static org.apache.metron.integration.utils.TestUtils.assertEventually; -import static org.apache.metron.rest.MetronRestConstants.TEST_PROFILE; -import static org.hamcrest.Matchers.hasSize; -import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.csrf; -import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.httpBasic; -import static org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.springSecurity; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @ActiveProfiles(TEST_PROFILE) @@ -147,7 +146,7 @@ public void testColumnMetadataUsingDefaultIndices() throws Exception { .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.parseMediaType("application/json;charset=UTF-8"))) .andExpect(jsonPath("$.*", hasSize(5))) - .andExpect(jsonPath("$.common_string_field").value("string")) + .andExpect(jsonPath("$.common_string_field").value("text")) .andExpect(jsonPath("$.common_integer_field").value("integer")) .andExpect(jsonPath("$.bro_field").value("boolean")) .andExpect(jsonPath("$.snort_field").value("double")) @@ -262,10 +261,11 @@ public void test() throws Exception { .andExpect(jsonPath("$.groupResults[0].groupResults[0].score").value(50)); this.mockMvc.perform(post(searchUrl + "/column/metadata").with(httpBasic(user, password)).with(csrf()).contentType(MediaType.parseMediaType("application/json;charset=UTF-8")).content("[\"bro\",\"snort\"]")) + .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.parseMediaType("application/json;charset=UTF-8"))) .andExpect(jsonPath("$.*", hasSize(5))) - .andExpect(jsonPath("$.common_string_field").value("string")) + .andExpect(jsonPath("$.common_string_field").value("text")) .andExpect(jsonPath("$.common_integer_field").value("integer")) .andExpect(jsonPath("$.bro_field").value("boolean")) .andExpect(jsonPath("$.snort_field").value("double")) @@ -275,7 +275,7 @@ public void test() throws Exception { .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.parseMediaType("application/json;charset=UTF-8"))) .andExpect(jsonPath("$.*", hasSize(4))) - .andExpect(jsonPath("$.common_string_field").value("string")) + .andExpect(jsonPath("$.common_string_field").value("text")) .andExpect(jsonPath("$.common_integer_field").value("integer")) .andExpect(jsonPath("$.bro_field").value("boolean")) .andExpect(jsonPath("$.duplicate_field").value("date")); @@ -284,7 +284,7 @@ public void test() throws Exception { .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.parseMediaType("application/json;charset=UTF-8"))) .andExpect(jsonPath("$.*", hasSize(4))) - .andExpect(jsonPath("$.common_string_field").value("string")) + .andExpect(jsonPath("$.common_string_field").value("text")) .andExpect(jsonPath("$.common_integer_field").value("integer")) .andExpect(jsonPath("$.snort_field").value("double")) .andExpect(jsonPath("$.duplicate_field").value("long")); @@ -301,12 +301,12 @@ public void test() throws Exception { private void loadColumnTypes() throws ParseException { Map> columnTypes = new HashMap<>(); Map broTypes = new HashMap<>(); - broTypes.put("common_string_field", FieldType.STRING); + broTypes.put("common_string_field", FieldType.TEXT); broTypes.put("common_integer_field", FieldType.INTEGER); broTypes.put("bro_field", FieldType.BOOLEAN); broTypes.put("duplicate_field", FieldType.DATE); Map snortTypes = new HashMap<>(); - snortTypes.put("common_string_field", FieldType.STRING); + snortTypes.put("common_string_field", FieldType.TEXT); snortTypes.put("common_integer_field", FieldType.INTEGER); snortTypes.put("snort_field", FieldType.DOUBLE); snortTypes.put("duplicate_field", FieldType.LONG); diff --git a/metron-platform/elasticsearch-shaded/pom.xml b/metron-platform/elasticsearch-shaded/pom.xml index 13acf679d3..789ddeb144 100644 --- a/metron-platform/elasticsearch-shaded/pom.xml +++ b/metron-platform/elasticsearch-shaded/pom.xml @@ -30,6 +30,51 @@ 18.0 + org.elasticsearch.client + transport + ${global_elasticsearch_version} + + + com.fasterxml.jackson.dataformat + jackson-dataformat-smile + + + com.fasterxml.jackson.dataformat + jackson-dataformat-yaml + + + com.fasterxml.jackson.dataformat + jackson-dataformat-cbor + + + com.fasterxml.jackson.core + jackson-core + + + org.slf4j + slf4j-api + + + org.slf4j + slf4j-log4j12 + + + log4j + log4j + + + + + org.apache.logging.log4j + log4j-core + 2.8.2 + + + org.apache.logging.log4j + log4j-api + 2.8.2 + + org.elasticsearch elasticsearch ${global_elasticsearch_version} @@ -50,6 +95,10 @@ com.fasterxml.jackson.core jackson-core + + org.apache.logging.log4j + log4j-api + @@ -99,7 +148,16 @@ - + + + + io.netty + org.apache.metron.io.netty + + + org.apache.logging.log4j + org.apache.metron.logging.log4j + com.google.common org.apache.metron.guava.elasticsearch-shaded diff --git a/metron-platform/elasticsearch-shaded/src/main/java/org/apache/metron/netty/utils/NettyRuntimeWrapper.java b/metron-platform/elasticsearch-shaded/src/main/java/org/apache/metron/netty/utils/NettyRuntimeWrapper.java new file mode 100644 index 0000000000..eda9e6a5d7 --- /dev/null +++ b/metron-platform/elasticsearch-shaded/src/main/java/org/apache/metron/netty/utils/NettyRuntimeWrapper.java @@ -0,0 +1,34 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +package org.apache.metron.netty.utils; + +import io.netty.util.NettyRuntime; + +/** + * When working with shaded artifacts that have package relocation, you can't reference the deps + * expliticly in some IDE's, e.g. IntelliJ. This allows the shading and relocating to be isolated + * to the specific project that contains the dependency. + */ +public class NettyRuntimeWrapper { + + public static int availableProcessors() { + return NettyRuntime.availableProcessors(); + } + +} diff --git a/metron-platform/elasticsearch-shaded/src/main/resources/META-INF/log4j-provider.properties b/metron-platform/elasticsearch-shaded/src/main/resources/META-INF/log4j-provider.properties new file mode 100644 index 0000000000..c4bd3f06b6 --- /dev/null +++ b/metron-platform/elasticsearch-shaded/src/main/resources/META-INF/log4j-provider.properties @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +LoggerContextFactory = org.apache.metron.logging.log4j.core.impl.Log4jContextFactory +Log4jAPIVersion = 2.6.0 +FactoryPriority= 10 \ No newline at end of file diff --git a/metron-platform/metron-common/pom.xml b/metron-platform/metron-common/pom.xml index f4e1e423ae..5bd61c9f9b 100644 --- a/metron-platform/metron-common/pom.xml +++ b/metron-platform/metron-common/pom.xml @@ -89,6 +89,14 @@ ${global_storm_version} provided + + org.apache.logging.log4j + log4j-core + + + org.apache.logging.log4j + log4j-api + servlet-api javax.servlet diff --git a/metron-platform/metron-data-management/README.md b/metron-platform/metron-data-management/README.md index b6acd830ec..f284dab300 100644 --- a/metron-platform/metron-data-management/README.md +++ b/metron-platform/metron-data-management/README.md @@ -17,6 +17,17 @@ limitations under the License. --> # Resource Data Management +## Table of Contents + +* [Overview](#overview) +* [Simple HBase Enrichments/Threat Intelligence](#simple-hbase-enrichmentsthreat-intelligence) +* [Extractor Framework](#extractor-framework) +* [Enrichment Config](#enrichment-config) +* [Loading Utilities](#loading-utilities) +* [Pruning Data from Elasticsearch](#pruning-data-from-elasticsearch) + +## Overview + This project is a collection of classes to assist with loading of various enrichment and threat intelligence sources into Metron. @@ -354,3 +365,39 @@ The parameters for the utility are as follows: | -r | --remote_dir | No | HDFS directory to land formatted GeoIP file - defaults to /apps/metron/geo/\/ | | -t | --tmp_dir | No | Directory for landing the temporary GeoIP data - defaults to /tmp | | -z | --zk_quorum | Yes | Zookeeper Quorum URL (zk1:port,zk2:port,...) | + +## Pruning Data from Elasticsearch + +**Note** - As of the Metron upgrade from Elasticsearch 2.3.3 to 5.6.2, the included Data Pruner is no longer supported. It is replaced in favor of the Curator utility +provided by Elasticsearch. The current Curator version is 5.4 as of this version of Metron and does not match exactly with ES and Kibana. + +Elasticsearch provides tooling to prune index data through [Curator](https://www.elastic.co/guide/en/elasticsearch/client/curator/5.4/index.html). + +Here is a sample invocation that you can configure through Cron to prune indexes based on timestamp in the index name. + +``` +/opt/elasticsearch-curator/curator_cli --host localhost delete_indices --filter_list ' + { + "filtertype": "age", + "source": "name", + "timestring": "%Y.%m.%d", + "unit": "days", + "unit_count": 10, + "direction": "older” + }' +``` + +From the ES documentation: +> Using name as the source tells Curator to look for a timestring within the index or snapshot name, and convert that into an epoch timestamp (epoch implies UTC). + +You can also provide multiple filters as an array of JSON objects to filter_list if you want finer-grained control over the indexes that will be pruned. +There is an implicit logical AND when chaining multiple filters. + +``` +--filter_list '[{"filtertype":"age","source":"creation_date","direction":"older","unit":"days","unit_count":13},{"filtertype":"pattern","kind":"prefix","value":"logstash"}]' +``` + +### Reference +* [https://www.elastic.co/guide/en/elasticsearch/client/curator/5.4/index.html](https://www.elastic.co/guide/en/elasticsearch/client/curator/5.4/index.html) +* [https://www.elastic.co/guide/en/elasticsearch/client/curator/5.4/filtertype_age.html](https://www.elastic.co/guide/en/elasticsearch/client/curator/5.4/filtertype_age.html) +* [https://www.elastic.co/guide/en/elasticsearch/client/curator/5.4/singleton-cli.html](https://www.elastic.co/guide/en/elasticsearch/client/curator/5.4/singleton-cli.html) diff --git a/metron-platform/metron-data-management/pom.xml b/metron-platform/metron-data-management/pom.xml index 2dca9a5cbe..7cdfc80552 100644 --- a/metron-platform/metron-data-management/pom.xml +++ b/metron-platform/metron-data-management/pom.xml @@ -29,6 +29,7 @@ 4.3.2 5.5.0 + com.google.guava @@ -144,7 +145,6 @@ ${global_hadoop_version} provided - org.apache.hadoop hadoop-auth @@ -189,7 +189,6 @@ provided - org.apache.hbase hbase-server @@ -207,8 +206,6 @@ org.apache.hadoop hadoop-hdfs - - org.apache.hadoop hadoop-common @@ -231,11 +228,6 @@ httpclient ${httpcore.version} - - org.elasticsearch - elasticsearch - ${global_elasticsearch_version} - org.hamcrest hamcrest-all @@ -248,25 +240,7 @@ 2.1.14 test - - org.elasticsearch - elasticsearch - ${global_elasticsearch_version} - test-jar - test - - - org.apache.lucene - lucene-test-framework - ${lucene.test.version} - test - - - org.apache.lucene - lucene-core - ${lucene.test.version} - - + org.apache.hadoop hadoop-hdfs ${global_hadoop_version} @@ -371,6 +345,7 @@ test + diff --git a/metron-platform/metron-data-management/src/main/java/org/apache/metron/dataloads/bulk/ElasticsearchDataPruner.java b/metron-platform/metron-data-management/src/main/java/org/apache/metron/dataloads/bulk/ElasticsearchDataPruner.java deleted file mode 100644 index ce543456e6..0000000000 --- a/metron-platform/metron-data-management/src/main/java/org/apache/metron/dataloads/bulk/ElasticsearchDataPruner.java +++ /dev/null @@ -1,130 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ -package org.apache.metron.dataloads.bulk; - -import com.google.common.base.Predicate; -import com.google.common.collect.Iterables; -import java.io.IOException; -import java.lang.invoke.MethodHandles; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Arrays; -import java.util.Date; -import java.util.Iterator; -import org.apache.commons.collections.IteratorUtils; -import org.apache.metron.common.configuration.Configuration; -import org.elasticsearch.client.AdminClient; -import org.elasticsearch.client.Client; -import org.elasticsearch.cluster.metadata.IndexMetaData; -import org.elasticsearch.common.collect.ImmutableOpenMap; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ElasticsearchDataPruner extends DataPruner { - - private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - private static final String defaultDateFormat = "yyyy.MM.dd.HH"; - private String indexPattern; - private SimpleDateFormat dateFormat; - protected Client indexClient = null; - protected Configuration configuration; - - private Predicate filterWithRegex = new Predicate() { - - @Override - public boolean apply(String str) { - - try { - String dateString = str.substring(indexPattern.length()); - Date indexCreateDate = dateFormat.parse(dateString); - long indexCreatedDate = indexCreateDate.getTime(); - if (indexCreatedDate >= firstTimeMillis && indexCreatedDate < lastTimeMillis) { - return true; - } - } catch (ParseException e) { - LOG.error("Unable to parse date from {}", str.substring(indexPattern.length()), e); - } - - return false; - } - - }; - - public ElasticsearchDataPruner(Date startDate, Integer numDays,Configuration configuration, Client indexClient, String indexPattern) throws Exception { - - super(startDate, numDays, indexPattern); - - this.indexPattern = indexPattern; - this.dateFormat = new SimpleDateFormat(defaultDateFormat); - this.configuration = configuration; - this.indexClient = indexClient; - - - } - - @Override - public Long prune() throws IOException { - - try { - - configuration.update(); - - } - catch(Exception e) { - LOG.error("Unable to update configs",e); - } - - String dateString = configuration.getGlobalConfig().get("es.date.format").toString(); - - if( null != dateString ){ - dateFormat = new SimpleDateFormat(dateString); - } - - ImmutableOpenMap allIndices = indexClient.admin().cluster().prepareState().get().getState().getMetaData().getIndices(); - Iterable indicesForDeletion = getFilteredIndices(allIndices); - Object[] indexArray = IteratorUtils.toArray(indicesForDeletion.iterator()); - - if(indexArray.length > 0) { - String[] indexStringArray = new String[indexArray.length]; - System.arraycopy(indexArray, 0, indexStringArray, 0, indexArray.length); - deleteIndex(indexClient.admin(), indexStringArray); - } - - return (long) indexArray.length; - - } - - public boolean deleteIndex(AdminClient adminClient, String... index) { - - boolean isAcknowledged = adminClient.indices().delete(adminClient.indices().prepareDelete(index).request()).actionGet().isAcknowledged(); - return isAcknowledged; - - } - - protected Iterable getFilteredIndices(ImmutableOpenMap indices) { - - String[] returnedIndices = new String[indices.size()]; - Iterator it = indices.keysIt(); - System.arraycopy(IteratorUtils.toArray(it), 0, returnedIndices, 0, returnedIndices.length); - Iterable matches = Iterables.filter(Arrays.asList(returnedIndices), filterWithRegex); - - return matches; - - } - -} diff --git a/metron-platform/metron-data-management/src/main/java/org/apache/metron/dataloads/bulk/ElasticsearchDataPrunerRunner.java b/metron-platform/metron-data-management/src/main/java/org/apache/metron/dataloads/bulk/ElasticsearchDataPrunerRunner.java deleted file mode 100644 index 5d2f0f1ad2..0000000000 --- a/metron-platform/metron-data-management/src/main/java/org/apache/metron/dataloads/bulk/ElasticsearchDataPrunerRunner.java +++ /dev/null @@ -1,200 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ -package org.apache.metron.dataloads.bulk; - -import java.io.IOException; -import java.lang.invoke.MethodHandles; -import java.net.InetAddress; -import java.nio.file.Paths; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.Map; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.CommandLineParser; -import org.apache.commons.cli.HelpFormatter; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; -import org.apache.commons.cli.ParseException; -import org.apache.commons.cli.PosixParser; -import org.apache.curator.RetryPolicy; -import org.apache.curator.framework.CuratorFramework; -import org.apache.curator.framework.CuratorFrameworkFactory; -import org.apache.curator.retry.ExponentialBackoffRetry; -import org.apache.metron.common.configuration.Configuration; -import org.apache.metron.common.utils.ErrorUtils; -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.transport.InetSocketTransportAddress; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ElasticsearchDataPrunerRunner { - - private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - public static void main(String... argv) throws IOException, java.text.ParseException, ClassNotFoundException, InterruptedException { - - /** - * Example - * start=$(date -d '30 days ago' +%m/%d/%Y) - * yarn jar Metron-DataLoads-{VERSION}.jar org.apache.metron.dataloads.bulk.ElasticsearchDataPrunerRunner -i host1:9300 -p '/bro_index_' -s $(date -d '30 days ago' +%m/%d/%Y) -n 1; - * echo ${start} - **/ - - Options options = buildOptions(); - Options help = new Options(); - TransportClient client = null; - - Option o = new Option("h", "help", false, "This screen"); - o.setRequired(false); - help.addOption(o); - - - - try { - - CommandLine cmd = checkOptions(help,options, argv); - - String start = cmd.getOptionValue("s"); - Date startDate = new SimpleDateFormat("MM/dd/yyyy").parse(start); - - Integer numDays = Integer.parseInt(cmd.getOptionValue("n")); - String indexPrefix = cmd.getOptionValue("p"); - - LOG.debug("Running prune with args: {} {}", startDate, numDays); - - Configuration configuration = null; - - if( cmd.hasOption("z")){ - - RetryPolicy retryPolicy = new ExponentialBackoffRetry(1000, 3); - CuratorFramework framework = CuratorFrameworkFactory.newClient(cmd.getOptionValue("z"),retryPolicy); - framework.start(); - configuration = new Configuration(framework); - - } else if ( cmd.hasOption("c") ){ - - String resourceFile = cmd.getOptionValue("c"); - configuration = new Configuration(Paths.get(resourceFile)); - - } else { - ErrorUtils.RuntimeErrors.ILLEGAL_ARG.throwRuntime("Unable to finish setting up configuration - z or c option is required."); - } - - configuration.update(); - - Map globalConfiguration = configuration.getGlobalConfig(); - - Settings.Builder settingsBuilder = Settings.settingsBuilder(); - settingsBuilder.put("cluster.name", globalConfiguration.get("es.clustername")); - settingsBuilder.put("curatorFramework.transport.ping_timeout","500s"); - Settings settings = settingsBuilder.build(); - client = TransportClient.builder().settings(settings).build() - .addTransportAddress( - new InetSocketTransportAddress(InetAddress.getByName(globalConfiguration.get("es.ip").toString()), Integer.parseInt(globalConfiguration.get("es.port").toString()) ) - ); - - DataPruner pruner = new ElasticsearchDataPruner(startDate, numDays, configuration, client, indexPrefix); - - LOG.info("Pruned {} indices from {}:{}/{}", pruner.prune(), globalConfiguration.get("es.ip"), globalConfiguration.get("es.port"), indexPrefix); - } catch (Exception e) { - - e.printStackTrace(); - System.exit(-1); - - } finally { - - if( null != client) { - client.close(); - } - - } - - } - - public static CommandLine checkOptions(Options help, Options options, String ... argv) throws ParseException { - - CommandLine cmd = null; - CommandLineParser parser = new PosixParser(); - - - try { - - cmd = parser.parse(help,argv,true); - - if( cmd.getOptions().length > 0){ - final HelpFormatter usageFormatter = new HelpFormatter(); - usageFormatter.printHelp("ElasticsearchDataPrunerRunner", null, options, null, true); - System.exit(0); - } - - cmd = parser.parse(options, argv); - - } catch (ParseException e) { - - final HelpFormatter usageFormatter = new HelpFormatter(); - usageFormatter.printHelp("ElasticsearchDataPrunerRunner", null, options, null, true); - throw e; - - } - - - if( (cmd.hasOption("z") && cmd.hasOption("c")) || (!cmd.hasOption("z") && !cmd.hasOption("c")) ){ - - System.err.println("One (only) of zookeeper-hosts or config-location is required"); - final HelpFormatter usageFormatter = new HelpFormatter(); - usageFormatter.printHelp("ElasticsearchDataPrunerRunner", null, options, null, true); - throw new RuntimeException("Must specify zookeeper-hosts or config-location, but not both"); - - } - - return cmd; - } - - public static Options buildOptions(){ - - Options options = new Options(); - - Option o = new Option("s", "start-date", true, "Starting Date (MM/DD/YYYY)"); - o.setArgName("START_DATE"); - o.setRequired(true); - options.addOption(o); - - o = new Option("n", "numdays", true, "Number of days back to purge"); - o.setArgName("NUMDAYS"); - o.setRequired(true); - options.addOption(o); - - o = new Option("p", "index-prefix", true, "Index prefix - e.g. bro_index_"); - o.setArgName("PREFIX"); - o.setRequired(true); - options.addOption(o); - - o = new Option("c", "config-location", true, "Directory Path - e.g. /path/to/config/dir"); - o.setArgName("CONFIG"); - o.setRequired(false); - options.addOption(o); - - o = new Option("z", "zookeeper-hosts", true, "Zookeeper URL - e.g. zkhost1:2181,zkhost2:2181,zkhost3:2181"); - o.setArgName("PREFIX"); - o.setRequired(false); - options.addOption(o); - - return options; - } -} diff --git a/metron-platform/metron-data-management/src/main/scripts/prune_elasticsearch_indices.sh b/metron-platform/metron-data-management/src/main/scripts/prune_elasticsearch_indices.sh index c3f1d05f51..f891fa354a 100644 --- a/metron-platform/metron-data-management/src/main/scripts/prune_elasticsearch_indices.sh +++ b/metron-platform/metron-data-management/src/main/scripts/prune_elasticsearch_indices.sh @@ -17,5 +17,6 @@ # limitations under the License. # -yarn jar /usr/metron/${project.version}/lib/${project.artifactId}-${project.version}.jar org.apache.metron.dataloads.bulk.ElasticsearchDataPrunerRunner "$@" +echo "The Metron Elasticsearch data pruner has been deprecated in favor of the Curator framework." +echo "See https://www.elastic.co/guide/en/elasticsearch/client/curator/5.4/index.html" diff --git a/metron-platform/metron-data-management/src/test/java/org/apache/metron/dataloads/bulk/ElasticsearchDataPrunerRunnerTest.java b/metron-platform/metron-data-management/src/test/java/org/apache/metron/dataloads/bulk/ElasticsearchDataPrunerRunnerTest.java deleted file mode 100644 index 5f32bee53c..0000000000 --- a/metron-platform/metron-data-management/src/test/java/org/apache/metron/dataloads/bulk/ElasticsearchDataPrunerRunnerTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ -package org.apache.metron.dataloads.bulk; - -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; -import org.junit.Before; -import org.junit.Test; - -import java.io.ByteArrayOutputStream; -import java.io.FileDescriptor; -import java.io.FileOutputStream; -import java.io.PrintStream; - -public class ElasticsearchDataPrunerRunnerTest { - - private Options options; - private Options help; - - private ByteArrayOutputStream outContent; - private ByteArrayOutputStream errContent; - - @Before - public void setUp(){ - - options = ElasticsearchDataPrunerRunner.buildOptions(); - help = new Options(); - - Option o = new Option("h", "help", false, "This screen"); - o.setRequired(false); - help.addOption(o); - - outContent = new ByteArrayOutputStream(); - errContent = new ByteArrayOutputStream(); - - System.setOut(new PrintStream(outContent)); - System.setErr(new PrintStream(errContent)); - - } - - @Test(expected = RuntimeException.class) - public void testThrowsWithoutZookeeperOrConfigLocation() throws Exception { - - String[] args = new String[]{"-n","30","-p","sensor_index","-s","03/30/2016"}; - ElasticsearchDataPrunerRunner.checkOptions(help,options,args); - - } - - @Test(expected = RuntimeException.class) - public void testThrowsWithZookeeperAndConfiguration() throws Exception { - - String[] args = new String[]{"-n","30","-p","sensor_index","-s","03/30/2016"}; - ElasticsearchDataPrunerRunner.checkOptions(help,options,args); - - } - -} diff --git a/metron-platform/metron-data-management/src/test/java/org/apache/metron/dataloads/bulk/ElasticsearchDataPrunerTest.java b/metron-platform/metron-data-management/src/test/java/org/apache/metron/dataloads/bulk/ElasticsearchDataPrunerTest.java deleted file mode 100644 index df485f069d..0000000000 --- a/metron-platform/metron-data-management/src/test/java/org/apache/metron/dataloads/bulk/ElasticsearchDataPrunerTest.java +++ /dev/null @@ -1,855 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ -package org.apache.metron.dataloads.bulk; - -import com.carrotsearch.hppc.ObjectObjectHashMap; -import org.apache.commons.collections.IteratorUtils; -import org.apache.metron.TestConstants; -import org.apache.metron.common.configuration.Configuration; -import org.easymock.EasyMock; -import org.elasticsearch.action.*; -import org.elasticsearch.action.admin.cluster.state.ClusterStateRequestBuilder; -import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse; -import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest; -import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequestBuilder; -import org.elasticsearch.action.admin.indices.alias.IndicesAliasesResponse; -import org.elasticsearch.action.admin.indices.alias.exists.AliasesExistRequestBuilder; -import org.elasticsearch.action.admin.indices.alias.exists.AliasesExistResponse; -import org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequest; -import org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequestBuilder; -import org.elasticsearch.action.admin.indices.alias.get.GetAliasesResponse; -import org.elasticsearch.action.admin.indices.analyze.AnalyzeRequest; -import org.elasticsearch.action.admin.indices.analyze.AnalyzeRequestBuilder; -import org.elasticsearch.action.admin.indices.analyze.AnalyzeResponse; -import org.elasticsearch.action.admin.indices.cache.clear.ClearIndicesCacheRequest; -import org.elasticsearch.action.admin.indices.cache.clear.ClearIndicesCacheRequestBuilder; -import org.elasticsearch.action.admin.indices.cache.clear.ClearIndicesCacheResponse; -import org.elasticsearch.action.admin.indices.close.CloseIndexRequest; -import org.elasticsearch.action.admin.indices.close.CloseIndexRequestBuilder; -import org.elasticsearch.action.admin.indices.close.CloseIndexResponse; -import org.elasticsearch.action.admin.indices.create.CreateIndexRequest; -import org.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder; -import org.elasticsearch.action.admin.indices.create.CreateIndexResponse; -import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest; -import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequestBuilder; -import org.elasticsearch.action.admin.indices.delete.DeleteIndexResponse; -import org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsRequest; -import org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsRequestBuilder; -import org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsResponse; -import org.elasticsearch.action.admin.indices.exists.types.TypesExistsRequest; -import org.elasticsearch.action.admin.indices.exists.types.TypesExistsRequestBuilder; -import org.elasticsearch.action.admin.indices.exists.types.TypesExistsResponse; -import org.elasticsearch.action.admin.indices.flush.*; -import org.elasticsearch.action.admin.indices.forcemerge.ForceMergeRequest; -import org.elasticsearch.action.admin.indices.forcemerge.ForceMergeRequestBuilder; -import org.elasticsearch.action.admin.indices.forcemerge.ForceMergeResponse; -import org.elasticsearch.action.admin.indices.get.GetIndexRequest; -import org.elasticsearch.action.admin.indices.get.GetIndexRequestBuilder; -import org.elasticsearch.action.admin.indices.get.GetIndexResponse; -import org.elasticsearch.action.admin.indices.mapping.get.*; -import org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest; -import org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequestBuilder; -import org.elasticsearch.action.admin.indices.mapping.put.PutMappingResponse; -import org.elasticsearch.action.admin.indices.open.OpenIndexRequest; -import org.elasticsearch.action.admin.indices.open.OpenIndexRequestBuilder; -import org.elasticsearch.action.admin.indices.open.OpenIndexResponse; -import org.elasticsearch.action.admin.indices.recovery.RecoveryRequest; -import org.elasticsearch.action.admin.indices.recovery.RecoveryRequestBuilder; -import org.elasticsearch.action.admin.indices.recovery.RecoveryResponse; -import org.elasticsearch.action.admin.indices.refresh.RefreshRequest; -import org.elasticsearch.action.admin.indices.refresh.RefreshRequestBuilder; -import org.elasticsearch.action.admin.indices.refresh.RefreshResponse; -import org.elasticsearch.action.admin.indices.segments.IndicesSegmentResponse; -import org.elasticsearch.action.admin.indices.segments.IndicesSegmentsRequest; -import org.elasticsearch.action.admin.indices.segments.IndicesSegmentsRequestBuilder; -import org.elasticsearch.action.admin.indices.settings.get.GetSettingsRequest; -import org.elasticsearch.action.admin.indices.settings.get.GetSettingsRequestBuilder; -import org.elasticsearch.action.admin.indices.settings.get.GetSettingsResponse; -import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequest; -import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequestBuilder; -import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsResponse; -import org.elasticsearch.action.admin.indices.shards.IndicesShardStoreRequestBuilder; -import org.elasticsearch.action.admin.indices.shards.IndicesShardStoresRequest; -import org.elasticsearch.action.admin.indices.shards.IndicesShardStoresResponse; -import org.elasticsearch.action.admin.indices.stats.IndicesStatsRequest; -import org.elasticsearch.action.admin.indices.stats.IndicesStatsRequestBuilder; -import org.elasticsearch.action.admin.indices.stats.IndicesStatsResponse; -import org.elasticsearch.action.admin.indices.template.delete.DeleteIndexTemplateRequest; -import org.elasticsearch.action.admin.indices.template.delete.DeleteIndexTemplateRequestBuilder; -import org.elasticsearch.action.admin.indices.template.delete.DeleteIndexTemplateResponse; -import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesRequest; -import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesRequestBuilder; -import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesResponse; -import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateRequest; -import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateRequestBuilder; -import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateResponse; -import org.elasticsearch.action.admin.indices.upgrade.get.UpgradeStatusRequest; -import org.elasticsearch.action.admin.indices.upgrade.get.UpgradeStatusRequestBuilder; -import org.elasticsearch.action.admin.indices.upgrade.get.UpgradeStatusResponse; -import org.elasticsearch.action.admin.indices.upgrade.post.UpgradeRequest; -import org.elasticsearch.action.admin.indices.upgrade.post.UpgradeRequestBuilder; -import org.elasticsearch.action.admin.indices.upgrade.post.UpgradeResponse; -import org.elasticsearch.action.admin.indices.validate.query.ValidateQueryRequest; -import org.elasticsearch.action.admin.indices.validate.query.ValidateQueryRequestBuilder; -import org.elasticsearch.action.admin.indices.validate.query.ValidateQueryResponse; -import org.elasticsearch.action.admin.indices.warmer.delete.DeleteWarmerRequest; -import org.elasticsearch.action.admin.indices.warmer.delete.DeleteWarmerRequestBuilder; -import org.elasticsearch.action.admin.indices.warmer.delete.DeleteWarmerResponse; -import org.elasticsearch.action.admin.indices.warmer.get.GetWarmersRequest; -import org.elasticsearch.action.admin.indices.warmer.get.GetWarmersRequestBuilder; -import org.elasticsearch.action.admin.indices.warmer.get.GetWarmersResponse; -import org.elasticsearch.action.admin.indices.warmer.put.PutWarmerRequest; -import org.elasticsearch.action.admin.indices.warmer.put.PutWarmerRequestBuilder; -import org.elasticsearch.action.admin.indices.warmer.put.PutWarmerResponse; -import org.elasticsearch.client.AdminClient; -import org.elasticsearch.client.Client; -import org.elasticsearch.client.ClusterAdminClient; -import org.elasticsearch.client.IndicesAdminClient; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.metadata.IndexMetaData; -import org.elasticsearch.cluster.metadata.MetaData; -import org.elasticsearch.common.Nullable; -import org.elasticsearch.common.collect.ImmutableOpenMap; -import org.elasticsearch.index.IndexNotFoundException; -import org.elasticsearch.threadpool.ThreadPool; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.powermock.api.easymock.PowerMock; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.PowerMockRunner; - -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.PrintStream; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Arrays; -import java.util.Calendar; -import java.util.Date; -import java.util.concurrent.TimeUnit; - -import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; -import static org.powermock.api.easymock.PowerMock.replayAll; -import static org.powermock.api.easymock.PowerMock.verifyAll; - -@RunWith(PowerMockRunner.class) -@PrepareForTest(DeleteIndexResponse.class) -public class ElasticsearchDataPrunerTest { - - private Date testDate; - private DateFormat dateFormat = new SimpleDateFormat("yyyy.MM.dd.HH"); - private Configuration configuration; - - private Client indexClient = mock(Client.class); - private AdminClient adminClient = mock(AdminClient.class); - private IndicesAdminClient indicesAdminClient = new TestIndicesAdminClient(); - private DeleteIndexRequestBuilder deleteIndexRequestBuilder = mock(DeleteIndexRequestBuilder.class); - private DeleteIndexRequest deleteIndexRequest = mock(DeleteIndexRequest.class); - private ActionFuture deleteIndexAction = mock(ActionFuture.class); - private DeleteIndexResponse deleteIndexResponse = PowerMock.createMock(DeleteIndexResponse.class); - - - private ByteArrayOutputStream outContent; - private ByteArrayOutputStream errContent; - - @Before - public void setUp() throws Exception { - - Calendar calendar = Calendar.getInstance(); - calendar.set(Calendar.MONTH, Calendar.MARCH); - calendar.set(Calendar.YEAR, 2016); - calendar.set(Calendar.DATE, 31); - calendar.set(Calendar.HOUR_OF_DAY, 0); - calendar.set(Calendar.MINUTE, 0); - calendar.set(Calendar.SECOND, 0); - calendar.set(Calendar.MILLISECOND,0); - testDate = calendar.getTime(); - - when(indexClient.admin()).thenReturn(adminClient); - when(adminClient.indices()).thenReturn(indicesAdminClient); - when(deleteIndexRequestBuilder.request()).thenReturn(deleteIndexRequest); - when(deleteIndexAction.actionGet()).thenReturn(deleteIndexResponse); - - File resourceFile = new File(TestConstants.SAMPLE_CONFIG_PATH); - Path resourcePath = Paths.get(resourceFile.getCanonicalPath()); - - configuration = new Configuration(resourcePath); - - outContent = new ByteArrayOutputStream(); - errContent = new ByteArrayOutputStream(); - - System.setOut(new PrintStream(outContent)); - System.setErr(new PrintStream(errContent)); - - } - - @Test(expected = IndexNotFoundException.class) - public void testWillThrowOnMissingIndex() throws Exception { - - ((TestIndicesAdminClient)indicesAdminClient).throwMissingIndex = true; - ElasticsearchDataPruner pruner = new ElasticsearchDataPruner(testDate, 30, configuration, indexClient,"*"); - pruner.deleteIndex(adminClient, "baz"); - ((TestIndicesAdminClient)indicesAdminClient).throwMissingIndex = false; - - } - - @Test - public void testDeletesCorrectIndexes() throws Exception { - - //Mock Cluster Admin - ClusterAdminClient clusterAdminClient = mock(ClusterAdminClient.class); - ClusterStateRequestBuilder clusterStateRequestBuilder = mock(ClusterStateRequestBuilder.class); - ClusterStateResponse clusterStateResponse = mock(ClusterStateResponse.class); - ClusterState clusterState = mock(ClusterState.class); - ObjectObjectHashMap clusterIndexes = new ObjectObjectHashMap(); - MetaData clusterMetadata = mock(MetaData.class); - when(adminClient.cluster()).thenReturn(clusterAdminClient); - when(clusterAdminClient.prepareState()).thenReturn(clusterStateRequestBuilder); - when(clusterStateRequestBuilder.get()).thenReturn(clusterStateResponse); - when(clusterStateResponse.getState()).thenReturn(clusterState); - when(clusterState.getMetaData()).thenReturn(clusterMetadata); - - int numDays = 5; - - Date indexDate = new Date(); - - indexDate.setTime(testDate.getTime() - TimeUnit.DAYS.toMillis(numDays)); - - for (int i = 0; i < numDays * 24; i++) { - - String indexName = "sensor_index_" + dateFormat.format(indexDate); - clusterIndexes.put(indexName, null); - indexDate.setTime(indexDate.getTime() + TimeUnit.HOURS.toMillis(1)); - - } - - when(clusterMetadata.getIndices()).thenReturn(ImmutableOpenMap.copyOf(clusterIndexes)); - - - EasyMock.expect(deleteIndexResponse.isAcknowledged()).andReturn(true); - - replayAll(); - ElasticsearchDataPruner pruner = new ElasticsearchDataPruner(testDate, 1, configuration, indexClient, "sensor_index_"); - pruner.indexClient = indexClient; - Long deleteCount = pruner.prune(); - assertEquals("Should have pruned 24 indices", 24L, deleteCount.longValue()); - verifyAll(); - - } - - @Test - public void testFilter() throws Exception { - - ObjectObjectHashMap indexNames = new ObjectObjectHashMap(); - SimpleDateFormat dateChecker = new SimpleDateFormat("yyyyMMdd"); - int numDays = 5; - String[] expectedIndices = new String[24]; - Date indexDate = new Date(); - - indexDate.setTime(testDate.getTime() - TimeUnit.DAYS.toMillis(numDays)); - - for (int i = 0, j=0; i < numDays * 24; i++) { - - String indexName = "sensor_index_" + dateFormat.format(indexDate); - //Delete 20160330 - if( dateChecker.format(indexDate).equals("20160330") ){ - expectedIndices[j++] = indexName; - } - - indexNames.put(indexName, null); - indexDate.setTime(indexDate.getTime() + TimeUnit.HOURS.toMillis(1)); - - } - - ImmutableOpenMap testIndices = ImmutableOpenMap.copyOf(indexNames); - - ElasticsearchDataPruner pruner = new ElasticsearchDataPruner(testDate, 1, configuration, indexClient, "sensor_index_"); - pruner.indexClient = indexClient; - - Iterable filteredIndices = pruner.getFilteredIndices(testIndices); - - Object[] indexArray = IteratorUtils.toArray(filteredIndices.iterator()); - Arrays.sort(indexArray); - Arrays.sort(expectedIndices); - - assertArrayEquals(expectedIndices,indexArray); - - } - - class TestIndicesAdminClient implements IndicesAdminClient { - - public boolean throwMissingIndex = false; - - @Override - public ActionFuture delete(DeleteIndexRequest request) { - - if(throwMissingIndex){ - - throw new IndexNotFoundException("TEST EXCEPTION!"); - - } - - return deleteIndexAction; - - } - - - @Override - public ActionFuture exists(IndicesExistsRequest request) { - return null; - } - - @Override - public void exists(IndicesExistsRequest request, ActionListener listener) { - - } - - @Override - public IndicesExistsRequestBuilder prepareExists(String... indices) { - return null; - } - - @Override - public ActionFuture typesExists(TypesExistsRequest request) { - return null; - } - - @Override - public void typesExists(TypesExistsRequest request, ActionListener listener) { - - } - - @Override - public TypesExistsRequestBuilder prepareTypesExists(String... index) { - return null; - } - - @Override - public ActionFuture stats(IndicesStatsRequest request) { - return null; - } - - @Override - public void stats(IndicesStatsRequest request, ActionListener listener) { - - } - - @Override - public IndicesStatsRequestBuilder prepareStats(String... indices) { - return null; - } - - @Override - public ActionFuture recoveries(RecoveryRequest request) { - return null; - } - - @Override - public void recoveries(RecoveryRequest request, ActionListener listener) { - - } - - @Override - public RecoveryRequestBuilder prepareRecoveries(String... indices) { - return null; - } - - @Override - public ActionFuture segments(IndicesSegmentsRequest request) { - return null; - } - - @Override - public void segments(IndicesSegmentsRequest request, ActionListener listener) { - - } - - @Override - public IndicesSegmentsRequestBuilder prepareSegments(String... indices) { - return null; - } - - @Override - public ActionFuture shardStores(IndicesShardStoresRequest request) { - return null; - } - - @Override - public void shardStores(IndicesShardStoresRequest request, ActionListener listener) { - - } - - @Override - public IndicesShardStoreRequestBuilder prepareShardStores(String... indices) { - return null; - } - - @Override - public ActionFuture create(CreateIndexRequest request) { - return null; - } - - @Override - public void create(CreateIndexRequest request, ActionListener listener) { - - } - - @Override - public CreateIndexRequestBuilder prepareCreate(String index) { - return null; - } - - - @Override - public void delete(DeleteIndexRequest request, ActionListener listener) { - - } - - @Override - public DeleteIndexRequestBuilder prepareDelete(String... indices) { - return deleteIndexRequestBuilder; - } - - @Override - public ActionFuture close(CloseIndexRequest request) { - return null; - } - - @Override - public void close(CloseIndexRequest request, ActionListener listener) { - - } - - @Override - public CloseIndexRequestBuilder prepareClose(String... indices) { - return null; - } - - @Override - public ActionFuture open(OpenIndexRequest request) { - return null; - } - - @Override - public void open(OpenIndexRequest request, ActionListener listener) { - - } - - @Override - public OpenIndexRequestBuilder prepareOpen(String... indices) { - return null; - } - - @Override - public ActionFuture refresh(RefreshRequest request) { - return null; - } - - @Override - public void refresh(RefreshRequest request, ActionListener listener) { - - } - - @Override - public RefreshRequestBuilder prepareRefresh(String... indices) { - return null; - } - - @Override - public ActionFuture flush(FlushRequest request) { - return null; - } - - @Override - public void flush(FlushRequest request, ActionListener listener) { - - } - - @Override - public FlushRequestBuilder prepareFlush(String... indices) { - return null; - } - - @Override - public ActionFuture syncedFlush(SyncedFlushRequest request) { - return null; - } - - @Override - public void syncedFlush(SyncedFlushRequest request, ActionListener listener) { - - } - - @Override - public SyncedFlushRequestBuilder prepareSyncedFlush(String... indices) { - return null; - } - - @Override - public ActionFuture forceMerge(ForceMergeRequest request) { - return null; - } - - @Override - public void forceMerge(ForceMergeRequest request, ActionListener listener) { - - } - - @Override - public ForceMergeRequestBuilder prepareForceMerge(String... indices) { - return null; - } - - @Override - public ActionFuture upgrade(UpgradeRequest request) { - return null; - } - - @Override - public void upgrade(UpgradeRequest request, ActionListener listener) { - - } - - @Override - public UpgradeStatusRequestBuilder prepareUpgradeStatus(String... indices) { - return null; - } - - @Override - public ActionFuture upgradeStatus(UpgradeStatusRequest request) { - return null; - } - - @Override - public void upgradeStatus(UpgradeStatusRequest request, ActionListener listener) { - - } - - @Override - public UpgradeRequestBuilder prepareUpgrade(String... indices) { - return null; - } - - @Override - public void getMappings(GetMappingsRequest request, ActionListener listener) { - - } - - @Override - public ActionFuture getMappings(GetMappingsRequest request) { - return null; - } - - @Override - public GetMappingsRequestBuilder prepareGetMappings(String... indices) { - return null; - } - - @Override - public void getFieldMappings(GetFieldMappingsRequest request, ActionListener listener) { - - } - - @Override - public GetFieldMappingsRequestBuilder prepareGetFieldMappings(String... indices) { - return null; - } - - @Override - public ActionFuture getFieldMappings(GetFieldMappingsRequest request) { - return null; - } - - @Override - public ActionFuture putMapping(PutMappingRequest request) { - return null; - } - - @Override - public void putMapping(PutMappingRequest request, ActionListener listener) { - - } - - @Override - public PutMappingRequestBuilder preparePutMapping(String... indices) { - return null; - } - - @Override - public ActionFuture aliases(IndicesAliasesRequest request) { - return null; - } - - @Override - public void aliases(IndicesAliasesRequest request, ActionListener listener) { - - } - - @Override - public IndicesAliasesRequestBuilder prepareAliases() { - return null; - } - - @Override - public ActionFuture getAliases(GetAliasesRequest request) { - return null; - } - - @Override - public void getAliases(GetAliasesRequest request, ActionListener listener) { - - } - - @Override - public GetAliasesRequestBuilder prepareGetAliases(String... aliases) { - return null; - } - - @Override - public AliasesExistRequestBuilder prepareAliasesExist(String... aliases) { - return null; - } - - @Override - public ActionFuture aliasesExist(GetAliasesRequest request) { - return null; - } - - @Override - public void aliasesExist(GetAliasesRequest request, ActionListener listener) { - - } - - @Override - public ActionFuture getIndex(GetIndexRequest request) { - return null; - } - - @Override - public void getIndex(GetIndexRequest request, ActionListener listener) { - - } - - @Override - public GetIndexRequestBuilder prepareGetIndex() { - return null; - } - - @Override - public ActionFuture clearCache(ClearIndicesCacheRequest request) { - return null; - } - - @Override - public void clearCache(ClearIndicesCacheRequest request, ActionListener listener) { - - } - - @Override - public ClearIndicesCacheRequestBuilder prepareClearCache(String... indices) { - return null; - } - - @Override - public ActionFuture updateSettings(UpdateSettingsRequest request) { - return null; - } - - @Override - public void updateSettings(UpdateSettingsRequest request, ActionListener listener) { - - } - - @Override - public UpdateSettingsRequestBuilder prepareUpdateSettings(String... indices) { - return null; - } - - @Override - public ActionFuture analyze(AnalyzeRequest request) { - return null; - } - - @Override - public void analyze(AnalyzeRequest request, ActionListener listener) { - - } - - @Override - public AnalyzeRequestBuilder prepareAnalyze(@Nullable String index, String text) { - return null; - } - - @Override - public AnalyzeRequestBuilder prepareAnalyze(String text) { - return null; - } - - @Override - public AnalyzeRequestBuilder prepareAnalyze() { - return null; - } - - @Override - public ActionFuture putTemplate(PutIndexTemplateRequest request) { - return null; - } - - @Override - public void putTemplate(PutIndexTemplateRequest request, ActionListener listener) { - - } - - @Override - public PutIndexTemplateRequestBuilder preparePutTemplate(String name) { - return null; - } - - @Override - public ActionFuture deleteTemplate(DeleteIndexTemplateRequest request) { - return null; - } - - @Override - public void deleteTemplate(DeleteIndexTemplateRequest request, ActionListener listener) { - - } - - @Override - public DeleteIndexTemplateRequestBuilder prepareDeleteTemplate(String name) { - return null; - } - - @Override - public ActionFuture getTemplates(GetIndexTemplatesRequest request) { - return null; - } - - @Override - public void getTemplates(GetIndexTemplatesRequest request, ActionListener listener) { - - } - - @Override - public GetIndexTemplatesRequestBuilder prepareGetTemplates(String... name) { - return null; - } - - @Override - public ActionFuture validateQuery(ValidateQueryRequest request) { - return null; - } - - @Override - public void validateQuery(ValidateQueryRequest request, ActionListener listener) { - - } - - @Override - public ValidateQueryRequestBuilder prepareValidateQuery(String... indices) { - return null; - } - - @Override - public ActionFuture putWarmer(PutWarmerRequest request) { - return null; - } - - @Override - public void putWarmer(PutWarmerRequest request, ActionListener listener) { - - } - - @Override - public PutWarmerRequestBuilder preparePutWarmer(String name) { - return null; - } - - @Override - public ActionFuture deleteWarmer(DeleteWarmerRequest request) { - return null; - } - - @Override - public void deleteWarmer(DeleteWarmerRequest request, ActionListener listener) { - - } - - @Override - public DeleteWarmerRequestBuilder prepareDeleteWarmer() { - return null; - } - - @Override - public void getWarmers(GetWarmersRequest request, ActionListener listener) { - - } - - @Override - public ActionFuture getWarmers(GetWarmersRequest request) { - return null; - } - - @Override - public GetWarmersRequestBuilder prepareGetWarmers(String... indices) { - return null; - } - - @Override - public void getSettings(GetSettingsRequest request, ActionListener listener) { - - } - - @Override - public ActionFuture getSettings(GetSettingsRequest request) { - return null; - } - - @Override - public GetSettingsRequestBuilder prepareGetSettings(String... indices) { - return null; - } - - @Override - public > ActionFuture execute(Action action, Request request) { - return null; - } - - @Override - public > void execute(Action action, Request request, ActionListener listener) { - - } - - @Override - public > RequestBuilder prepareExecute(Action action) { - return null; - } - - @Override - public ThreadPool threadPool() { - return null; - } - } - -} diff --git a/metron-platform/metron-elasticsearch/README.md b/metron-platform/metron-elasticsearch/README.md index 7278a25b33..1e150181d3 100644 --- a/metron-platform/metron-elasticsearch/README.md +++ b/metron-platform/metron-elasticsearch/README.md @@ -17,6 +17,15 @@ limitations under the License. --> # Elasticsearch in Metron +## Table of Contents + +* [Introduction](#introduction) +* [Properties](#properties) +* [Upgrading to 5.6.2](#upgrading-to-562) +* [Type Mappings](#type-mappings) +* [Using Metron with Elasticsearch 5.6.2](#using-metron-with-elasticsearch-562) +* [Installing Elasticsearch Templates](#installing-elasticsearch-templates) + ## Introduction Elasticsearch can be used as the real-time portion of the datastore resulting from [metron-indexing](../metron-indexing/README.md). @@ -50,9 +59,219 @@ For instance, an `es.date.format` of `yyyy.MM.dd.HH` would have the consequence roll hourly, whereas an `es.date.format` of `yyyy.MM.dd` would have the consequence that the indices would roll daily. -## Using Metron with Elasticsearch 2.x +## Upgrading to 5.6.2 + +Users should be prepared to re-index when migrating from Elasticsearch 2.3.3 to 5.6.2. There are a number of template changes, most notably around +string type handling, that may cause issues when upgrading. + +[https://www.elastic.co/guide/en/elasticsearch/reference/5.6/setup-upgrade.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/setup-upgrade.html) + +Be aware that if you add a new string value and want to be able to filter and search on this value from the Alerts UI, you **must** add a mapping for that type to +the appropriate Elasticsearch template. Below is more detail on how to choose the appropriate mapping type for your string value. + +## Type Mappings + +Type mappings have changed quite a bit from ES 2.x -> 5.x. Here is a brief rundown of the biggest changes. More detailed references from Elasticsearch +are provided in the [Type Mapping References](#type-mapping-references) section below. +* string fields replaced by text/keyword type +* strings have new default mappings as follows + + ``` + { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + } + ``` + +* There is no longer a `_timestamp` field that you can set "enabled" on. This field now causes an exception on templates. +Replace with an application-created timestamp of "date" type. + +The semantics for string types have changed. In 2.x, you have the concept of index settings as either "analyzed" or "not_analyzed" which basically means "full text" and "keyword", respectively. +Analyzed text basically means the indexer will split the text using a text analyzer thus allowing you to search on substrings within the original text. "New York" is split and indexed as two buckets, + "New" and "York", so you can search or query for aggregate counts for those terms independently and will match against the individual terms "New" or "York." "Keyword" means that the original text + will not be split/analyzed during indexing and instead treated as a whole unit, i.e. "New" or "York" will not match in searches against the document containing "New York", but searching on "New York" + as the full city name will. In 5.x language instead of using the "index" setting, you now set the "type" to either "text" for full text, or "keyword" for keywords. + +Below is a table depicting the changes to how String types are now handled. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
sort, aggregate, or access valuesES 2.xES 5.xExample
no +
"my_property" : {
+  "type": "string",
+  "index": "analyzed"
+}
+
+
+
"my_property" : {
+  "type": "text"
+}
+
+ Additional defaults: "index": "true", "fielddata": "false" +
+ "New York" handled via in-mem search as "New" and "York" buckets. No aggregation or sort. +
+ yes + +
"my_property": {
+  "type": "string",
+  "index": "analyzed"
+}
+
+
+
"my_property": {
+  "type": "text",
+  "fielddata": "true"
+}
+
+
+ "New York" handled via in-mem search as "New" and "York" buckets. Can aggregate and sort. +
+ yes + +
"my_property": {
+  "type": "string",
+  "index": "not_analyzed"
+}
+
+
+
"my_property" : {
+  "type": "keyword"
+}
+
+
+ "New York" searchable as single value. Can aggregate and sort. A search for "New" or "York" will not match against the whole value. +
+ yes + +
"my_property": {
+  "type": "string",
+  "index": "analyzed"
+}
+
+
+
"my_property": {
+  "type": "text",
+  "fields": {
+    "keyword": {
+      "type": "keyword",
+      "ignore_above": 256
+    }
+  }
+}
+
+
+ "New York" searchable as single value or as text document, can aggregate and sort on the sub term "keyword." +
-With Elasticsearch 2.x, there is a requirement that all sensors templates have a nested alert field defined. This field is a dummy field, and will be obsolete in Elasticsearch 5.x. See [Ignoring Unmapped Fields](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-sort.html#_ignoring_unmapped_fields) for more information +If you want to set default string behavior for all strings for a given index and type, you can do so with a mapping similar to the following (replace ${your_type_here} accordingly): + +``` +# curl -XPUT 'http://${ES_HOST}:${ES_PORT}/_template/default_string_template' -d ' +{ + "template": "*", + "mappings" : { + "${your_type_here}": { + "dynamic_templates": [ + { + "strings": { + "match_mapping_type": "string", + "mapping": { + "type": "text" + } + } + } + ] + } + } +} +' +``` + +By specifying the "template" property with value "*" the template will apply to all indexes that have documents indexed of the specified type (${your_type_here}). This results in the following template. + +``` +# curl -XGET 'http://${ES_HOST}:${ES_PORT}/_template/default_string_template?pretty' +{ + "default_string_template" : { + "order" : 0, + "template" : "*", + "settings" : { }, + "mappings" : { + "${your_type_here}" : { + "dynamic_templates" : [ + { + "strings" : { + "match_mapping_type" : "string", + "mapping" : { + "type" : "text" + } + } + } + ] + } + }, + "aliases" : { } + } +} +``` + +Notes on other settings for types in ES +* doc_values + * on-disk data structure + * provides access for sorting, aggregation, and field values + * stores same values as _source, but in column-oriented fashion better for sorting and aggregating + * not supported on text fields + * enabled by default +* fielddata + * in-memory data structure + * provides access for sorting, aggregation, and field values + * primarily for text fields + * disabled by default because the heap space required can be large + + +##### Type Mapping References +* [https://www.elastic.co/guide/en/elasticsearch/reference/5.6/mapping.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/mapping.html) +* [https://www.elastic.co/guide/en/elasticsearch/reference/5.6/breaking_50_mapping_changes.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/breaking_50_mapping_changes.html) +* [https://www.elastic.co/blog/strings-are-dead-long-live-strings](https://www.elastic.co/blog/strings-are-dead-long-live-strings) + +## Using Metron with Elasticsearch 5.6.2 + +There is a requirement that all sensors templates have a nested alert field defined. This field is a dummy field. See [Ignoring Unmapped Fields](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-sort.html#_ignoring_unmapped_fields) for more information Without this field, an error will be thrown during ALL searches (including from UIs, resulting in no alerts being found for any sensor). This error will be found in the REST service's logs. @@ -63,7 +282,7 @@ QueryParsingException[[nested] failed to find nested object under path [alert]]; There are two steps to resolve this issue. First is to update the Elasticsearch template for each sensor, so any new indices have the field. This requires retrieving the template, removing an extraneous JSON field so we can put it back later, and adding our new field. -Make sure to set the ELASTICSEARCH variable appropriately. $SENSOR can contain wildcards, so if rollover has occurred, it's not necessary to do each index individually. The example here appends `index*` to get all indexes for a the provided sensor. +Make sure to set the ELASTICSEARCH variable appropriately. $SENSOR can contain wildcards, so if rollover has occurred, it's not necessary to do each index individually. The example here appends `index*` to get all indexes for the provided sensor. ``` export ELASTICSEARCH="node1" @@ -89,11 +308,11 @@ To update existing indexes, update Elasticsearch mappings with the new field for ``` curl -XPUT "http://${ELASTICSEARCH}:9200/${SENSOR}_index*/_mapping/${SENSOR}_doc" -d ' { - "properties" : { - "alert" : { - "type" : "nested" - } - } + "properties" : { + "alert" : { + "type" : "nested" + } + } } ' rm ${SENSOR}.template diff --git a/metron-platform/metron-elasticsearch/pom.xml b/metron-platform/metron-elasticsearch/pom.xml index d924891054..97f4062aed 100644 --- a/metron-platform/metron-elasticsearch/pom.xml +++ b/metron-platform/metron-elasticsearch/pom.xml @@ -175,9 +175,15 @@
+ + org.hamcrest + hamcrest-core + 1.3 + test + org.mockito - mockito-all + mockito-core ${global_mockito_version} test @@ -200,6 +206,16 @@ test-jar test + + org.apache.logging.log4j + log4j-api + ${global_log4j_core_version} + + + org.apache.logging.log4j + log4j-core + ${global_log4j_core_version} + diff --git a/metron-platform/metron-elasticsearch/src/main/java/org/apache/metron/elasticsearch/bulk/ElasticsearchImportExport.java b/metron-platform/metron-elasticsearch/src/main/java/org/apache/metron/elasticsearch/bulk/ElasticsearchImportExport.java new file mode 100644 index 0000000000..0a04dfc724 --- /dev/null +++ b/metron-platform/metron-elasticsearch/src/main/java/org/apache/metron/elasticsearch/bulk/ElasticsearchImportExport.java @@ -0,0 +1,93 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +package org.apache.metron.elasticsearch.bulk; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import org.apache.metron.common.utils.JSONUtils; + +/** + * This is a utility for taking a file of JSON objects that were exported from ES and transforming + * it into a bulk import format. This was useful for backing up and restoring the Kibana dashboard + * index. The notable gap is that it expects one record per line in the file, which is not how + * ES generally returns results. Elasticsearch-dump was used as the intermediary to export data in + * the desired format for consumption by this tool. + * @see https://github.com/taskrabbit/elasticsearch-dump + */ +public class ElasticsearchImportExport { + + public static void main(String[] args) { + if (args.length != 2) { + throw new RuntimeException("Expects 'input' and 'output' file arguments."); + } + final String inPath = args[0]; + final String outPath = args[1]; + try { + new ElasticsearchImportExport().bulkify(Paths.get(inPath), Paths.get(outPath)); + } catch (IOException e) { + e.printStackTrace(); + System.exit(1); + } + System.exit(0); + } + + /** + * Takes a file of line-delimited JSON objects and converts them to an Elasticsearch bulk import + * format. + * + * @param input input JSON file (note, each line is expected to be a separate complete JSON + * object, not the file as a whole.) + * @param output Elasticsearch bulk import file. + * @throws IOException + */ + public void bulkify(Path input, Path output) throws IOException { + List outRecs = new ArrayList(); + try (BufferedReader br = new BufferedReader(new FileReader(input.toFile()))) { + String line; + while ((line = br.readLine()) != null) { + Map inDoc = JSONUtils.INSTANCE + .load(line, new TypeReference>() { + }); + Object id = inDoc.get("_id"); + Object type = inDoc.get("_type"); + String createRaw = String + .format("{ \"create\" : { \"_id\": \"%s\", \"_type\": \"%s\" } }", id, type); + String outData = JSONUtils.INSTANCE.toJSON(inDoc.get("_source"), false); + outRecs.add(createRaw); + outRecs.add(outData); + } + } + try (BufferedWriter br = new BufferedWriter(new FileWriter(output.toFile()))) { + for (String line : outRecs) { + br.write(line); + br.write(System.lineSeparator()); + } + } + } + +} diff --git a/metron-platform/metron-elasticsearch/src/main/java/org/apache/metron/elasticsearch/dao/ElasticsearchColumnMetadataDao.java b/metron-platform/metron-elasticsearch/src/main/java/org/apache/metron/elasticsearch/dao/ElasticsearchColumnMetadataDao.java index 9f219948b0..c12802e3c9 100644 --- a/metron-platform/metron-elasticsearch/src/main/java/org/apache/metron/elasticsearch/dao/ElasticsearchColumnMetadataDao.java +++ b/metron-platform/metron-elasticsearch/src/main/java/org/apache/metron/elasticsearch/dao/ElasticsearchColumnMetadataDao.java @@ -48,7 +48,8 @@ public class ElasticsearchColumnMetadataDao implements ColumnMetadataDao { private static Map elasticsearchTypeMap; static { Map fieldTypeMap = new HashMap<>(); - fieldTypeMap.put("string", FieldType.STRING); + fieldTypeMap.put("text", FieldType.TEXT); + fieldTypeMap.put("keyword", FieldType.KEYWORD); fieldTypeMap.put("ip", FieldType.IP); fieldTypeMap.put("integer", FieldType.INTEGER); fieldTypeMap.put("long", FieldType.LONG); diff --git a/metron-platform/metron-elasticsearch/src/main/java/org/apache/metron/elasticsearch/dao/ElasticsearchDao.java b/metron-platform/metron-elasticsearch/src/main/java/org/apache/metron/elasticsearch/dao/ElasticsearchDao.java index 910c09bf1e..650462e5d7 100644 --- a/metron-platform/metron-elasticsearch/src/main/java/org/apache/metron/elasticsearch/dao/ElasticsearchDao.java +++ b/metron-platform/metron-elasticsearch/src/main/java/org/apache/metron/elasticsearch/dao/ElasticsearchDao.java @@ -37,27 +37,32 @@ import org.apache.metron.indexing.dao.search.SortField; import org.apache.metron.indexing.dao.search.SortOrder; import org.apache.metron.indexing.dao.update.Document; -import org.elasticsearch.action.ActionWriteResponse.ShardInfo; +import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsRequest; import org.elasticsearch.action.bulk.BulkRequestBuilder; import org.elasticsearch.action.bulk.BulkResponse; import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.index.IndexResponse; import org.elasticsearch.action.search.SearchRequestBuilder; +import org.elasticsearch.action.support.replication.ReplicationResponse.ShardInfo; import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.index.mapper.ip.IpFieldMapper; +import org.elasticsearch.cluster.metadata.MappingMetaData; +import org.elasticsearch.common.collect.ImmutableOpenMap; +import org.elasticsearch.index.mapper.LegacyIpFieldMapper; +import org.elasticsearch.index.query.IdsQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.QueryStringQueryBuilder; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchHits; import org.elasticsearch.search.aggregations.Aggregation; +import org.elasticsearch.search.aggregations.AggregationBuilders; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.bucket.terms.Terms; import org.elasticsearch.search.aggregations.bucket.terms.Terms.Bucket; import org.elasticsearch.search.aggregations.bucket.terms.Terms.Order; -import org.elasticsearch.search.aggregations.bucket.terms.TermsBuilder; +import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder; import org.elasticsearch.search.aggregations.metrics.sum.Sum; -import org.elasticsearch.search.aggregations.metrics.sum.SumBuilder; +import org.elasticsearch.search.aggregations.metrics.sum.SumAggregationBuilder; import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.search.sort.FieldSortBuilder; import org.slf4j.Logger; @@ -124,8 +129,27 @@ public ElasticsearchDao() { //uninitialized. } + private static Map elasticsearchSearchTypeMap; + + static { + Map fieldTypeMap = new HashMap<>(); + fieldTypeMap.put("text", FieldType.TEXT); + fieldTypeMap.put("keyword", FieldType.KEYWORD); + fieldTypeMap.put("ip", FieldType.IP); + fieldTypeMap.put("integer", FieldType.INTEGER); + fieldTypeMap.put("long", FieldType.LONG); + fieldTypeMap.put("date", FieldType.DATE); + fieldTypeMap.put("float", FieldType.FLOAT); + fieldTypeMap.put("double", FieldType.DOUBLE); + fieldTypeMap.put("boolean", FieldType.BOOLEAN); + elasticsearchSearchTypeMap = Collections.unmodifiableMap(fieldTypeMap); + } + @Override public SearchResponse search(SearchRequest searchRequest) throws InvalidSearchException { + if(searchRequest.getQuery() == null) { + throw new InvalidSearchException("Search query is invalid: null"); + } return search(searchRequest, new QueryStringQueryBuilder(searchRequest.getQuery())); } @@ -162,14 +186,15 @@ protected SearchResponse search(SearchRequest request, QueryBuilder queryBuilder private org.elasticsearch.action.search.SearchRequest buildSearchRequest( SearchRequest searchRequest, QueryBuilder queryBuilder) throws InvalidSearchException { - - LOG.debug("Got search request; request={}", ElasticsearchUtils.toJSON(searchRequest).orElse("???")); + if (LOG.isDebugEnabled()) { + LOG.debug("Got search request; request={}", ElasticsearchUtils.toJSON(searchRequest).orElse("???")); + } SearchSourceBuilder searchBuilder = new SearchSourceBuilder() .size(searchRequest.getSize()) .from(searchRequest.getFrom()) .query(queryBuilder) .trackScores(true); - + Optional> fields = searchRequest.getFields(); // column metadata needed to understand the type of each sort field Map meta; try { @@ -202,24 +227,30 @@ private org.elasticsearch.action.search.SearchRequest buildSearchRequest( } // handle search fields - if (searchRequest.getFields().isPresent()) { - searchBuilder.fields(searchRequest.getFields().get()); + if (fields.isPresent()) { + searchBuilder.fetchSource("*", null); } else { searchBuilder.fetchSource(true); } + Optional> facetFields = searchRequest.getFacetFields(); + // handle facet fields if (searchRequest.getFacetFields().isPresent()) { + // https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/_bucket_aggregations.html for(String field : searchRequest.getFacetFields().get()) { - String name = getFacentAggregationName(field); - TermsBuilder terms = new TermsBuilder(name).field(field); + String name = getFacetAggregationName(field); + TermsAggregationBuilder terms = AggregationBuilders.terms( name).field(field); + // new TermsBuilder(name).field(field); searchBuilder.aggregation(terms); } } // return the search request String[] indices = wildcardIndices(searchRequest.getIndices()); - LOG.debug("Built Elasticsearch request; indices={}, request={}", indices, searchBuilder.toString()); + if (LOG.isDebugEnabled()) { + LOG.debug("Built Elasticsearch request; indices={}, request={}", indices, searchBuilder.toString()); + } return new org.elasticsearch.action.search.SearchRequest() .indices(indices) .source(searchBuilder); @@ -240,12 +271,13 @@ private SearchResponse buildSearchResponse( org.elasticsearch.action.search.SearchResponse esResponse) throws InvalidSearchException { SearchResponse searchResponse = new SearchResponse(); + searchResponse.setTotal(esResponse.getHits().getTotalHits()); // search hits --> search results List results = new ArrayList<>(); for(SearchHit hit: esResponse.getHits().getHits()) { - results.add(getSearchResult(hit, searchRequest.getFields().isPresent())); + results.add(getSearchResult(hit, searchRequest.getFields())); } searchResponse.setResults(results); @@ -263,7 +295,9 @@ private SearchResponse buildSearchResponse( searchResponse.setFacetCounts(getFacetCounts(facetFields, esResponse.getAggregations(), commonColumnMetadata )); } - LOG.debug("Built search response; response={}", ElasticsearchUtils.toJSON(searchResponse).orElse("???")); + if (LOG.isDebugEnabled()) { + LOG.debug("Built search response; response={}", ElasticsearchUtils.toJSON(searchResponse).orElse("???")); + } return searchResponse; } @@ -309,7 +343,7 @@ private org.elasticsearch.action.search.SearchRequest buildGroupRequest( QueryBuilder queryBuilder) { // handle groups - TermsBuilder groups = getGroupsTermBuilder(groupRequest, 0); + TermsAggregationBuilder groups = getGroupsTermBuilder(groupRequest, 0); final SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder() .query(queryBuilder) .aggregation(groups); @@ -446,16 +480,24 @@ Optional searchByGuid(String guid, String sensorType, */ List searchByGuids(Collection guids, Collection sensorTypes, Function> callback) { - QueryBuilder query; + if(guids == null || guids.isEmpty()) { + return Collections.EMPTY_LIST; + } + QueryBuilder query = null; + IdsQueryBuilder idsQuery = null; if (sensorTypes != null) { String[] types = sensorTypes.stream().map(sensorType -> sensorType + "_doc").toArray(String[]::new); - query = QueryBuilders.idsQuery(types).ids(guids); + idsQuery = QueryBuilders.idsQuery(types); } else { - query = QueryBuilders.idsQuery().ids(guids); + idsQuery = QueryBuilders.idsQuery(); } + + for(String guid : guids) { + query = idsQuery.addIds(guid); + } + SearchRequestBuilder request = client.prepareSearch() .setQuery(query) - .setSource("message") .setSize(guids.size()) ; org.elasticsearch.action.search.SearchResponse response = request.get(); @@ -569,7 +611,7 @@ public Map> getFacetCounts(List fields, Aggreg Map> fieldCounts = new HashMap<>(); for (String field: fields) { Map valueCounts = new HashMap<>(); - Aggregation aggregation = aggregations.get(getFacentAggregationName(field)); + Aggregation aggregation = aggregations.get(getFacetAggregationName(field)); if (aggregation instanceof Terms) { Terms terms = (Terms) aggregation; terms.getBuckets().stream().forEach(bucket -> valueCounts.put(formatKey(bucket.getKey(), commonColumnMetadata.get(field)), bucket.getDocCount())); @@ -580,8 +622,8 @@ public Map> getFacetCounts(List fields, Aggreg } private String formatKey(Object key, FieldType type) { - if (FieldType.IP.equals(type)) { - return IpFieldMapper.longToIp((Long) key); + if (FieldType.IP.equals(type) && key instanceof Long) { + return LegacyIpFieldMapper.longToIp((Long) key); } else if (FieldType.BOOLEAN.equals(type)) { return (Long) key == 1 ? "true" : "false"; } else { @@ -589,11 +631,12 @@ private String formatKey(Object key, FieldType type) { } } - private TermsBuilder getGroupsTermBuilder(GroupRequest groupRequest, int index) { + private TermsAggregationBuilder getGroupsTermBuilder(GroupRequest groupRequest, int index) { List groups = groupRequest.getGroups(); Group group = groups.get(index); String aggregationName = getGroupByAggregationName(group.getField()); - TermsBuilder termsBuilder = new TermsBuilder(aggregationName) + TermsAggregationBuilder termsBuilder = AggregationBuilders.terms(aggregationName); + termsBuilder .field(group.getField()) .size(accessConfig.getMaxSearchGroups()) .order(getElasticsearchGroupOrder(group.getOrder())); @@ -602,7 +645,8 @@ private TermsBuilder getGroupsTermBuilder(GroupRequest groupRequest, int index) } Optional scoreField = groupRequest.getScoreField(); if (scoreField.isPresent()) { - termsBuilder.subAggregation(new SumBuilder(getSumAggregationName(scoreField.get())).field(scoreField.get()).missing(0)); + SumAggregationBuilder scoreSumAggregationBuilder = AggregationBuilders.sum(getSumAggregationName(scoreField.get())).field(scoreField.get()).missing(0); + termsBuilder.subAggregation(scoreSumAggregationBuilder); } return termsBuilder; } @@ -630,14 +674,15 @@ private List getGroupResults(GroupRequest groupRequest, int index, return searchResultGroups; } - private SearchResult getSearchResult(SearchHit searchHit, boolean fieldsPresent) { + private SearchResult getSearchResult(SearchHit searchHit, Optional> fields) { SearchResult searchResult = new SearchResult(); searchResult.setId(searchHit.getId()); Map source; - if (fieldsPresent) { + if (fields.isPresent()) { + Map resultSourceAsMap = searchHit.getSourceAsMap(); source = new HashMap<>(); - searchHit.getFields().forEach((key, value) -> { - source.put(key, value.getValues().size() == 1 ? value.getValue() : value.getValues()); + fields.get().forEach(field -> { + source.put(field, resultSourceAsMap.get(field)); }); } else { source = searchHit.getSource(); @@ -648,7 +693,7 @@ private SearchResult getSearchResult(SearchHit searchHit, boolean fieldsPresent) return searchResult; } - private String getFacentAggregationName(String field) { + private String getFacetAggregationName(String field) { return String.format("%s_count", field); } diff --git a/metron-platform/metron-elasticsearch/src/main/java/org/apache/metron/elasticsearch/dao/ElasticsearchMetaAlertDao.java b/metron-platform/metron-elasticsearch/src/main/java/org/apache/metron/elasticsearch/dao/ElasticsearchMetaAlertDao.java index f8fb145004..9740272ad7 100644 --- a/metron-platform/metron-elasticsearch/src/main/java/org/apache/metron/elasticsearch/dao/ElasticsearchMetaAlertDao.java +++ b/metron-platform/metron-elasticsearch/src/main/java/org/apache/metron/elasticsearch/dao/ElasticsearchMetaAlertDao.java @@ -27,19 +27,11 @@ import com.fasterxml.jackson.databind.JsonNode; import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.Map.Entry; -import java.util.Optional; -import java.util.Set; -import java.util.UUID; import java.util.stream.Collectors; +import org.apache.commons.collections4.SetUtils; +import org.apache.lucene.search.join.ScoreMode; import org.apache.metron.common.Constants; import org.apache.metron.indexing.dao.AccessConfig; import org.apache.metron.indexing.dao.IndexDao; @@ -59,6 +51,22 @@ import org.apache.metron.indexing.dao.search.SearchResponse; import org.apache.metron.indexing.dao.search.SearchResult; import org.apache.metron.indexing.dao.update.Document; +import org.elasticsearch.action.get.GetResponse; +import org.elasticsearch.action.get.MultiGetItemResponse; +import org.elasticsearch.action.get.MultiGetRequest.Item; +import org.elasticsearch.action.get.MultiGetRequestBuilder; +import org.elasticsearch.action.get.MultiGetResponse; +import org.elasticsearch.action.index.IndexRequest; +import org.elasticsearch.action.search.SearchRequestBuilder; +import org.elasticsearch.action.support.replication.ReplicationResponse.ShardInfo; +import org.elasticsearch.action.update.UpdateRequest; +import org.elasticsearch.action.update.UpdateResponse; +import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.index.query.InnerHitBuilder; +import org.elasticsearch.index.query.QueryBuilder; +import org.elasticsearch.index.query.QueryBuilders; +import org.elasticsearch.index.query.QueryStringQueryBuilder; +import org.elasticsearch.search.SearchHit; import org.apache.metron.indexing.dao.update.OriginalNotFoundException; import org.apache.metron.indexing.dao.update.PatchRequest; import org.apache.metron.stellar.common.utils.ConversionUtils; @@ -66,7 +74,6 @@ import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.QueryStringQueryBuilder; -import org.elasticsearch.index.query.support.QueryInnerHitBuilder; public class ElasticsearchMetaAlertDao implements MetaAlertDao { @@ -163,8 +170,9 @@ public SearchResponse getAllMetaAlertsForAlert(String guid) throws InvalidSearch nestedQuery( ALERT_FIELD, boolQuery() - .must(termQuery(ALERT_FIELD + "." + GUID, guid)) - ).innerHit(new QueryInnerHitBuilder()) + .must(termQuery(ALERT_FIELD + "." + GUID, guid)), + ScoreMode.None + ).innerHit(new InnerHitBuilder()) ) .must(termQuery(STATUS_FIELD, MetaAlertStatus.ACTIVE.getStatusString())); return queryAllResults(qb); @@ -379,7 +387,8 @@ public SearchResponse search(SearchRequest searchRequest) throws InvalidSearchEx .should(new QueryStringQueryBuilder(searchRequest.getQuery())) .should(nestedQuery( ALERT_FIELD, - new QueryStringQueryBuilder(searchRequest.getQuery()) + new QueryStringQueryBuilder(searchRequest.getQuery()), + ScoreMode.None ) ) ) @@ -486,8 +495,9 @@ protected SearchResponse getMetaAlertsForAlert(String alertGuid) { nestedQuery( ALERT_FIELD, boolQuery() - .must(termQuery(ALERT_FIELD + "." + GUID, alertGuid)) - ).innerHit(new QueryInnerHitBuilder()) + .must(termQuery(ALERT_FIELD + "." + Constants.GUID, alertGuid)), + ScoreMode.None + ).innerHit(new InnerHitBuilder()) ) .must(termQuery(STATUS_FIELD, MetaAlertStatus.ACTIVE.getStatusString())); return queryAllResults(qb); @@ -504,7 +514,7 @@ protected SearchResponse queryAllResults(QueryBuilder qb) { SearchRequestBuilder searchRequestBuilder = elasticsearchDao .getClient() .prepareSearch(index) - .addFields("*") + .addStoredField("*") .setFetchSource(true) .setQuery(qb) .setSize(pageSize); @@ -586,6 +596,54 @@ protected void indexDaoUpdate(Map> updates) throws IO } // else we have no updates, so don't do anything } + + + @SuppressWarnings("unchecked") + protected List> getAllAlertsForMetaAlert(Document update) throws IOException { + Document latest = indexDao.getLatest(update.getGuid(), MetaAlertDao.METAALERT_TYPE); + if (latest == null) { + return new ArrayList<>(); + } + List guids = new ArrayList<>(); + List> latestAlerts = (List>) latest.getDocument() + .get(MetaAlertDao.ALERT_FIELD); + for (Map alert : latestAlerts) { + guids.add((String) alert.get(Constants.GUID)); + } + + List> alerts = new ArrayList<>(); + QueryBuilder query = QueryBuilders.idsQuery().addIds(guids.toArray(new String[0])); + SearchRequestBuilder request = elasticsearchDao.getClient().prepareSearch() + .setQuery(query); + org.elasticsearch.action.search.SearchResponse response = request.get(); + for (SearchHit hit : response.getHits().getHits()) { + alerts.add(hit.sourceAsMap()); + } + return alerts; + } + + /** + * Builds an update Document for updating the meta alerts list. + * @param alertGuid The GUID of the alert to update + * @param sensorType The sensor type to update + * @param metaAlertField The new metaAlertList to use + * @return The update Document + */ + protected Document buildAlertUpdate(String alertGuid, String sensorType, + List metaAlertField, Long timestamp) { + Document alertUpdate; + Map document = new HashMap<>(); + document.put(MetaAlertDao.METAALERT_FIELD, metaAlertField); + alertUpdate = new Document( + document, + alertGuid, + sensorType, + timestamp + ); + return alertUpdate; + } + + @Override public Map getColumnMetadata(List indices) throws IOException { diff --git a/metron-platform/metron-elasticsearch/src/main/java/org/apache/metron/elasticsearch/utils/ElasticsearchUtils.java b/metron-platform/metron-elasticsearch/src/main/java/org/apache/metron/elasticsearch/utils/ElasticsearchUtils.java index f29012af70..4b73b84c1e 100644 --- a/metron-platform/metron-elasticsearch/src/main/java/org/apache/metron/elasticsearch/utils/ElasticsearchUtils.java +++ b/metron-platform/metron-elasticsearch/src/main/java/org/apache/metron/elasticsearch/utils/ElasticsearchUtils.java @@ -17,19 +17,11 @@ */ package org.apache.metron.elasticsearch.utils; +import static java.lang.String.format; + import com.google.common.base.Splitter; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; -import org.apache.commons.lang.StringUtils; -import org.apache.metron.common.configuration.writer.WriterConfiguration; -import org.codehaus.jackson.map.ObjectMapper; -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.transport.InetSocketTransportAddress; -import org.elasticsearch.common.xcontent.XContentHelper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import java.lang.invoke.MethodHandles; import java.net.InetAddress; import java.net.UnknownHostException; @@ -41,8 +33,18 @@ import java.util.List; import java.util.Map; import java.util.Optional; - -import static java.lang.String.format; +import org.apache.commons.lang.StringUtils; +import org.apache.metron.common.configuration.writer.WriterConfiguration; +import org.apache.metron.netty.utils.NettyRuntimeWrapper; +import org.codehaus.jackson.map.ObjectMapper; +import org.elasticsearch.client.transport.TransportClient; +import org.elasticsearch.common.bytes.BytesReference; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.transport.InetSocketTransportAddress; +import org.elasticsearch.common.xcontent.XContentHelper; +import org.elasticsearch.transport.client.PreBuiltTransportClient; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ElasticsearchUtils { @@ -106,7 +108,7 @@ public static String getBaseIndexName(String indexName) { } public static TransportClient getClient(Map globalConfiguration, Map optionalSettings) { - Settings.Builder settingsBuilder = Settings.settingsBuilder(); + Settings.Builder settingsBuilder = Settings.builder(); settingsBuilder.put("cluster.name", globalConfiguration.get("es.clustername")); settingsBuilder.put("client.transport.ping_timeout","500s"); if (optionalSettings != null) { @@ -115,7 +117,13 @@ public static TransportClient getClient(Map globalConfiguration, Settings settings = settingsBuilder.build(); TransportClient client; try{ - client = TransportClient.builder().settings(settings).build(); + LOG.info("Number of available processors in Netty: {}", NettyRuntimeWrapper.availableProcessors()); + // Netty sets available processors statically and if an attempt is made to set it more than + // once an IllegalStateException is thrown by NettyRuntime.setAvailableProcessors(NettyRuntime.java:87) + // https://discuss.elastic.co/t/getting-availableprocessors-is-already-set-to-1-rejecting-1-illegalstateexception-exception/103082 + // https://discuss.elastic.co/t/elasticsearch-5-4-1-availableprocessors-is-already-set/88036 + System.setProperty("es.set.netty.runtime.available.processors", "false"); + client = new PreBuiltTransportClient(settings); for(HostnamePort hp : getIps(globalConfiguration)) { client.addTransportAddress( new InetSocketTransportAddress(InetAddress.getByName(hp.hostname), hp.port) @@ -196,9 +204,10 @@ else if(ipObj instanceof List) { public static Optional toJSON(org.elasticsearch.action.search.SearchRequest esRequest) { Optional json = Optional.empty(); - if(esRequest != null) { + if(esRequest != null && esRequest.source() != null) { try { - json = Optional.of(XContentHelper.convertToJson(esRequest.source(), true)); + BytesReference requestBytes = esRequest.source().buildAsBytes(); + json = Optional.of(XContentHelper.convertToJson(requestBytes, true)); } catch (Throwable t) { LOG.error("Failed to convert search request to JSON", t); diff --git a/metron-platform/metron-elasticsearch/src/main/java/org/apache/metron/elasticsearch/writer/ElasticsearchWriter.java b/metron-platform/metron-elasticsearch/src/main/java/org/apache/metron/elasticsearch/writer/ElasticsearchWriter.java index bc9eccc075..143bcf7c30 100644 --- a/metron-platform/metron-elasticsearch/src/main/java/org/apache/metron/elasticsearch/writer/ElasticsearchWriter.java +++ b/metron-platform/metron-elasticsearch/src/main/java/org/apache/metron/elasticsearch/writer/ElasticsearchWriter.java @@ -17,6 +17,12 @@ */ package org.apache.metron.elasticsearch.writer; +import java.io.Serializable; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Iterator; +import java.util.List; +import java.util.Map; import org.apache.metron.common.Constants; import org.apache.metron.common.configuration.writer.WriterConfiguration; import org.apache.metron.common.interfaces.FieldNameConverter; @@ -34,13 +40,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.Serializable; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - public class ElasticsearchWriter implements BulkMessageWriter, Serializable { private Map optionalSettings; diff --git a/metron-platform/metron-elasticsearch/src/test/java/org/apache/metron/elasticsearch/bulk/ElasticsearchImportExportTest.java b/metron-platform/metron-elasticsearch/src/test/java/org/apache/metron/elasticsearch/bulk/ElasticsearchImportExportTest.java new file mode 100644 index 0000000000..ddec27cda0 --- /dev/null +++ b/metron-platform/metron-elasticsearch/src/test/java/org/apache/metron/elasticsearch/bulk/ElasticsearchImportExportTest.java @@ -0,0 +1,69 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +package org.apache.metron.elasticsearch.bulk; + +import static org.hamcrest.CoreMatchers.equalTo; +import static org.junit.Assert.assertThat; + +import java.io.File; +import java.nio.file.Path; +import java.nio.file.Paths; +import org.adrianwalker.multilinestring.Multiline; +import org.apache.metron.integration.utils.TestUtils; +import org.junit.Before; +import org.junit.Test; + +public class ElasticsearchImportExportTest { + + + /** + *{"_index":".kibana","_type":"visualization","_id":"AV-Sj0e2hKs1cXXnFMqF","_score":1,"_source":{"title":"Welcome to Apache Metron"}} + *{"_index":".kibana","_type":"blah","_id":"MIKE-AV-Sj0e2hKs1cXXnFMqF","_score":1,"_source":{"title":"another Welcome to Apache Metron"}} + */ + @Multiline + private static String records; + + /** + *{ "create" : { "_id": "AV-Sj0e2hKs1cXXnFMqF", "_type": "visualization" } } + *{"title":"Welcome to Apache Metron"} + *{ "create" : { "_id": "MIKE-AV-Sj0e2hKs1cXXnFMqF", "_type": "blah" } } + *{"title":"another Welcome to Apache Metron"} + */ + @Multiline + private static String expected; + private File tempDir; + + @Before + public void setup() throws Exception { + tempDir = TestUtils.createTempDir(this.getClass().getName()); + } + + @Test + public void bulk_exporter_writes_elasticsearch_records_in_bulk_import_format() throws Exception { + Path recordsFile = Paths.get(tempDir.getPath(), "inputfile.json"); + Path outputFile = Paths.get(tempDir.getPath(), "outputfile.json"); + TestUtils.write(recordsFile.toFile(), records); + + ElasticsearchImportExport tool = new ElasticsearchImportExport(); + tool.bulkify(recordsFile, outputFile); + String actual = TestUtils.read(outputFile.toFile()); + assertThat(actual, equalTo(expected)); + } + +} diff --git a/metron-platform/metron-elasticsearch/src/test/java/org/apache/metron/elasticsearch/dao/ElasticsearchDaoTest.java b/metron-platform/metron-elasticsearch/src/test/java/org/apache/metron/elasticsearch/dao/ElasticsearchDaoTest.java index a6c0aa6335..2a6fb4ff8e 100644 --- a/metron-platform/metron-elasticsearch/src/test/java/org/apache/metron/elasticsearch/dao/ElasticsearchDaoTest.java +++ b/metron-platform/metron-elasticsearch/src/test/java/org/apache/metron/elasticsearch/dao/ElasticsearchDaoTest.java @@ -17,14 +17,23 @@ */ package org.apache.metron.elasticsearch.dao; -import org.apache.metron.elasticsearch.utils.ElasticsearchUtils; +import static org.junit.Assert.assertEquals; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; import org.apache.metron.indexing.dao.AccessConfig; -import org.apache.metron.indexing.dao.search.FieldType; import org.apache.metron.indexing.dao.search.InvalidSearchException; import org.apache.metron.indexing.dao.search.SearchRequest; import org.apache.metron.indexing.dao.search.SearchResponse; import org.apache.metron.indexing.dao.search.SortField; import org.apache.metron.indexing.dao.search.SortOrder; +import org.apache.metron.elasticsearch.utils.ElasticsearchUtils; +import org.apache.metron.indexing.dao.search.FieldType; import org.elasticsearch.client.transport.TransportClient; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.search.SearchHit; @@ -35,18 +44,10 @@ import org.junit.Test; import org.mockito.ArgumentCaptor; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; import java.util.Map; import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; public class ElasticsearchDaoTest { @@ -103,7 +104,7 @@ public void searchShouldSortByGivenFields() throws Exception { // setup the column metadata Map columnMetadata = new HashMap<>(); - columnMetadata.put("sortByStringDesc", FieldType.STRING); + columnMetadata.put("sortByStringDesc", FieldType.TEXT); columnMetadata.put("sortByIntAsc", FieldType.INTEGER); // setup the dao @@ -148,7 +149,7 @@ public void searchShouldSortByGivenFields() throws Exception { JSONObject sortBy = (JSONObject) aSortField.get("sortByStringDesc"); assertEquals("desc", sortBy.get("order")); assertEquals("_last", sortBy.get("missing")); - assertEquals("string", sortBy.get("unmapped_type")); + assertEquals("text", sortBy.get("unmapped_type")); } { // sort by integer ascending @@ -217,7 +218,7 @@ public void searchShouldThrowExceptionWhenMaxResultsAreExceeded() throws Excepti SearchRequest searchRequest = new SearchRequest(); searchRequest.setSize(maxSearchResults+1); - + searchRequest.setQuery(""); dao.search(searchRequest); // exception expected - size > max } diff --git a/metron-platform/metron-elasticsearch/src/test/java/org/apache/metron/elasticsearch/dao/ElasticsearchRequestSubmitterTest.java b/metron-platform/metron-elasticsearch/src/test/java/org/apache/metron/elasticsearch/dao/ElasticsearchRequestSubmitterTest.java index 26f5fff7f1..07019c3b50 100644 --- a/metron-platform/metron-elasticsearch/src/test/java/org/apache/metron/elasticsearch/dao/ElasticsearchRequestSubmitterTest.java +++ b/metron-platform/metron-elasticsearch/src/test/java/org/apache/metron/elasticsearch/dao/ElasticsearchRequestSubmitterTest.java @@ -24,6 +24,7 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.search.ShardSearchFailure; import org.elasticsearch.client.transport.TransportClient; +import org.elasticsearch.index.Index; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.search.SearchShardTarget; import org.junit.Test; @@ -56,7 +57,7 @@ public void searchShouldSucceedWhenOK() throws InvalidSearchException { // mocks SearchResponse response = mock(SearchResponse.class); - SearchRequest request = mock(SearchRequest.class); + SearchRequest request = new SearchRequest(); // response will have status of OK and no failed shards when(response.status()).thenReturn(RestStatus.OK); @@ -74,7 +75,7 @@ public void searchShouldFailWhenNotOK() throws InvalidSearchException { // mocks SearchResponse response = mock(SearchResponse.class); - SearchRequest request = mock(SearchRequest.class); + SearchRequest request = new SearchRequest(); // response will have status of OK when(response.status()).thenReturn(RestStatus.PARTIAL_CONTENT); @@ -90,9 +91,9 @@ public void searchShouldFailWhenNotOK() throws InvalidSearchException { public void searchShouldHandleShardFailure() throws InvalidSearchException { // mocks SearchResponse response = mock(SearchResponse.class); - SearchRequest request = mock(SearchRequest.class); + SearchRequest request = new SearchRequest(); ShardSearchFailure fail = mock(ShardSearchFailure.class); - SearchShardTarget target = mock(SearchShardTarget.class); + SearchShardTarget target = new SearchShardTarget("node1", mock(Index.class), 1, "metron"); // response will have status of OK when(response.status()).thenReturn(RestStatus.OK); @@ -107,7 +108,6 @@ public void searchShouldHandleShardFailure() throws InvalidSearchException { // shard failure needs to report the node when(fail.shard()).thenReturn(target); - when(target.getNodeId()).thenReturn("node1"); // shard failure needs to report details of failure when(fail.index()).thenReturn("bro_index_2017-10-11"); diff --git a/metron-platform/metron-elasticsearch/src/test/java/org/apache/metron/elasticsearch/integration/ElasticsearchIndexingIntegrationTest.java b/metron-platform/metron-elasticsearch/src/test/java/org/apache/metron/elasticsearch/integration/ElasticsearchIndexingIntegrationTest.java index 4c03526dbf..1efcc390b4 100644 --- a/metron-platform/metron-elasticsearch/src/test/java/org/apache/metron/elasticsearch/integration/ElasticsearchIndexingIntegrationTest.java +++ b/metron-platform/metron-elasticsearch/src/test/java/org/apache/metron/elasticsearch/integration/ElasticsearchIndexingIntegrationTest.java @@ -17,6 +17,7 @@ */ package org.apache.metron.elasticsearch.integration; +import org.adrianwalker.multilinestring.Multiline; import org.apache.metron.common.interfaces.FieldNameConverter; import org.apache.metron.elasticsearch.integration.components.ElasticSearchComponent; import org.apache.metron.elasticsearch.writer.ElasticsearchFieldNameConverter; @@ -35,6 +36,7 @@ import java.util.List; import java.util.Map; import java.util.Properties; +import java.util.concurrent.atomic.AtomicInteger; public class ElasticsearchIndexingIntegrationTest extends IndexingIntegrationTest { @@ -42,6 +44,20 @@ public class ElasticsearchIndexingIntegrationTest extends IndexingIntegrationTes private String dateFormat = "yyyy.MM.dd.HH"; private String index = "yaf_index_" + new SimpleDateFormat(dateFormat).format(new Date()); private FieldNameConverter fieldNameConverter = new ElasticsearchFieldNameConverter(); + /** + * { + * "yaf_doc": { + * "properties": { + * "source:type": { "type": "keyword" }, + * "guid": { "type": "keyword" }, + * "isn": { "type": "text" } + * } + * } + * } + */ + @Multiline + private static String mapping; + @Override public FieldNameConverter getFieldNameConverter() { @@ -53,6 +69,7 @@ public InMemoryComponent getSearchComponent(final Properties topologyProperties) return new ElasticSearchComponent.Builder() .withHttpPort(9211) .withIndexDir(new File(indexDir)) + .withMapping(index, "yaf_doc", mapping) .build(); } @@ -61,6 +78,7 @@ public Processor>> getProcessor(final List inpu return new Processor>>() { List> docs = null; List errors = null; + final AtomicInteger missCount = new AtomicInteger(0); @Override public ReadinessState process(ComponentRunner runner) { ElasticSearchComponent elasticSearchComponent = runner.getComponent("search", ElasticSearchComponent.class); @@ -70,7 +88,9 @@ public ReadinessState process(ComponentRunner runner) { try { docs = elasticSearchComponent.getAllIndexedDocs(index, testSensorType + "_doc"); docsFromDisk = readDocsFromDisk(hdfsDir); - System.out.println(docs.size() + " vs " + inputMessages.size() + " vs " + docsFromDisk.size()); + if(missCount.incrementAndGet() >= NUM_RETRIES/2) { + System.out.println(missCount.get() + ": " + docs.size() + " vs " + inputMessages.size() + " vs " + docsFromDisk.size()); + } } catch (IOException e) { throw new IllegalStateException("Unable to retrieve indexed documents.", e); } @@ -84,7 +104,6 @@ public ReadinessState process(ComponentRunner runner) { return ReadinessState.READY; } } else { - System.out.println("Missed index..."); return ReadinessState.NOT_READY; } } diff --git a/metron-platform/metron-elasticsearch/src/test/java/org/apache/metron/elasticsearch/integration/ElasticsearchMetaAlertIntegrationTest.java b/metron-platform/metron-elasticsearch/src/test/java/org/apache/metron/elasticsearch/integration/ElasticsearchMetaAlertIntegrationTest.java index 35f40ca1de..9e74fb6cef 100644 --- a/metron-platform/metron-elasticsearch/src/test/java/org/apache/metron/elasticsearch/integration/ElasticsearchMetaAlertIntegrationTest.java +++ b/metron-platform/metron-elasticsearch/src/test/java/org/apache/metron/elasticsearch/integration/ElasticsearchMetaAlertIntegrationTest.java @@ -23,9 +23,10 @@ import static org.apache.metron.indexing.dao.MetaAlertDao.METAALERT_FIELD; import static org.apache.metron.indexing.dao.MetaAlertDao.METAALERT_TYPE; import static org.apache.metron.indexing.dao.MetaAlertDao.STATUS_FIELD; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import com.fasterxml.jackson.core.JsonProcessingException; +import com.google.common.base.Joiner; +import com.google.common.collect.Iterables; import java.io.File; import java.io.IOException; import java.text.SimpleDateFormat; @@ -34,9 +35,11 @@ import java.util.Collections; import java.util.Date; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Optional; +import java.util.Set; import java.util.stream.Collectors; import org.adrianwalker.multilinestring.Multiline; import org.apache.metron.common.Constants; @@ -159,6 +162,29 @@ public class ElasticsearchMetaAlertIntegrationTest { @Multiline public static String statusPatchRequest; + /** + * { + "%MAPPING_NAME%_doc" : { + "properties" : { + "guid" : { + "type" : "keyword" + }, + "ip_src_addr" : { + "type" : "keyword" + }, + "score" : { + "type" : "integer" + }, + "alert" : { + "type" : "nested" + } + } + } + } + */ + @Multiline + public static String template; + @BeforeClass public static void setupBefore() throws Exception { // setup the client @@ -188,8 +214,8 @@ public static void setupBefore() throws Exception { @Before public void setup() throws IOException { - es.createIndexWithMapping(METAALERTS_INDEX, MetaAlertDao.METAALERT_DOC, - buildMetaMappingSource()); + es.createIndexWithMapping(METAALERTS_INDEX, MetaAlertDao.METAALERT_DOC, template.replace("%MAPPING_NAME%", "metaalert")); + es.createIndexWithMapping(INDEX, "index_doc", template.replace("%MAPPING_NAME%", "index")); } @AfterClass @@ -204,27 +230,6 @@ public void reset() { es.reset(); } - protected static String buildMetaMappingSource() throws IOException { - return jsonBuilder().prettyPrint() - .startObject() - .startObject(MetaAlertDao.METAALERT_DOC) - .startObject("properties") - .startObject("guid") - .field("type", "string") - .field("index", "not_analyzed") - .endObject() - .startObject("score") - .field("type", "integer") - .field("index", "not_analyzed") - .endObject() - .startObject("alert") - .field("type", "nested") - .endObject() - .endObject() - .endObject() - .endObject() - .string(); - } @Test public void shouldGetAllMetaAlertsForAlert() throws Exception { @@ -259,7 +264,11 @@ public void shouldGetAllMetaAlertsForAlert() throws Exception { SearchResponse searchResponse0 = metaDao.getAllMetaAlertsForAlert("message_0"); List searchResults0 = searchResponse0.getResults(); Assert.assertEquals(13, searchResults0.size()); - Assert.assertEquals(metaAlerts.get(0), searchResults0.get(0).getSource()); + Set> resultSet = new HashSet<>(); + Iterables.addAll(resultSet, Iterables.transform(searchResults0, r -> r.getSource())); + StringBuffer reason = new StringBuffer("Unable to find " + metaAlerts.get(0) + "\n"); + reason.append(Joiner.on("\n").join(resultSet)); + Assert.assertTrue(reason.toString(), resultSet.contains(metaAlerts.get(0))); // Verify no meta alerts are returned because message_1 was not added to any SearchResponse searchResponse1 = metaDao.getAllMetaAlertsForAlert("message_1"); @@ -760,14 +769,14 @@ public void shouldSearchByNestedAlert() throws Exception { // Query against all indices. The child alert has no actual attached meta alerts, and should // be returned on its own. - searchResponse = metaDao.search(new SearchRequest() { + searchResponse = metaDao.search(new SearchRequest() { { setQuery( "(ip_src_addr:192.168.1.3 AND ip_src_port:8008)" + " OR (alert.ip_src_addr:192.168.1.3 AND alert.ip_src_port:8008)"); setIndices(Collections.singletonList("*")); setFrom(0); - setSize(5); + setSize(1); setSort(Collections.singletonList(new SortField() { { setField(Constants.GUID); diff --git a/metron-platform/metron-elasticsearch/src/test/java/org/apache/metron/elasticsearch/integration/ElasticsearchSearchIntegrationTest.java b/metron-platform/metron-elasticsearch/src/test/java/org/apache/metron/elasticsearch/integration/ElasticsearchSearchIntegrationTest.java index eac4851242..3949c6d16b 100644 --- a/metron-platform/metron-elasticsearch/src/test/java/org/apache/metron/elasticsearch/integration/ElasticsearchSearchIntegrationTest.java +++ b/metron-platform/metron-elasticsearch/src/test/java/org/apache/metron/elasticsearch/integration/ElasticsearchSearchIntegrationTest.java @@ -17,17 +17,24 @@ */ package org.apache.metron.elasticsearch.integration; + +import java.io.File; +import java.util.HashMap; +import java.io.IOException; +import java.util.concurrent.ExecutionException; import org.adrianwalker.multilinestring.Multiline; import org.apache.metron.elasticsearch.dao.ElasticsearchDao; import org.apache.metron.elasticsearch.integration.components.ElasticSearchComponent; import org.apache.metron.indexing.dao.AccessConfig; import org.apache.metron.indexing.dao.IndexDao; +import org.apache.metron.indexing.dao.MetaAlertDao; import org.apache.metron.indexing.dao.SearchIntegrationTest; import org.apache.metron.integration.InMemoryComponent; import org.elasticsearch.action.bulk.BulkRequestBuilder; import org.elasticsearch.action.bulk.BulkResponse; import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.index.IndexRequestBuilder; +import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.SearchHit; @@ -53,8 +60,11 @@ public class ElasticsearchSearchIntegrationTest extends SearchIntegrationTest { * "bro_doc": { * "properties": { * "source:type": { - * "type": "string", - * "index": "not_analyzed" + * "type": "text", + * "fielddata" : "true" + * }, + * "guid" : { + * "type" : "keyword" * }, * "ip_src_addr": { * "type": "ip" @@ -82,10 +92,12 @@ public class ElasticsearchSearchIntegrationTest extends SearchIntegrationTest { * "type": "geo_point" * }, * "bro_field": { - * "type": "string" + * "type": "text", + * "fielddata" : "true" * }, * "duplicate_name_field": { - * "type": "string" + * "type": "text", + * "fielddata" : "true" * }, * "alert": { * "type": "nested" @@ -102,8 +114,11 @@ public class ElasticsearchSearchIntegrationTest extends SearchIntegrationTest { * "snort_doc": { * "properties": { * "source:type": { - * "type": "string", - * "index": "not_analyzed" + * "type": "text", + * "fielddata" : "true" + * }, + * "guid" : { + * "type" : "keyword" * }, * "ip_src_addr": { * "type": "ip" @@ -170,8 +185,23 @@ public class ElasticsearchSearchIntegrationTest extends SearchIntegrationTest { * { * "metaalert_doc": { * "properties": { - * "source:type": { "type": "string" }, - * "alert": { "type": "nested"} + * "guid": { "type": "keyword" }, + * "alert": { + * "type": "nested", + * "properties": { + * "guid": { "type": "keyword" } + * } + * }, + * "average": { "type": "keyword" }, + * "min" : { "type": "keyword" }, + * "median" : { "type": "keyword" }, + * "max": { "type": "keyword" }, + * "count": { "type": "keyword" }, + * "sum": { "type": "keyword" }, + * "source:type": { + * "type": "text", + * "fielddata" : "true" + * } * } * } * } @@ -216,10 +246,10 @@ protected void loadTestData() .addMapping("bro_doc", broTypeMappings).addMapping("bro_doc_default", broDefaultStringMappings).get(); es.getClient().admin().indices().prepareCreate("snort_index_2017.01.01.02") .addMapping("snort_doc", snortTypeMappings).get(); - es.getClient().admin().indices().prepareCreate("metaalert_index") - .addMapping("metaalert_doc", metaAlertTypeMappings).get(); + es.getClient().admin().indices().prepareCreate(MetaAlertDao.METAALERTS_INDEX) + .addMapping(MetaAlertDao.METAALERT_DOC, metaAlertTypeMappings).get(); - BulkRequestBuilder bulkRequest = es.getClient().prepareBulk().setRefresh(true); + BulkRequestBuilder bulkRequest = es.getClient().prepareBulk().setRefreshPolicy(WriteRequest.RefreshPolicy.WAIT_UNTIL); JSONArray broArray = (JSONArray) new JSONParser().parse(broData); for(Object o: broArray) { JSONObject jsonObject = (JSONObject) o; diff --git a/metron-platform/metron-elasticsearch/src/test/java/org/apache/metron/elasticsearch/integration/components/ElasticSearchComponent.java b/metron-platform/metron-elasticsearch/src/test/java/org/apache/metron/elasticsearch/integration/components/ElasticSearchComponent.java index 3ef9379da7..f95ef215f9 100644 --- a/metron-platform/metron-elasticsearch/src/test/java/org/apache/metron/elasticsearch/integration/components/ElasticSearchComponent.java +++ b/metron-platform/metron-elasticsearch/src/test/java/org/apache/metron/elasticsearch/integration/components/ElasticSearchComponent.java @@ -17,7 +17,18 @@ */ package org.apache.metron.elasticsearch.integration.components; +import static java.util.Arrays.asList; + import com.fasterxml.jackson.core.type.TypeReference; +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; import org.apache.commons.io.FileUtils; import org.apache.metron.common.Constants; import org.apache.metron.common.utils.JSONUtils; @@ -29,210 +40,251 @@ import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; import org.elasticsearch.action.admin.indices.create.CreateIndexResponse; import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest; -import org.elasticsearch.action.admin.indices.mapping.put.PutMappingResponse; +import org.elasticsearch.action.admin.indices.refresh.RefreshRequest; +import org.elasticsearch.action.admin.indices.stats.IndicesStatsRequest; import org.elasticsearch.action.bulk.BulkRequestBuilder; import org.elasticsearch.action.bulk.BulkResponse; import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.cluster.health.ClusterHealthStatus; -import org.elasticsearch.action.admin.indices.refresh.RefreshRequest; -import org.elasticsearch.action.admin.indices.stats.IndicesStatsRequest; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.client.Client; -import org.elasticsearch.client.ElasticsearchClient; +import org.elasticsearch.cluster.health.ClusterHealthStatus; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.unit.TimeValue; +import org.elasticsearch.node.InternalSettingsPreparer; import org.elasticsearch.node.Node; -import org.elasticsearch.node.NodeBuilder; +import org.elasticsearch.node.NodeValidationException; +import org.elasticsearch.plugins.Plugin; import org.elasticsearch.search.SearchHit; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Set; +import org.elasticsearch.transport.Netty4Plugin; public class ElasticSearchComponent implements InMemoryComponent { - public static class Builder{ - private int httpPort; - private File indexDir; - private Map extraElasticSearchSettings = null; - public Builder withHttpPort(int httpPort) { - this.httpPort = httpPort; - return this; - } - public Builder withIndexDir(File indexDir) { - this.indexDir = indexDir; - return this; - } - public Builder withExtraElasticSearchSettings(Map extraElasticSearchSettings) { - this.extraElasticSearchSettings = extraElasticSearchSettings; - return this; - } - public ElasticSearchComponent build() { - return new ElasticSearchComponent(httpPort, indexDir, extraElasticSearchSettings); - } - } - - private Client client; - private Node node; + private static class Mapping { + String index; + String docType; + String mapping; + + public Mapping(String index, String docType, String mapping) { + this.index = index; + this.docType = docType; + this.mapping = mapping; + } + } + + public static class Builder { + private int httpPort; private File indexDir; - private Map extraElasticSearchSettings; + private Map extraElasticSearchSettings = null; + private List mappings = new ArrayList<>(); - public ElasticSearchComponent(int httpPort, File indexDir) { - this(httpPort, indexDir, null); + public Builder withMapping(String index, String docType, String mapping) { + mappings.add(new Mapping(index, docType, mapping)); + return this; } - public ElasticSearchComponent(int httpPort, File indexDir, Map extraElasticSearchSettings) { - this.httpPort = httpPort; - this.indexDir = indexDir; - this.extraElasticSearchSettings = extraElasticSearchSettings; + + public Builder withHttpPort(int httpPort) { + this.httpPort = httpPort; + return this; } - public Client getClient() { - return client; + + public Builder withIndexDir(File indexDir) { + this.indexDir = indexDir; + return this; } - private void cleanDir(File dir) throws IOException { - if(dir.exists()) { - FileUtils.deleteDirectory(dir); - } - dir.mkdirs(); + public Builder withExtraElasticSearchSettings( + Map extraElasticSearchSettings) { + this.extraElasticSearchSettings = extraElasticSearchSettings; + return this; } - public BulkResponse add(String indexName, String sensorType, String... docs) throws IOException { - List d = new ArrayList<>(); - Collections.addAll(d, docs); - return add(indexName, sensorType, d); + public ElasticSearchComponent build() { + return new ElasticSearchComponent(httpPort, indexDir, extraElasticSearchSettings, mappings); } + } - public BulkResponse add(String indexName, String sensorType, Iterable docs) throws IOException { - BulkRequestBuilder bulkRequest = getClient().prepareBulk(); - for(String doc : docs) { - IndexRequestBuilder indexRequestBuilder = getClient().prepareIndex(indexName, - sensorType + "_doc"); + private static final String STARTUP_TIMEOUT = "60s"; + private Client client; + private Node node; + private int httpPort; + private File indexDir; + private Map extraElasticSearchSettings; + private List mappings; - indexRequestBuilder = indexRequestBuilder.setSource(doc); - Map esDoc = JSONUtils.INSTANCE.load(doc, new TypeReference>() { - }); - indexRequestBuilder.setId((String) esDoc.get(Constants.GUID)); - Object ts = esDoc.get("timestamp"); - if(ts != null) { - indexRequestBuilder = indexRequestBuilder.setTimestamp(ts.toString()); - } - bulkRequest.add(indexRequestBuilder); - } + public ElasticSearchComponent(int httpPort, File indexDir, + Map extraElasticSearchSettings, List mappings) { + this.httpPort = httpPort; + this.indexDir = indexDir; + this.extraElasticSearchSettings = extraElasticSearchSettings; + this.mappings = mappings; + } - BulkResponse response = bulkRequest.execute().actionGet(); - if(response.hasFailures()) { - throw new IOException(response.buildFailureMessage()); - } - return response; + @Override + public void start() throws UnableToStartException { + File logDir = new File(indexDir, "/logs"); + File dataDir = new File(indexDir, "/data"); + try { + cleanDir(logDir); + cleanDir(dataDir); + } catch (IOException e) { + throw new UnableToStartException("Unable to clean log or data directories", e); } - public void createIndexWithMapping(String indexName, String mappingType, String mappingSource) - throws IOException { - CreateIndexResponse cir = client.admin().indices().prepareCreate(indexName) - .addMapping(mappingType, mappingSource) - .get(); + Settings.Builder settingsBuilder = Settings.builder() + .put("cluster.name", "metron") + .put("path.logs",logDir.getAbsolutePath()) + .put("path.data",dataDir.getAbsolutePath()) + .put("path.home", indexDir.getAbsoluteFile()) + .put("transport.type", "netty4") + .put("http.enabled", "false"); - if (!cir.isAcknowledged()) { - throw new IOException("Create index was not acknowledged"); - } + if (extraElasticSearchSettings != null) { + settingsBuilder = settingsBuilder.put(extraElasticSearchSettings); } - @Override - public void start() throws UnableToStartException { - File logDir= new File(indexDir, "/logs"); - File dataDir= new File(indexDir, "/data"); - try { - cleanDir(logDir); - cleanDir(dataDir); - - } catch (IOException e) { - throw new UnableToStartException("Unable to clean log or data directories", e); - } - - Settings.Builder settingsBuilder = Settings.settingsBuilder() - .put("node.http.enabled", true) - .put("http.port", httpPort) - .put("path.logs",logDir.getAbsolutePath()) - .put("path.data",dataDir.getAbsolutePath()) - .put("path.home", indexDir.getAbsoluteFile()) - .put("index.number_of_shards", 1) - .put("node.mode", "network") - .put("index.number_of_replicas", 1); - - if(extraElasticSearchSettings != null) { - - settingsBuilder = settingsBuilder.put(extraElasticSearchSettings); - - } - - node = NodeBuilder.nodeBuilder().settings(settingsBuilder).clusterName("metron").node(); - node.start(); - - client = node.client(); - - waitForCluster(client, ClusterHealthStatus.YELLOW, new TimeValue(60000)); - - } - - public static void waitForCluster(ElasticsearchClient client, ClusterHealthStatus status, TimeValue timeout) throws UnableToStartException { - try { - ClusterHealthResponse healthResponse = - (ClusterHealthResponse)client.execute(ClusterHealthAction.INSTANCE, new ClusterHealthRequest().waitForStatus(status).timeout(timeout)).actionGet(); - if (healthResponse != null && healthResponse.isTimedOut()) { - throw new UnableToStartException("cluster state is " + healthResponse.getStatus().name() - + " and not " + status.name() - + ", from here on, everything will fail!"); - } - } catch (ElasticsearchTimeoutException e) { - throw new UnableToStartException("timeout, cluster does not respond to health request, cowardly refusing to continue with operations"); - } - } - - public List> getAllIndexedDocs(String index, String sourceType) throws IOException { - return getAllIndexedDocs(index, sourceType, null); - } - public List> getAllIndexedDocs(String index, String sourceType, String subMessage) throws IOException { - getClient().admin().indices().refresh(new RefreshRequest()); - SearchResponse response = getClient().prepareSearch(index) - .setTypes(sourceType) - .setSource("message") - .setFrom(0) - .setSize(1000) - .execute().actionGet(); - List> ret = new ArrayList>(); - for (SearchHit hit : response.getHits()) { - Object o = null; - if(subMessage == null) { - o = hit.getSource(); - } - else { - o = hit.getSource().get(subMessage); - } - ret.add((Map)(o)); - } - return ret; - } - public boolean hasIndex(String indexName) { - Set indices = getClient().admin() - .indices() - .stats(new IndicesStatsRequest()) - .actionGet() - .getIndices() - .keySet(); - return indices.contains(indexName); + node = new TestNode(settingsBuilder.build(), asList(Netty4Plugin.class)); + client = node.client(); + try { + node.start(); + } catch (NodeValidationException e) { + throw new UnableToStartException("Error starting ES node.", e); + } + waitForCluster(client, ClusterHealthStatus.YELLOW, STARTUP_TIMEOUT); + for(Mapping m : Optional.ofNullable(mappings).orElse(new ArrayList<>())) { + client.admin().indices().prepareCreate(m.index) + .addMapping(m.docType, m.mapping).get(); + } + } + + private void cleanDir(File dir) throws IOException { + if (dir.exists()) { + FileUtils.deleteDirectory(dir); + } + dir.mkdirs(); + } + + // ES 5.x+ needs this to startup a node without using their test framework + private static class TestNode extends Node { + + private TestNode(Settings preparedSettings, + Collection> classpathPlugins) { + super(InternalSettingsPreparer.prepareEnvironment(preparedSettings, null), classpathPlugins); + } + + } + + public static void waitForCluster(Client client, ClusterHealthStatus statusThreshold, + String timeout) throws UnableToStartException { + try { + ClusterHealthResponse healthResponse = (ClusterHealthResponse) client + .execute(ClusterHealthAction.INSTANCE, + new ClusterHealthRequest().waitForStatus(statusThreshold).timeout(timeout)) + .actionGet(); + if (healthResponse != null && healthResponse.isTimedOut()) { + throw new UnableToStartException("cluster state is " + healthResponse.getStatus().name() + + " and not " + statusThreshold.name() + + ", from here on, everything will fail!"); + } + } catch (ElasticsearchTimeoutException e) { + throw new UnableToStartException( + "timeout, cluster does not respond to health request, cowardly refusing to continue with operations"); + } + } + public Client getClient() { + return client; + } + + public BulkResponse add(String indexName, String sensorType, String... docs) throws IOException { + List d = new ArrayList<>(); + Collections.addAll(d, docs); + return add(indexName, sensorType, d); + } + + public BulkResponse add(String indexName, String sensorType, Iterable docs) + throws IOException { + BulkRequestBuilder bulkRequest = getClient().prepareBulk(); + for (String doc : docs) { + IndexRequestBuilder indexRequestBuilder = getClient() + .prepareIndex(indexName, sensorType + "_doc"); + + indexRequestBuilder = indexRequestBuilder.setSource(doc); + Map esDoc = JSONUtils.INSTANCE + .load(doc, new TypeReference>() { + }); + indexRequestBuilder.setId((String) esDoc.get(Constants.GUID)); + Object ts = esDoc.get("timestamp"); + if (ts != null) { + indexRequestBuilder = indexRequestBuilder.setTimestamp(ts.toString()); + } + bulkRequest.add(indexRequestBuilder); } + BulkResponse response = bulkRequest.execute().actionGet(); + if (response.hasFailures()) { + throw new IOException(response.buildFailureMessage()); + } + return response; + } + + public void createIndexWithMapping(String indexName, String mappingType, String mappingSource) + throws IOException { + CreateIndexResponse cir = client.admin().indices().prepareCreate(indexName) + .addMapping(mappingType, mappingSource) + .get(); + + if (!cir.isAcknowledged()) { + throw new IOException("Create index was not acknowledged"); + } + } + + public List> getAllIndexedDocs(String index, String sourceType) + throws IOException { + return getAllIndexedDocs(index, sourceType, null); + } + + public List> getAllIndexedDocs(String index, String sourceType, + String subMessage) throws IOException { + getClient().admin().indices().refresh(new RefreshRequest()); + SearchResponse response = getClient().prepareSearch(index) + .setTypes(sourceType) +// .setSource("message") ?? + .setFrom(0) + .setSize(1000) + .execute().actionGet(); + List> ret = new ArrayList>(); + for (SearchHit hit : response.getHits()) { + Object o = null; + if (subMessage == null) { + o = hit.getSource(); + } else { + o = hit.getSource().get(subMessage); + } + ret.add((Map) (o)); + } + return ret; + } + + public boolean hasIndex(String indexName) { + Set indices = getClient().admin() + .indices() + .stats(new IndicesStatsRequest()) + .actionGet() + .getIndices() + .keySet(); + return indices.contains(indexName); + + } + @Override public void stop() { + try { node.close(); - node = null; - client = null; + } catch (IOException e) { + throw new RuntimeException("Unable to stop node." , e); + } + node = null; + client = null; } @Override diff --git a/metron-platform/metron-enrichment/pom.xml b/metron-platform/metron-enrichment/pom.xml index aab1826a56..e82b86bf2d 100644 --- a/metron-platform/metron-enrichment/pom.xml +++ b/metron-platform/metron-enrichment/pom.xml @@ -199,6 +199,14 @@ ${global_storm_version} provided + + org.apache.logging.log4j + log4j-api + + + org.apache.logging.log4j + log4j-core + servlet-api javax.servlet @@ -213,7 +221,18 @@ - + + org.apache.logging.log4j + log4j-api + ${global_log4j_core_version} + test + + + org.apache.logging.log4j + log4j-core + ${global_log4j_core_version} + test + com.google.guava guava diff --git a/metron-platform/metron-hbase/pom.xml b/metron-platform/metron-hbase/pom.xml index 98d7a36eb5..746a610ca6 100644 --- a/metron-platform/metron-hbase/pom.xml +++ b/metron-platform/metron-hbase/pom.xml @@ -139,6 +139,14 @@ ${global_storm_version} provided + + org.apache.logging.log4j + log4j-api + + + org.apache.logging.log4j + log4j-core + servlet-api javax.servlet diff --git a/metron-platform/metron-indexing/pom.xml b/metron-platform/metron-indexing/pom.xml index ea88154773..e9fe43e725 100644 --- a/metron-platform/metron-indexing/pom.xml +++ b/metron-platform/metron-indexing/pom.xml @@ -31,6 +31,12 @@ ${global_hbase_guava_version} + + org.apache.logging.log4j + log4j-core + 2.8.2 + test + org.apache.metron metron-common @@ -93,6 +99,10 @@ log4j-slf4j-impl org.apache.logging.log4j + + org.apache.logging.log4j + log4j-core + diff --git a/metron-platform/metron-indexing/src/main/java/org/apache/metron/indexing/dao/search/FieldType.java b/metron-platform/metron-indexing/src/main/java/org/apache/metron/indexing/dao/search/FieldType.java index 1f00cf589b..2abd997932 100644 --- a/metron-platform/metron-indexing/src/main/java/org/apache/metron/indexing/dao/search/FieldType.java +++ b/metron-platform/metron-indexing/src/main/java/org/apache/metron/indexing/dao/search/FieldType.java @@ -20,8 +20,10 @@ import com.fasterxml.jackson.annotation.JsonProperty; public enum FieldType { - @JsonProperty("string") - STRING("string"), + @JsonProperty("text") + TEXT("text"), + @JsonProperty("keyword") + KEYWORD("keyword"), @JsonProperty("ip") IP("ip"), @JsonProperty("integer") diff --git a/metron-platform/metron-indexing/src/test/java/org/apache/metron/indexing/dao/SearchIntegrationTest.java b/metron-platform/metron-indexing/src/test/java/org/apache/metron/indexing/dao/SearchIntegrationTest.java index 4d3ff9ba57..72e632fee4 100644 --- a/metron-platform/metron-indexing/src/test/java/org/apache/metron/indexing/dao/SearchIntegrationTest.java +++ b/metron-platform/metron-indexing/src/test/java/org/apache/metron/indexing/dao/SearchIntegrationTest.java @@ -1,3 +1,4 @@ + /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,6 +19,13 @@ package org.apache.metron.indexing.dao; import com.fasterxml.jackson.core.type.TypeReference; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; import org.adrianwalker.multilinestring.Multiline; import org.apache.metron.common.utils.JSONUtils; import org.apache.metron.indexing.dao.search.FieldType; @@ -34,7 +42,9 @@ import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; +import org.junit.Rule; import org.junit.Test; +import org.junit.rules.ExpectedException; import java.util.ArrayList; import java.util.Arrays; @@ -439,8 +449,21 @@ public synchronized void setup() throws Exception { } } + @Rule + public ExpectedException thrown = ExpectedException.none(); + @Test - public void test() throws Exception { + public void find_one_guid() throws Exception { + GetRequest request = JSONUtils.INSTANCE.load(findOneGuidQuery, GetRequest.class); + Optional> response = dao.getLatestResult(request); + Assert.assertTrue(response.isPresent()); + Map doc = response.get(); + Assert.assertEquals("bro", doc.get("source:type")); + Assert.assertEquals(3, doc.get("timestamp")); + } + + @Test + public void all_query_returns_all_results() throws Exception { //All Query Testcase { SearchRequest request = JSONUtils.INSTANCE.load(allQuery, SearchRequest.class); @@ -450,34 +473,29 @@ public void test() throws Exception { Assert.assertEquals(10, results.size()); for(int i = 0;i < 5;++i) { Assert.assertEquals("snort", results.get(i).getSource().get("source:type")); - Assert.assertEquals(10-i, results.get(i).getSource().get("timestamp")); + Assert.assertEquals(10 - i, results.get(i).getSource().get("timestamp")); } - for(int i = 5;i < 10;++i) { + for (int i = 5; i < 10; ++i) { Assert.assertEquals("bro", results.get(i).getSource().get("source:type")); - Assert.assertEquals(10-i, results.get(i).getSource().get("timestamp")); + Assert.assertEquals(10 - i, results.get(i).getSource().get("timestamp")); } } - //Find One Guid Testcase - { - GetRequest request = JSONUtils.INSTANCE.load(findOneGuidQuery, GetRequest.class); - Optional> response = dao.getLatestResult(request); - Assert.assertTrue(response.isPresent()); - Map doc = response.get(); - Assert.assertEquals("bro", doc.get("source:type")); - Assert.assertEquals(3, doc.get("timestamp")); - } //Get All Latest Guid Testcase { List request = JSONUtils.INSTANCE.load(getAllLatestQuery, new TypeReference>() { }); - Iterator response = dao.getAllLatest(request).iterator(); - Document bro2 = response.next(); - Assert.assertEquals("bro_1", bro2.getDocument().get("guid")); - Assert.assertEquals("bro", bro2.getDocument().get("source:type")); - Document snort2 = response.next(); - Assert.assertEquals("bro_2", snort2.getDocument().get("guid")); - Assert.assertEquals("bro", snort2.getDocument().get("source:type")); - Assert.assertFalse(response.hasNext()); + Map docs = new HashMap<>(); + + for(Document doc : dao.getAllLatest(request)) { + docs.put(doc.getGuid(), doc); + } + Assert.assertEquals(2, docs.size()); + Assert.assertTrue(docs.keySet().contains("bro-1")); + Assert.assertTrue(docs.keySet().contains("bro-2")); + for(Map.Entry kv : docs.entrySet()) { + Document d = kv.getValue(); + Assert.assertEquals("bro", d.getDocument().get("source:type")); + } } //Filter test case { @@ -679,43 +697,190 @@ public void test() throws Exception { SearchResponse response = dao.search(request); Assert.assertNull(response.getFacetCounts()); } - //Exceeded maximum results query - { - SearchRequest request = JSONUtils.INSTANCE.load(exceededMaxResultsQuery, SearchRequest.class); - try { - dao.search(request); - Assert.fail("Exception expected, but did not come."); - } - catch(InvalidSearchException ise) { - Assert.assertEquals("Search result size must be less than 100", ise.getMessage()); - } + } + + @Test + public void filter_query_filters_results() throws Exception { + SearchRequest request = JSONUtils.INSTANCE.load(filterQuery, SearchRequest.class); + SearchResponse response = dao.search(request); + Assert.assertEquals(3, response.getTotal()); + List results = response.getResults(); + Assert.assertEquals("snort", results.get(0).getSource().get("source:type")); + Assert.assertEquals(9, results.get(0).getSource().get("timestamp")); + Assert.assertEquals("snort", results.get(1).getSource().get("source:type")); + Assert.assertEquals(7, results.get(1).getSource().get("timestamp")); + Assert.assertEquals("bro", results.get(2).getSource().get("source:type")); + Assert.assertEquals(1, results.get(2).getSource().get("timestamp")); + } + + @Test + public void sort_query_sorts_results_ascending() throws Exception { + SearchRequest request = JSONUtils.INSTANCE.load(sortQuery, SearchRequest.class); + SearchResponse response = dao.search(request); + Assert.assertEquals(10, response.getTotal()); + List results = response.getResults(); + for (int i = 8001; i < 8011; ++i) { + Assert.assertEquals(i, results.get(i - 8001).getSource().get("ip_src_port")); } - // getColumnMetadata with multiple indices - { - Map fieldTypes = dao.getColumnMetadata(Arrays.asList("bro", "snort")); - Assert.assertEquals(15, fieldTypes.size()); - Assert.assertEquals(FieldType.STRING, fieldTypes.get("guid")); - Assert.assertEquals(FieldType.STRING, fieldTypes.get("source:type")); - Assert.assertEquals(FieldType.IP, fieldTypes.get("ip_src_addr")); - Assert.assertEquals(FieldType.INTEGER, fieldTypes.get("ip_src_port")); - Assert.assertEquals(FieldType.LONG, fieldTypes.get("long_field")); - Assert.assertEquals(FieldType.DATE, fieldTypes.get("timestamp")); - Assert.assertEquals(FieldType.FLOAT, fieldTypes.get("latitude")); - Assert.assertEquals(FieldType.DOUBLE, fieldTypes.get("score")); - Assert.assertEquals(FieldType.BOOLEAN, fieldTypes.get("is_alert")); - Assert.assertEquals(FieldType.OTHER, fieldTypes.get("location_point")); - Assert.assertEquals(FieldType.STRING, fieldTypes.get("bro_field")); - Assert.assertEquals(FieldType.INTEGER, fieldTypes.get("snort_field")); - Assert.assertEquals(FieldType.OTHER, fieldTypes.get("duplicate_name_field")); - Assert.assertEquals(FieldType.FLOAT, fieldTypes.get("threat:triage:score")); - Assert.assertEquals(FieldType.OTHER, fieldTypes.get("alert")); + } + + @Test + public void results_are_paginated() throws Exception { + SearchRequest request = JSONUtils.INSTANCE.load(paginationQuery, SearchRequest.class); + SearchResponse response = dao.search(request); + Assert.assertEquals(10, response.getTotal()); + List results = response.getResults(); + Assert.assertEquals(3, results.size()); + Assert.assertEquals("snort", results.get(0).getSource().get("source:type")); + Assert.assertEquals(6, results.get(0).getSource().get("timestamp")); + Assert.assertEquals("bro", results.get(1).getSource().get("source:type")); + Assert.assertEquals(5, results.get(1).getSource().get("timestamp")); + Assert.assertEquals("bro", results.get(2).getSource().get("source:type")); + Assert.assertEquals(4, results.get(2).getSource().get("timestamp")); + } + + @Test + public void returns_results_only_for_specified_indices() throws Exception { + SearchRequest request = JSONUtils.INSTANCE.load(indexQuery, SearchRequest.class); + SearchResponse response = dao.search(request); + Assert.assertEquals(5, response.getTotal()); + List results = response.getResults(); + for (int i = 5, j = 0; i > 0; i--, j++) { + Assert.assertEquals("bro", results.get(j).getSource().get("source:type")); + Assert.assertEquals(i, results.get(j).getSource().get("timestamp")); } + } + + @Test + public void facet_query_yields_field_types() throws Exception { + SearchRequest request = JSONUtils.INSTANCE.load(facetQuery, SearchRequest.class); + SearchResponse response = dao.search(request); + Assert.assertEquals(12, response.getTotal()); + Map> facetCounts = response.getFacetCounts(); + Assert.assertEquals(8, facetCounts.size()); + Map sourceTypeCounts = facetCounts.get("source:type"); + Assert.assertEquals(2, sourceTypeCounts.size()); + Assert.assertEquals(new Long(5), sourceTypeCounts.get("bro")); + Assert.assertEquals(new Long(5), sourceTypeCounts.get("snort")); + Map ipSrcAddrCounts = facetCounts.get("ip_src_addr"); + Assert.assertEquals(8, ipSrcAddrCounts.size()); + Assert.assertEquals(new Long(3), ipSrcAddrCounts.get("192.168.1.1")); + Assert.assertEquals(new Long(1), ipSrcAddrCounts.get("192.168.1.2")); + Assert.assertEquals(new Long(1), ipSrcAddrCounts.get("192.168.1.3")); + Assert.assertEquals(new Long(1), ipSrcAddrCounts.get("192.168.1.4")); + Assert.assertEquals(new Long(1), ipSrcAddrCounts.get("192.168.1.5")); + Assert.assertEquals(new Long(1), ipSrcAddrCounts.get("192.168.1.6")); + Assert.assertEquals(new Long(1), ipSrcAddrCounts.get("192.168.1.7")); + Assert.assertEquals(new Long(1), ipSrcAddrCounts.get("192.168.1.8")); + Map ipSrcPortCounts = facetCounts.get("ip_src_port"); + Assert.assertEquals(10, ipSrcPortCounts.size()); + Assert.assertEquals(new Long(1), ipSrcPortCounts.get("8001")); + Assert.assertEquals(new Long(1), ipSrcPortCounts.get("8002")); + Assert.assertEquals(new Long(1), ipSrcPortCounts.get("8003")); + Assert.assertEquals(new Long(1), ipSrcPortCounts.get("8004")); + Assert.assertEquals(new Long(1), ipSrcPortCounts.get("8005")); + Assert.assertEquals(new Long(1), ipSrcPortCounts.get("8006")); + Assert.assertEquals(new Long(1), ipSrcPortCounts.get("8007")); + Assert.assertEquals(new Long(1), ipSrcPortCounts.get("8008")); + Assert.assertEquals(new Long(1), ipSrcPortCounts.get("8009")); + Assert.assertEquals(new Long(1), ipSrcPortCounts.get("8010")); + Map longFieldCounts = facetCounts.get("long_field"); + Assert.assertEquals(2, longFieldCounts.size()); + Assert.assertEquals(new Long(8), longFieldCounts.get("10000")); + Assert.assertEquals(new Long(2), longFieldCounts.get("20000")); + Map timestampCounts = facetCounts.get("timestamp"); + Assert.assertEquals(10, timestampCounts.size()); + Assert.assertEquals(new Long(1), timestampCounts.get("1")); + Assert.assertEquals(new Long(1), timestampCounts.get("2")); + Assert.assertEquals(new Long(1), timestampCounts.get("3")); + Assert.assertEquals(new Long(1), timestampCounts.get("4")); + Assert.assertEquals(new Long(1), timestampCounts.get("5")); + Assert.assertEquals(new Long(1), timestampCounts.get("6")); + Assert.assertEquals(new Long(1), timestampCounts.get("7")); + Assert.assertEquals(new Long(1), timestampCounts.get("8")); + Assert.assertEquals(new Long(1), timestampCounts.get("9")); + Assert.assertEquals(new Long(1), timestampCounts.get("10")); + Map latitudeCounts = facetCounts.get("latitude"); + Assert.assertEquals(2, latitudeCounts.size()); + List latitudeKeys = new ArrayList<>(latitudeCounts.keySet()); + Collections.sort(latitudeKeys); + Assert.assertEquals(48.0001, Double.parseDouble(latitudeKeys.get(0)), 0.00001); + Assert.assertEquals(48.5839, Double.parseDouble(latitudeKeys.get(1)), 0.00001); + Assert.assertEquals(new Long(2), latitudeCounts.get(latitudeKeys.get(0))); + Assert.assertEquals(new Long(8), latitudeCounts.get(latitudeKeys.get(1))); + Map scoreFieldCounts = facetCounts.get("score"); + Assert.assertEquals(4, scoreFieldCounts.size()); + List scoreFieldKeys = new ArrayList<>(scoreFieldCounts.keySet()); + Collections.sort(scoreFieldKeys); + Assert.assertEquals(10.0, Double.parseDouble(scoreFieldKeys.get(0)), 0.00001); + Assert.assertEquals(20.0, Double.parseDouble(scoreFieldKeys.get(1)), 0.00001); + Assert.assertEquals(50.0, Double.parseDouble(scoreFieldKeys.get(2)), 0.00001); + Assert.assertEquals(98.0, Double.parseDouble(scoreFieldKeys.get(3)), 0.00001); + Assert.assertEquals(new Long(4), scoreFieldCounts.get(scoreFieldKeys.get(0))); + Assert.assertEquals(new Long(2), scoreFieldCounts.get(scoreFieldKeys.get(1))); + Assert.assertEquals(new Long(3), scoreFieldCounts.get(scoreFieldKeys.get(2))); + Assert.assertEquals(new Long(1), scoreFieldCounts.get(scoreFieldKeys.get(3))); + Map isAlertCounts = facetCounts.get("is_alert"); + Assert.assertEquals(2, isAlertCounts.size()); + Assert.assertEquals(new Long(6), isAlertCounts.get("true")); + Assert.assertEquals(new Long(4), isAlertCounts.get("false")); + } + + @Test + public void bad_facet_query_throws_exception() throws Exception { + thrown.expect(InvalidSearchException.class); + thrown.expectMessage("Failed to execute search"); + SearchRequest request = JSONUtils.INSTANCE.load(badFacetQuery, SearchRequest.class); + dao.search(request); + } + + @Test + public void disabled_facet_query_returns_null_count() throws Exception { + SearchRequest request = JSONUtils.INSTANCE.load(disabledFacetQuery, SearchRequest.class); + SearchResponse response = dao.search(request); + Assert.assertNull(response.getFacetCounts()); + } + + @Test + public void exceeding_max_resulsts_throws_exception() throws Exception { + thrown.expect(InvalidSearchException.class); + thrown.expectMessage("Search result size must be less than 100"); + SearchRequest request = JSONUtils.INSTANCE.load(exceededMaxResultsQuery, SearchRequest.class); + dao.search(request); + } + + @Test + public void returns_column_data_for_multiple_indices() throws Exception { + Map fieldTypes = dao.getColumnMetadata(Arrays.asList("bro", "snort")); + Assert.assertEquals(15, fieldTypes.size()); + Assert.assertEquals(FieldType.KEYWORD, fieldTypes.get("guid")); + Assert.assertEquals(FieldType.TEXT, fieldTypes.get("source:type")); + Assert.assertEquals(FieldType.IP, fieldTypes.get("ip_src_addr")); + Assert.assertEquals(FieldType.INTEGER, fieldTypes.get("ip_src_port")); + Assert.assertEquals(FieldType.LONG, fieldTypes.get("long_field")); + Assert.assertEquals(FieldType.DATE, fieldTypes.get("timestamp")); + Assert.assertEquals(FieldType.FLOAT, fieldTypes.get("latitude")); + Assert.assertEquals(FieldType.DOUBLE, fieldTypes.get("score")); + Assert.assertEquals(FieldType.BOOLEAN, fieldTypes.get("is_alert")); + Assert.assertEquals(FieldType.OTHER, fieldTypes.get("location_point")); + Assert.assertEquals(FieldType.TEXT, fieldTypes.get("bro_field")); + Assert.assertEquals(FieldType.INTEGER, fieldTypes.get("snort_field")); + //NOTE: This is because the field is in both bro and snort and they have different types. + Assert.assertEquals(FieldType.OTHER, fieldTypes.get("duplicate_name_field")); + Assert.assertEquals(FieldType.FLOAT, fieldTypes.get("threat:triage:score")); + Assert.assertEquals(FieldType.OTHER, fieldTypes.get("alert")); + } + + @Test + public void returns_column_metadata_for_specified_indices() throws Exception { // getColumnMetadata with only bro { Map fieldTypes = dao.getColumnMetadata(Collections.singletonList("bro")); Assert.assertEquals(13, fieldTypes.size()); - Assert.assertEquals(FieldType.STRING, fieldTypes.get("guid")); - Assert.assertEquals(FieldType.STRING, fieldTypes.get("source:type")); + Assert.assertEquals(FieldType.TEXT, fieldTypes.get("bro_field")); + Assert.assertEquals(FieldType.TEXT, fieldTypes.get("duplicate_name_field")); + Assert.assertEquals(FieldType.KEYWORD, fieldTypes.get("guid")); + Assert.assertEquals(FieldType.TEXT, fieldTypes.get("source:type")); Assert.assertEquals(FieldType.IP, fieldTypes.get("ip_src_addr")); Assert.assertEquals(FieldType.INTEGER, fieldTypes.get("ip_src_port")); Assert.assertEquals(FieldType.LONG, fieldTypes.get("long_field")); @@ -724,8 +889,8 @@ public void test() throws Exception { Assert.assertEquals(FieldType.DOUBLE, fieldTypes.get("score")); Assert.assertEquals(FieldType.BOOLEAN, fieldTypes.get("is_alert")); Assert.assertEquals(FieldType.OTHER, fieldTypes.get("location_point")); - Assert.assertEquals(FieldType.STRING, fieldTypes.get("bro_field")); - Assert.assertEquals(FieldType.STRING, fieldTypes.get("duplicate_name_field")); + Assert.assertEquals(FieldType.TEXT, fieldTypes.get("bro_field")); + Assert.assertEquals(FieldType.TEXT, fieldTypes.get("duplicate_name_field")); Assert.assertEquals(FieldType.OTHER, fieldTypes.get("alert")); } // getColumnMetadata with only snort @@ -733,8 +898,9 @@ public void test() throws Exception { Map fieldTypes = dao.getColumnMetadata(Collections.singletonList("snort")); Assert.assertEquals(14, fieldTypes.size()); Assert.assertEquals(FieldType.INTEGER, fieldTypes.get("snort_field")); - Assert.assertEquals(FieldType.STRING, fieldTypes.get("guid")); - Assert.assertEquals(FieldType.STRING, fieldTypes.get("source:type")); + Assert.assertEquals(FieldType.INTEGER, fieldTypes.get("duplicate_name_field")); + Assert.assertEquals(FieldType.KEYWORD, fieldTypes.get("guid")); + Assert.assertEquals(FieldType.TEXT, fieldTypes.get("source:type")); Assert.assertEquals(FieldType.IP, fieldTypes.get("ip_src_addr")); Assert.assertEquals(FieldType.INTEGER, fieldTypes.get("ip_src_port")); Assert.assertEquals(FieldType.LONG, fieldTypes.get("long_field")); @@ -751,204 +917,208 @@ public void test() throws Exception { Map fieldTypes = dao.getColumnMetadata(Collections.singletonList("someindex")); Assert.assertEquals(0, fieldTypes.size()); } - //Fields query - { - SearchRequest request = JSONUtils.INSTANCE.load(fieldsQuery, SearchRequest.class); - SearchResponse response = dao.search(request); - Assert.assertEquals(10, response.getTotal()); - List results = response.getResults(); - for(int i = 0;i < 5;++i) { - Map source = results.get(i).getSource(); - Assert.assertEquals(1, source.size()); - Assert.assertNotNull(source.get("ip_src_addr")); - } - for(int i = 5;i < 10;++i) { - Map source = results.get(i).getSource(); - Assert.assertEquals(1, source.size()); - Assert.assertNotNull(source.get("ip_src_addr")); - } - } - //Meta Alerts Fields query - { - SearchRequest request = JSONUtils.INSTANCE.load(metaAlertsFieldQuery, SearchRequest.class); - SearchResponse response = dao.search(request); - Assert.assertEquals(2, response.getTotal()); - List results = response.getResults(); - for (int i = 0;i < 2;++i) { - Map source = results.get(i).getSource(); - Assert.assertEquals(1, source.size()); - Assert.assertEquals(source.get("guid"), "meta_" + (i + 1)); - } - } - //No results fields query - { - SearchRequest request = JSONUtils.INSTANCE.load(noResultsFieldsQuery, SearchRequest.class); - SearchResponse response = dao.search(request); - Assert.assertEquals(0, response.getTotal()); - } + } + + + @Test + public void group_by_ip_query() throws Exception { + GroupRequest request = JSONUtils.INSTANCE.load(groupByIpQuery, GroupRequest.class); + GroupResponse response = dao.group(request); + + // expect only 1 group for 'ip_src_addr' + Assert.assertEquals("ip_src_addr", response.getGroupedBy()); + + // there are 8 different 'ip_src_addr' values + List groups = response.getGroupResults(); + Assert.assertEquals(8, groups.size()); + + // expect dotted-decimal notation in descending order + Assert.assertEquals("192.168.1.8", groups.get(0).getKey()); + Assert.assertEquals("192.168.1.7", groups.get(1).getKey()); + Assert.assertEquals("192.168.1.6", groups.get(2).getKey()); + Assert.assertEquals("192.168.1.5", groups.get(3).getKey()); + Assert.assertEquals("192.168.1.4", groups.get(4).getKey()); + Assert.assertEquals("192.168.1.3", groups.get(5).getKey()); + Assert.assertEquals("192.168.1.2", groups.get(6).getKey()); + Assert.assertEquals("192.168.1.1", groups.get(7).getKey()); + } + + @Test + public void no_results_returned_when_query_does_not_match() throws Exception { + SearchRequest request = JSONUtils.INSTANCE.load(noResultsFieldsQuery, SearchRequest.class); + SearchResponse response = dao.search(request); + Assert.assertEquals(0, response.getTotal()); + } + + @Test + public void group_by_returns_results_in_groups() throws Exception { // Group by test case, default order is count descending - { - GroupRequest request = JSONUtils.INSTANCE.load(groupByQuery, GroupRequest.class); - GroupResponse response = dao.group(request); - Assert.assertEquals("is_alert", response.getGroupedBy()); - List isAlertGroups = response.getGroupResults(); - Assert.assertEquals(2, isAlertGroups.size()); - - // isAlert == true group - GroupResult trueGroup = isAlertGroups.get(0); - Assert.assertEquals("true", trueGroup.getKey()); - Assert.assertEquals(6, trueGroup.getTotal()); - Assert.assertEquals("latitude", trueGroup.getGroupedBy()); - Assert.assertEquals(198.0, trueGroup.getScore(), 0.00001); - List trueLatitudeGroups = trueGroup.getGroupResults(); - Assert.assertEquals(2, trueLatitudeGroups.size()); - - // isAlert == true && latitude == 48.5839 group - GroupResult trueLatitudeGroup2 = trueLatitudeGroups.get(0); - Assert.assertEquals(48.5839, Double.parseDouble(trueLatitudeGroup2.getKey()), 0.00001); - Assert.assertEquals(5, trueLatitudeGroup2.getTotal()); - Assert.assertEquals(148.0, trueLatitudeGroup2.getScore(), 0.00001); - - // isAlert == true && latitude == 48.0001 group - GroupResult trueLatitudeGroup1 = trueLatitudeGroups.get(1); - Assert.assertEquals(48.0001, Double.parseDouble(trueLatitudeGroup1.getKey()), 0.00001); - Assert.assertEquals(1, trueLatitudeGroup1.getTotal()); - Assert.assertEquals(50.0, trueLatitudeGroup1.getScore(), 0.00001); - - // isAlert == false group - GroupResult falseGroup = isAlertGroups.get(1); - Assert.assertEquals("false", falseGroup.getKey()); - Assert.assertEquals("latitude", falseGroup.getGroupedBy()); - Assert.assertEquals(130.0, falseGroup.getScore(), 0.00001); - List falseLatitudeGroups = falseGroup.getGroupResults(); - Assert.assertEquals(2, falseLatitudeGroups.size()); - - // isAlert == false && latitude == 48.5839 group - GroupResult falseLatitudeGroup2 = falseLatitudeGroups.get(0); - Assert.assertEquals(48.5839, Double.parseDouble(falseLatitudeGroup2.getKey()), 0.00001); - Assert.assertEquals(3, falseLatitudeGroup2.getTotal()); - Assert.assertEquals(80.0, falseLatitudeGroup2.getScore(), 0.00001); - - // isAlert == false && latitude == 48.0001 group - GroupResult falseLatitudeGroup1 = falseLatitudeGroups.get(1); - Assert.assertEquals(48.0001, Double.parseDouble(falseLatitudeGroup1.getKey()), 0.00001); - Assert.assertEquals(1, falseLatitudeGroup1.getTotal()); - Assert.assertEquals(50.0, falseLatitudeGroup1.getScore(), 0.00001); - } + GroupRequest request = JSONUtils.INSTANCE.load(groupByQuery, GroupRequest.class); + GroupResponse response = dao.group(request); + Assert.assertEquals("is_alert", response.getGroupedBy()); + List isAlertGroups = response.getGroupResults(); + Assert.assertEquals(2, isAlertGroups.size()); + + // isAlert == true group + GroupResult trueGroup = isAlertGroups.get(0); + Assert.assertEquals("true", trueGroup.getKey()); + Assert.assertEquals(6, trueGroup.getTotal()); + Assert.assertEquals("latitude", trueGroup.getGroupedBy()); + Assert.assertEquals(198.0, trueGroup.getScore(), 0.00001); + List trueLatitudeGroups = trueGroup.getGroupResults(); + Assert.assertEquals(2, trueLatitudeGroups.size()); + + + // isAlert == true && latitude == 48.5839 group + GroupResult trueLatitudeGroup2 = trueLatitudeGroups.get(0); + Assert.assertEquals(48.5839, Double.parseDouble(trueLatitudeGroup2.getKey()), 0.00001); + Assert.assertEquals(5, trueLatitudeGroup2.getTotal()); + Assert.assertEquals(148.0, trueLatitudeGroup2.getScore(), 0.00001); + + // isAlert == true && latitude == 48.0001 group + GroupResult trueLatitudeGroup1 = trueLatitudeGroups.get(1); + Assert.assertEquals(48.0001, Double.parseDouble(trueLatitudeGroup1.getKey()), 0.00001); + Assert.assertEquals(1, trueLatitudeGroup1.getTotal()); + Assert.assertEquals(50.0, trueLatitudeGroup1.getScore(), 0.00001); + + // isAlert == false group + GroupResult falseGroup = isAlertGroups.get(1); + Assert.assertEquals("false", falseGroup.getKey()); + Assert.assertEquals("latitude", falseGroup.getGroupedBy()); + Assert.assertEquals(130.0, falseGroup.getScore(), 0.00001); + List falseLatitudeGroups = falseGroup.getGroupResults(); + Assert.assertEquals(2, falseLatitudeGroups.size()); + + // isAlert == false && latitude == 48.5839 group + GroupResult falseLatitudeGroup2 = falseLatitudeGroups.get(0); + Assert.assertEquals(48.5839, Double.parseDouble(falseLatitudeGroup2.getKey()), 0.00001); + Assert.assertEquals(3, falseLatitudeGroup2.getTotal()); + Assert.assertEquals(80.0, falseLatitudeGroup2.getScore(), 0.00001); + + // isAlert == false && latitude == 48.0001 group + GroupResult falseLatitudeGroup1 = falseLatitudeGroups.get(1); + Assert.assertEquals(48.0001, Double.parseDouble(falseLatitudeGroup1.getKey()), 0.00001); + Assert.assertEquals(1, falseLatitudeGroup1.getTotal()); + Assert.assertEquals(50.0, falseLatitudeGroup1.getScore(), 0.00001); + } + + @Test + public void group_by_returns_results_in_sorted_groups() throws Exception { // Group by with sorting test case where is_alert is sorted by count ascending and ip_src_addr is sorted by term descending - { - GroupRequest request = JSONUtils.INSTANCE.load(sortedGroupByQuery, GroupRequest.class); - GroupResponse response = dao.group(request); - Assert.assertEquals("is_alert", response.getGroupedBy()); - List isAlertGroups = response.getGroupResults(); - Assert.assertEquals(2, isAlertGroups.size()); - - // isAlert == false group - GroupResult falseGroup = isAlertGroups.get(0); - Assert.assertEquals(4, falseGroup.getTotal()); - Assert.assertEquals("ip_src_addr", falseGroup.getGroupedBy()); - List falseIpSrcAddrGroups = falseGroup.getGroupResults(); - Assert.assertEquals(4, falseIpSrcAddrGroups.size()); - - // isAlert == false && ip_src_addr == 192.168.1.8 group - GroupResult falseIpSrcAddrGroup1 = falseIpSrcAddrGroups.get(0); - Assert.assertEquals("192.168.1.8", falseIpSrcAddrGroup1.getKey()); - Assert.assertEquals(1, falseIpSrcAddrGroup1.getTotal()); - Assert.assertNull(falseIpSrcAddrGroup1.getGroupedBy()); - Assert.assertNull(falseIpSrcAddrGroup1.getGroupResults()); - - // isAlert == false && ip_src_addr == 192.168.1.7 group - GroupResult falseIpSrcAddrGroup2 = falseIpSrcAddrGroups.get(1); - Assert.assertEquals("192.168.1.7", falseIpSrcAddrGroup2.getKey()); - Assert.assertEquals(1, falseIpSrcAddrGroup2.getTotal()); - Assert.assertNull(falseIpSrcAddrGroup2.getGroupedBy()); - Assert.assertNull(falseIpSrcAddrGroup2.getGroupResults()); - - // isAlert == false && ip_src_addr == 192.168.1.6 group - GroupResult falseIpSrcAddrGroup3 = falseIpSrcAddrGroups.get(2); - Assert.assertEquals("192.168.1.6", falseIpSrcAddrGroup3.getKey()); - Assert.assertEquals(1, falseIpSrcAddrGroup3.getTotal()); - Assert.assertNull(falseIpSrcAddrGroup3.getGroupedBy()); - Assert.assertNull(falseIpSrcAddrGroup3.getGroupResults()); - - // isAlert == false && ip_src_addr == 192.168.1.2 group - GroupResult falseIpSrcAddrGroup4 = falseIpSrcAddrGroups.get(3); - Assert.assertEquals("192.168.1.2", falseIpSrcAddrGroup4.getKey()); - Assert.assertEquals(1, falseIpSrcAddrGroup4.getTotal()); - Assert.assertNull(falseIpSrcAddrGroup4.getGroupedBy()); - Assert.assertNull(falseIpSrcAddrGroup4.getGroupResults()); - - // isAlert == false group - GroupResult trueGroup = isAlertGroups.get(1); - Assert.assertEquals(6, trueGroup.getTotal()); - Assert.assertEquals("ip_src_addr", trueGroup.getGroupedBy()); - List trueIpSrcAddrGroups = trueGroup.getGroupResults(); - Assert.assertEquals(4, trueIpSrcAddrGroups.size()); - - // isAlert == false && ip_src_addr == 192.168.1.5 group - GroupResult trueIpSrcAddrGroup1 = trueIpSrcAddrGroups.get(0); - Assert.assertEquals("192.168.1.5", trueIpSrcAddrGroup1.getKey()); - Assert.assertEquals(1, trueIpSrcAddrGroup1.getTotal()); - Assert.assertNull(trueIpSrcAddrGroup1.getGroupedBy()); - Assert.assertNull(trueIpSrcAddrGroup1.getGroupResults()); - - // isAlert == false && ip_src_addr == 192.168.1.4 group - GroupResult trueIpSrcAddrGroup2 = trueIpSrcAddrGroups.get(1); - Assert.assertEquals("192.168.1.4", trueIpSrcAddrGroup2.getKey()); - Assert.assertEquals(1, trueIpSrcAddrGroup2.getTotal()); - Assert.assertNull(trueIpSrcAddrGroup2.getGroupedBy()); - Assert.assertNull(trueIpSrcAddrGroup2.getGroupResults()); - - // isAlert == false && ip_src_addr == 192.168.1.3 group - GroupResult trueIpSrcAddrGroup3 = trueIpSrcAddrGroups.get(2); - Assert.assertEquals("192.168.1.3", trueIpSrcAddrGroup3.getKey()); - Assert.assertEquals(1, trueIpSrcAddrGroup3.getTotal()); - Assert.assertNull(trueIpSrcAddrGroup3.getGroupedBy()); - Assert.assertNull(trueIpSrcAddrGroup3.getGroupResults()); - - // isAlert == false && ip_src_addr == 192.168.1.1 group - GroupResult trueIpSrcAddrGroup4 = trueIpSrcAddrGroups.get(3); - Assert.assertEquals("192.168.1.1", trueIpSrcAddrGroup4.getKey()); - Assert.assertEquals(3, trueIpSrcAddrGroup4.getTotal()); - Assert.assertNull(trueIpSrcAddrGroup4.getGroupedBy()); - Assert.assertNull(trueIpSrcAddrGroup4.getGroupResults()); + GroupRequest request = JSONUtils.INSTANCE.load(sortedGroupByQuery, GroupRequest.class); + GroupResponse response = dao.group(request); + Assert.assertEquals("is_alert", response.getGroupedBy()); + List isAlertGroups = response.getGroupResults(); + Assert.assertEquals(2, isAlertGroups.size()); + + // isAlert == false group + GroupResult falseGroup = isAlertGroups.get(0); + Assert.assertEquals(4, falseGroup.getTotal()); + Assert.assertEquals("ip_src_addr", falseGroup.getGroupedBy()); + List falseIpSrcAddrGroups = falseGroup.getGroupResults(); + Assert.assertEquals(4, falseIpSrcAddrGroups.size()); + + // isAlert == false && ip_src_addr == 192.168.1.8 group + GroupResult falseIpSrcAddrGroup1 = falseIpSrcAddrGroups.get(0); + Assert.assertEquals("192.168.1.8", falseIpSrcAddrGroup1.getKey()); + Assert.assertEquals(1, falseIpSrcAddrGroup1.getTotal()); + Assert.assertNull(falseIpSrcAddrGroup1.getGroupedBy()); + Assert.assertNull(falseIpSrcAddrGroup1.getGroupResults()); + + // isAlert == false && ip_src_addr == 192.168.1.7 group + GroupResult falseIpSrcAddrGroup2 = falseIpSrcAddrGroups.get(1); + Assert.assertEquals("192.168.1.7", falseIpSrcAddrGroup2.getKey()); + Assert.assertEquals(1, falseIpSrcAddrGroup2.getTotal()); + Assert.assertNull(falseIpSrcAddrGroup2.getGroupedBy()); + Assert.assertNull(falseIpSrcAddrGroup2.getGroupResults()); + + // isAlert == false && ip_src_addr == 192.168.1.6 group + GroupResult falseIpSrcAddrGroup3 = falseIpSrcAddrGroups.get(2); + Assert.assertEquals("192.168.1.6", falseIpSrcAddrGroup3.getKey()); + Assert.assertEquals(1, falseIpSrcAddrGroup3.getTotal()); + Assert.assertNull(falseIpSrcAddrGroup3.getGroupedBy()); + Assert.assertNull(falseIpSrcAddrGroup3.getGroupResults()); + + // isAlert == false && ip_src_addr == 192.168.1.2 group + GroupResult falseIpSrcAddrGroup4 = falseIpSrcAddrGroups.get(3); + Assert.assertEquals("192.168.1.2", falseIpSrcAddrGroup4.getKey()); + Assert.assertEquals(1, falseIpSrcAddrGroup4.getTotal()); + Assert.assertNull(falseIpSrcAddrGroup4.getGroupedBy()); + Assert.assertNull(falseIpSrcAddrGroup4.getGroupResults()); + + // isAlert == false group + GroupResult trueGroup = isAlertGroups.get(1); + Assert.assertEquals(6, trueGroup.getTotal()); + Assert.assertEquals("ip_src_addr", trueGroup.getGroupedBy()); + List trueIpSrcAddrGroups = trueGroup.getGroupResults(); + Assert.assertEquals(4, trueIpSrcAddrGroups.size()); + + // isAlert == false && ip_src_addr == 192.168.1.5 group + GroupResult trueIpSrcAddrGroup1 = trueIpSrcAddrGroups.get(0); + Assert.assertEquals("192.168.1.5", trueIpSrcAddrGroup1.getKey()); + Assert.assertEquals(1, trueIpSrcAddrGroup1.getTotal()); + Assert.assertNull(trueIpSrcAddrGroup1.getGroupedBy()); + Assert.assertNull(trueIpSrcAddrGroup1.getGroupResults()); + + // isAlert == false && ip_src_addr == 192.168.1.4 group + GroupResult trueIpSrcAddrGroup2 = trueIpSrcAddrGroups.get(1); + Assert.assertEquals("192.168.1.4", trueIpSrcAddrGroup2.getKey()); + Assert.assertEquals(1, trueIpSrcAddrGroup2.getTotal()); + Assert.assertNull(trueIpSrcAddrGroup2.getGroupedBy()); + Assert.assertNull(trueIpSrcAddrGroup2.getGroupResults()); + + // isAlert == false && ip_src_addr == 192.168.1.3 group + GroupResult trueIpSrcAddrGroup3 = trueIpSrcAddrGroups.get(2); + Assert.assertEquals("192.168.1.3", trueIpSrcAddrGroup3.getKey()); + Assert.assertEquals(1, trueIpSrcAddrGroup3.getTotal()); + Assert.assertNull(trueIpSrcAddrGroup3.getGroupedBy()); + Assert.assertNull(trueIpSrcAddrGroup3.getGroupResults()); + + // isAlert == false && ip_src_addr == 192.168.1.1 group + GroupResult trueIpSrcAddrGroup4 = trueIpSrcAddrGroups.get(3); + Assert.assertEquals("192.168.1.1", trueIpSrcAddrGroup4.getKey()); + Assert.assertEquals(3, trueIpSrcAddrGroup4.getTotal()); + Assert.assertNull(trueIpSrcAddrGroup4.getGroupedBy()); + Assert.assertNull(trueIpSrcAddrGroup4.getGroupResults()); + } + + @Test + public void throws_exception_on_aggregation_queries_on_non_string_non_numeric_fields() + throws Exception { + thrown.expect(InvalidSearchException.class); + thrown.expectMessage("Failed to execute search"); + GroupRequest request = JSONUtils.INSTANCE.load(badGroupQuery, GroupRequest.class); + dao.group(request); + } + + @Test + public void queries_fields() throws Exception { + SearchRequest request = JSONUtils.INSTANCE.load(fieldsQuery, SearchRequest.class); + SearchResponse response = dao.search(request); + Assert.assertEquals(10, response.getTotal()); + List results = response.getResults(); + for (int i = 0; i < 5; ++i) { + Map source = results.get(i).getSource(); + Assert.assertEquals(1, source.size()); + Assert.assertNotNull(source.get("ip_src_addr")); } - //Bad group query - { - GroupRequest request = JSONUtils.INSTANCE.load(badGroupQuery, GroupRequest.class); - try { - dao.group(request); - Assert.fail("Exception expected, but did not come."); - } - catch(InvalidSearchException ise) { - // success - } + for (int i = 5; i < 10; ++i) { + Map source = results.get(i).getSource(); + Assert.assertEquals(1, source.size()); + Assert.assertNotNull(source.get("ip_src_addr")); } - //Group by IP query - { - { - GroupRequest request = JSONUtils.INSTANCE.load(groupByIpQuery, GroupRequest.class); - GroupResponse response = dao.group(request); - - // expect only 1 group for 'ip_src_addr' - Assert.assertEquals("ip_src_addr", response.getGroupedBy()); - - // there are 8 different 'ip_src_addr' values - List groups = response.getGroupResults(); - Assert.assertEquals(8, groups.size()); - - // expect dotted-decimal notation in descending order - Assert.assertEquals("192.168.1.8", groups.get(0).getKey()); - Assert.assertEquals("192.168.1.7", groups.get(1).getKey()); - Assert.assertEquals("192.168.1.6", groups.get(2).getKey()); - Assert.assertEquals("192.168.1.5", groups.get(3).getKey()); - Assert.assertEquals("192.168.1.4", groups.get(4).getKey()); - Assert.assertEquals("192.168.1.3", groups.get(5).getKey()); - Assert.assertEquals("192.168.1.2", groups.get(6).getKey()); - Assert.assertEquals("192.168.1.1", groups.get(7).getKey()); - } - + } + @Test + public void searches_metaalerts_fields() throws Exception { + SearchRequest request = JSONUtils.INSTANCE.load(metaAlertsFieldQuery, SearchRequest.class); + SearchResponse response = dao.search(request); + Assert.assertEquals(2, response.getTotal()); + List results = response.getResults(); + for (int i = 0; i < 2; ++i) { + Map source = results.get(i).getSource(); + Assert.assertEquals(1, source.size()); + Assert.assertEquals(source.get("guid"), "meta_" + (i + 1)); } } @@ -960,4 +1130,4 @@ public static void stop() throws Exception { protected abstract IndexDao createDao() throws Exception; protected abstract InMemoryComponent startIndex() throws Exception; protected abstract void loadTestData() throws Exception; -} +} \ No newline at end of file diff --git a/metron-platform/metron-indexing/src/test/java/org/apache/metron/indexing/integration/IndexingIntegrationTest.java b/metron-platform/metron-indexing/src/test/java/org/apache/metron/indexing/integration/IndexingIntegrationTest.java index c0f9919f25..ac6f90a60c 100644 --- a/metron-platform/metron-indexing/src/test/java/org/apache/metron/indexing/integration/IndexingIntegrationTest.java +++ b/metron-platform/metron-indexing/src/test/java/org/apache/metron/indexing/integration/IndexingIntegrationTest.java @@ -56,8 +56,8 @@ public abstract class IndexingIntegrationTest extends BaseIntegrationTest { protected String sampleParsedPath = TestConstants.SAMPLE_DATA_PARSED_PATH + "TestExampleParsed"; protected String fluxPath = "../metron-indexing/src/main/flux/indexing/remote.yaml"; protected String testSensorType = "test"; - - + protected final int NUM_RETRIES = 100; + protected final long TOTAL_TIME_MS = 150000L; public static List> readDocsFromDisk(String hdfsDirStr) throws IOException { List> ret = new ArrayList<>(); File hdfsDir = new File(hdfsDirStr); @@ -180,8 +180,8 @@ public void test() throws Exception { .withComponent("storm", fluxComponent) .withComponent("search", getSearchComponent(topologyProperties)) .withMillisecondsBetweenAttempts(1500) - .withNumRetries(100) - .withMaxTimeMS(150000) + .withNumRetries(NUM_RETRIES) + .withMaxTimeMS(TOTAL_TIME_MS) .withCustomShutdownOrder(new String[] {"search","storm","config","kafka","zk"}) .build(); @@ -198,8 +198,6 @@ public void test() throws Exception { // on the field name converter assertInputDocsMatchOutputs(inputDocs, docs, getFieldNameConverter()); assertInputDocsMatchOutputs(inputDocs, readDocsFromDisk(hdfsDir), x -> x); - } catch(Throwable e) { - e.printStackTrace(); } finally { if(runner != null) { diff --git a/metron-platform/metron-integration-test/pom.xml b/metron-platform/metron-integration-test/pom.xml index 72a785cd0d..cc72849ce8 100644 --- a/metron-platform/metron-integration-test/pom.xml +++ b/metron-platform/metron-integration-test/pom.xml @@ -53,6 +53,14 @@ log4j-slf4j-impl org.apache.logging.log4j + + org.apache.logging.log4j + log4j-core + + + org.apache.logging.log4j + log4j-api + diff --git a/metron-platform/metron-integration-test/src/main/java/org/apache/metron/integration/utils/TestUtils.java b/metron-platform/metron-integration-test/src/main/java/org/apache/metron/integration/utils/TestUtils.java index 9577a43500..0c37a35d35 100644 --- a/metron-platform/metron-integration-test/src/main/java/org/apache/metron/integration/utils/TestUtils.java +++ b/metron-platform/metron-integration-test/src/main/java/org/apache/metron/integration/utils/TestUtils.java @@ -21,10 +21,12 @@ import java.io.File; import java.io.FileReader; import java.io.IOException; +import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.nio.file.FileVisitResult; import java.nio.file.Files; import java.nio.file.Path; +import java.nio.file.Paths; import java.nio.file.SimpleFileVisitor; import java.nio.file.attribute.BasicFileAttributes; import java.util.ArrayList; @@ -32,6 +34,7 @@ public class TestUtils { public static long MAX_ASSERT_WAIT_MS = 30000L; + public interface Assertion { void apply() throws Exception; } @@ -87,6 +90,30 @@ public static File write(File file, String contents) throws IOException { return file; } + /** + * Reads file contents into a String. Uses UTF-8 as default charset. + * + * @param in Input file + * @return contents of input file + * @throws IOException + */ + public static String read(File in) throws IOException { + return read(in, StandardCharsets.UTF_8); + } + + /** + * Reads file contents into a String + * + * @param in Input file + * @param charset charset to use for reading + * @return contents of input file + * @throws IOException + */ + public static String read(File in, Charset charset) throws IOException { + byte[] bytes = Files.readAllBytes(Paths.get(in.getPath())); + return new String(bytes, charset); + } + /** * Cleans up after test run via runtime shutdown hooks */ diff --git a/metron-platform/metron-parsers/pom.xml b/metron-platform/metron-parsers/pom.xml index c27ad623f0..18377d3bf5 100644 --- a/metron-platform/metron-parsers/pom.xml +++ b/metron-platform/metron-parsers/pom.xml @@ -129,6 +129,14 @@ ${global_storm_version} provided + + org.apache.logging.log4j + log4j-api + + + org.apache.logging.log4j + log4j-core + servlet-api javax.servlet @@ -143,6 +151,18 @@ + + org.apache.logging.log4j + log4j-api + ${global_log4j_core_version} + test + + + org.apache.logging.log4j + log4j-core + ${global_log4j_core_version} + test + junit junit diff --git a/metron-platform/metron-pcap-backend/pom.xml b/metron-platform/metron-pcap-backend/pom.xml index bcd7e7ca08..6db7d2914b 100644 --- a/metron-platform/metron-pcap-backend/pom.xml +++ b/metron-platform/metron-pcap-backend/pom.xml @@ -173,6 +173,14 @@ ${global_storm_version} provided + + org.apache.logging.log4j + log4j-api + + + org.apache.logging.log4j + log4j-core + servlet-api javax.servlet @@ -187,6 +195,18 @@ + + org.apache.logging.log4j + log4j-api + ${global_log4j_core_version} + test + + + org.apache.logging.log4j + log4j-core + ${global_log4j_core_version} + test + org.apache.metron metron-pcap diff --git a/metron-platform/metron-pcap/pom.xml b/metron-platform/metron-pcap/pom.xml index 3a831749d6..574e99bbca 100644 --- a/metron-platform/metron-pcap/pom.xml +++ b/metron-platform/metron-pcap/pom.xml @@ -91,6 +91,14 @@ ${global_storm_version} provided + + org.apache.logging.log4j + log4j-api + + + org.apache.logging.log4j + log4j-core + servlet-api javax.servlet diff --git a/metron-platform/metron-solr/pom.xml b/metron-platform/metron-solr/pom.xml index 6da67b83c4..a2eee7181d 100644 --- a/metron-platform/metron-solr/pom.xml +++ b/metron-platform/metron-solr/pom.xml @@ -65,12 +65,32 @@ + + org.apache.logging.log4j + log4j-api + ${global_log4j_core_version} + test + + + org.apache.logging.log4j + log4j-core + ${global_log4j_core_version} + test + org.apache.storm storm-core ${global_storm_version} provided + + org.apache.logging.log4j + log4j-core + + + org.apache.logging.log4j + log4j-api + servlet-api javax.servlet diff --git a/metron-platform/metron-storm-kafka-override/pom.xml b/metron-platform/metron-storm-kafka-override/pom.xml index b50bb9102d..3dd2d115dd 100644 --- a/metron-platform/metron-storm-kafka-override/pom.xml +++ b/metron-platform/metron-storm-kafka-override/pom.xml @@ -46,6 +46,14 @@ ${global_storm_version} provided + + org.apache.logging.log4j + log4j-core + + + org.apache.logging.log4j + log4j-api + servlet-api javax.servlet diff --git a/metron-platform/metron-storm-kafka/pom.xml b/metron-platform/metron-storm-kafka/pom.xml index d420389275..30bbc85603 100644 --- a/metron-platform/metron-storm-kafka/pom.xml +++ b/metron-platform/metron-storm-kafka/pom.xml @@ -51,6 +51,14 @@ ${global_storm_version} provided + + org.apache.logging.log4j + log4j-api + + + org.apache.logging.log4j + log4j-core + servlet-api javax.servlet diff --git a/metron-platform/metron-test-utilities/pom.xml b/metron-platform/metron-test-utilities/pom.xml index 8865b62407..7c223a99fb 100644 --- a/metron-platform/metron-test-utilities/pom.xml +++ b/metron-platform/metron-test-utilities/pom.xml @@ -111,6 +111,14 @@ ${global_storm_version} provided + + org.apache.logging.log4j + log4j-core + + + org.apache.logging.log4j + log4j-api + servlet-api javax.servlet diff --git a/metron-platform/metron-writer/pom.xml b/metron-platform/metron-writer/pom.xml index 3456094c19..7254e3b80f 100644 --- a/metron-platform/metron-writer/pom.xml +++ b/metron-platform/metron-writer/pom.xml @@ -129,6 +129,14 @@ ${global_storm_version} provided + + org.apache.logging.log4j + log4j-core + + + org.apache.logging.log4j + log4j-api + servlet-api javax.servlet diff --git a/pom.xml b/pom.xml index 4678dff25e..98c942a3ef 100644 --- a/pom.xml +++ b/pom.xml @@ -97,7 +97,7 @@ ${base_hadoop_version} ${base_hbase_version} ${base_flume_version} - 2.3.3 + 5.6.2 1.1.1 3.0.2 4.12 @@ -119,7 +119,7 @@ 0.38 0.9.10 8.0 - + 2.1 @@ -159,7 +159,7 @@ ${global_surefire_version} - @{argLine} -Xmx2048m + -Xmx2048m true false @@ -324,8 +324,6 @@ **/src/main/sample/data/** **/dependency-reduced-pom.xml **/target/** - - **/src/main/resources/common-services/KIBANA/4.5.1/package/scripts/dashboard/dashboard.p **/packer-build/scripts/** **/packer-build/bin/**