You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ol...@apache.org on 2016/04/13 15:02:18 UTC

[1/8] ambari git commit: AMBARI-15806. Initial commit for Logsearch service stack definition (oleewere)

Repository: ambari
Updated Branches:
  refs/heads/trunk a7f0c09bd -> f903d17f8


http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/utils/RMFTestCase.py b/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
index 380fa39..dd82430 100644
--- a/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
+++ b/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
@@ -252,7 +252,19 @@ class RMFTestCase(TestCase):
       self.assertEquals(resource_type, resource.__class__.__name__)
       self.assertEquals(name, resource.name)
       self.assertEquals(kwargs, resource.arguments)
-    
+
+  def assertResourceCalledRegexp(self, resource_type, name, **kwargs):
+    with patch.object(UnknownConfiguration, '__getattr__', return_value=lambda: "UnknownConfiguration()"):
+      self.assertNotEqual(len(RMFTestCase.env.resource_list), 0, "There were no more resources executed!")
+      resource = RMFTestCase.env.resource_list.pop(0)
+      
+      self.assertRegexpMatches(resource.__class__.__name__, resource_type)
+      self.assertRegexpMatches(resource.name, name)
+      for key in set(resource.arguments.keys()) | set(kwargs.keys()):
+        resource_value = resource.arguments.get(key, '')
+        actual_value = kwargs.get(key, '')
+        self.assertRegexpMatches(resource_value, actual_value, msg="Key " + key + " doesn't match")
+
   def assertNoMoreResources(self):
     self.assertEquals(len(RMFTestCase.env.resource_list), 0, "There were other resources executed!")
     

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/test/resources/stacks/HDP/2.2.0/upgrades/upgrade_test_checks.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/stacks/HDP/2.2.0/upgrades/upgrade_test_checks.xml b/ambari-server/src/test/resources/stacks/HDP/2.2.0/upgrades/upgrade_test_checks.xml
index fb03cb3..b56b935 100644
--- a/ambari-server/src/test/resources/stacks/HDP/2.2.0/upgrades/upgrade_test_checks.xml
+++ b/ambari-server/src/test/resources/stacks/HDP/2.2.0/upgrades/upgrade_test_checks.xml
@@ -85,6 +85,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
     

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-web/app/mappers/service_metrics_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/service_metrics_mapper.js b/ambari-web/app/mappers/service_metrics_mapper.js
index 49f984d..2e15973 100644
--- a/ambari-web/app/mappers/service_metrics_mapper.js
+++ b/ambari-web/app/mappers/service_metrics_mapper.js
@@ -389,7 +389,8 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
       SPARK: [34],
       ACCUMULO: [35],
       ATLAS: [36],
-      AMBARI_METRICS: [37]
+      AMBARI_METRICS: [37],
+      LOGSEARCH: [38]
     };
     if (quickLinks[item.ServiceInfo.service_name])
       finalJson.quick_links = quickLinks[item.ServiceInfo.service_name];

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-web/app/models/quick_links.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/quick_links.js b/ambari-web/app/models/quick_links.js
index d7fbbc6..b7ad1ce 100644
--- a/ambari-web/app/models/quick_links.js
+++ b/ambari-web/app/models/quick_links.js
@@ -355,6 +355,19 @@ App.QuickLinks.FIXTURES = [
     regex: '^(\\d+)$',
     default_http_port: 3000,
     default_https_port: 3000
+  },
+  {
+    id:38,
+    label:'Logsearch UI',
+    url:'%@://%@:%@',
+    service_id: 'LOGSEARCH',
+    template:'%@://%@:%@',
+    http_config: 'logsearch.ui.port',
+    https_config: 'logsearch.ui.port',
+    site: 'logsearch-site',
+    regex: '^(\\d+)$',
+    default_http_port: 61888,
+    default_https_port: 61888
   }
 
 ];

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-web/app/views/common/quick_view_link_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/quick_view_link_view.js b/ambari-web/app/views/common/quick_view_link_view.js
index b62b7b8..3a99d7a 100644
--- a/ambari-web/app/views/common/quick_view_link_view.js
+++ b/ambari-web/app/views/common/quick_view_link_view.js
@@ -43,7 +43,8 @@ App.QuickViewLinks = Em.View.extend({
     'ACCUMULO',
     'ATLAS',
     'RANGER',
-    'AMBARI_METRICS'
+    'AMBARI_METRICS',
+    'LOGSEARCH'
   ],
 
   /**
@@ -553,6 +554,9 @@ App.QuickViewLinks = Em.View.extend({
       case "AMBARI_METRICS":
         hosts = this.findHosts('METRICS_GRAFANA', response);
         break;
+      case "LOGSEARCH":
+        hosts = this.findHosts('LOGSEARCH_SERVER', response);
+        break;
       default:
         if (this.getWithDefault('content.hostComponents', []).someProperty('isMaster')) {
           hosts = this.findHosts(this.get('content.hostComponents').findProperty('isMaster').get('componentName'), response);

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-web/test/views/common/quick_link_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/common/quick_link_view_test.js b/ambari-web/test/views/common/quick_link_view_test.js
index b9050f8..2b1c08f 100644
--- a/ambari-web/test/views/common/quick_link_view_test.js
+++ b/ambari-web/test/views/common/quick_link_view_test.js
@@ -964,6 +964,11 @@ describe('App.QuickViewLinks', function () {
       expect(quickViewLinks.findHosts.calledWith('METRICS_GRAFANA', {})).to.be.true;
     });
 
+    it("LOGSEARCH service", function() {
+      expect(quickViewLinks.getHosts({}, 'LOGSEARCH')).to.eql(['host1']);
+      expect(quickViewLinks.findHosts.calledWith('LOGSEARCH_SERVER', {})).to.be.true;
+    });
+
     it("custom service without master", function() {
       expect(quickViewLinks.getHosts({}, 'S1')).to.be.empty;
     });


[2/8] ambari git commit: AMBARI-15806. Initial commit for Logsearch service stack definition (oleewere)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/test/python/stacks/2.4/configs/default.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.4/configs/default.json b/ambari-server/src/test/python/stacks/2.4/configs/default.json
new file mode 100644
index 0000000..e03d25f
--- /dev/null
+++ b/ambari-server/src/test/python/stacks/2.4/configs/default.json
@@ -0,0 +1,398 @@
+{
+    "roleCommand": "SERVICE_CHECK",
+    "clusterName": "c1",
+    "hostname": "c6401.ambari.apache.org",
+    "hostLevelParams": {
+        "not_managed_hdfs_path_list": "[\"/apps/hive/warehouse\",\"/apps/falcon\",\"/mr-history/done\",\"/app-logs\",\"/tmp\"]",
+        "agent_stack_retry_count": "5",
+        "agent_stack_retry_on_unavailability": "false",
+        "jdk_location": "http://c6401.ambari.apache.org:8080/resources/",
+        "ambari_db_rca_password": "mapred",
+        "ambari_db_rca_url": "jdbc:postgresql://c6401.ambari.apache.org/ambarirca",
+        "jce_name": "UnlimitedJCEPolicyJDK7.zip",
+        "stack_version": "2.3",
+        "stack_name": "HDP",
+        "ambari_db_rca_driver": "org.postgresql.Driver",
+        "jdk_name": "jdk-7u67-linux-x64.tar.gz",
+        "ambari_db_rca_username": "mapred",
+        "java_home": "/usr/jdk64/jdk1.7.0_45",
+        "db_name": "ambari"
+    },
+    "commandType": "EXECUTION_COMMAND",
+    "roleParams": {},
+    "serviceName": "SLIDER",
+    "role": "SLIDER",
+    "commandParams": {
+        "version": "2.2.1.0-2067",
+        "command_timeout": "300",
+        "service_package_folder": "OOZIE",
+        "script_type": "PYTHON",
+        "script": "scripts/service_check.py",
+        "excluded_hosts": "host1,host2"
+    },
+    "taskId": 152,
+    "public_hostname": "c6401.ambari.apache.org",
+    "configurations": {
+        "slider-client": {
+            "slider.yarn.queue": "default"
+        },
+        "sqoop-site": {
+          "atlas.cluster.name": "c1",
+          "sqoop.job.data.publish.class": "org.apache.atlas.sqoop.hook.SqoopHook"
+        },
+        "mahout-env": {
+             "mahout_user": "mahout"
+        },
+        "yarn-env": {
+            "yarn_user": "yarn"
+        },
+        "mahout-log4j": {
+            "content": "\n            #\n            #\n            # Licensed to the Apache Software Foundation (ASF) under one\n            # or more contributor license agreements.  See the NOTICE file\n            # distributed with this work for additional information\n            # regarding copyright ownership.  The ASF licenses this file\n            # to you under the Apache License, Version 2.0 (the\n            # \"License\"); you may not use this file except in compliance\n            # with the License.  You may obtain a copy of the License at\n            #\n            #   http://www.apache.org/licenses/LICENSE-2.0\n            #\n            # Unless required by applicable law or agreed to in writing,\n            # software distributed under the License is distributed on an\n            # \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n            # KIND, either express or implied.  See the License for the\n            # specific language governing permiss
 ions and limitations\n            # under the License.\n            #\n            #\n            #\n\n            # Set everything to be logged to the console\n            log4j.rootCategory=WARN, console\n            log4j.appender.console=org.apache.log4j.ConsoleAppender\n            log4j.appender.console.target=System.err\n            log4j.appender.console.layout=org.apache.log4j.PatternLayout\n            log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n\n\n            # Settings to quiet third party logs that are too verbose\n            log4j.logger.org.eclipse.jetty=WARN\n            log4j.logger.org.apache.spark.repl.SparkIMain$exprTyper=WARN\n            log4j.logger.org.apache.spark.repl.SparkILoop$SparkILoopInterpreter=WARN"
+        },
+        "hadoop-env": {
+             "hdfs_user": "hdfs"
+        },
+        "core-site": {
+            "fs.defaultFS": "hdfs://c6401.ambari.apache.org:8020"
+        },
+        "hdfs-site": {
+            "a": "b"
+        },
+        "yarn-site": {
+            "yarn.application.classpath": "/etc/hadoop/conf,/usr/lib/hadoop/*,/usr/lib/hadoop/lib/*,/usr/lib/hadoop-hdfs/*,/usr/lib/hadoop-hdfs/lib/*,/usr/lib/hadoop-yarn/*,/usr/lib/hadoop-yarn/lib/*,/usr/lib/hadoop-mapreduce/*,/usr/lib/hadoop-mapreduce/lib/*",
+            "yarn.resourcemanager.address": "c6401.ambari.apache.org:8050",
+            "yarn.resourcemanager.scheduler.address": "c6401.ambari.apache.org:8030"
+        },
+        "cluster-env": {
+            "managed_hdfs_resource_property_names": "",
+            "security_enabled": "false",
+            "ignore_groupsusers_create": "false",
+            "smokeuser": "ambari-qa",
+            "kerberos_domain": "EXAMPLE.COM",
+            "user_group": "hadoop"
+        },
+        "webhcat-site": {
+            "templeton.jar": "/usr/hdp/current/hive-webhcat/share/webhcat/svr/lib/hive-webhcat-*.jar",
+            "templeton.pig.archive": "hdfs:///hdp/apps/{{ hdp_stack_version }}/pig/pig.tar.gz",
+            "templeton.hive.archive": "hdfs:///hdp/apps/{{ hdp_stack_version }}/hive/hive.tar.gz",
+            "templeton.sqoop.archive": "hdfs:///hdp/apps/{{ hdp_stack_version }}/sqoop/sqoop.tar.gz",
+            "templeton.streaming.jar": "hdfs:///hdp/apps/{{ hdp_stack_version }}/mr/hadoop-streaming.jar"
+        },
+        "slider-log4j": {
+            "content": "log4jproperties\nline2"
+        },
+        "slider-env": {
+            "content": "envproperties\nline2"
+        },
+      "gateway-site": {
+        "java.security.auth.login.config": "/etc/knox/conf/krb5JAASLogin.conf",
+        "gateway.hadoop.kerberos.secured": "false",
+        "gateway.gateway.conf.dir": "deployments",
+        "gateway.path": "gateway",
+        "sun.security.krb5.debug": "true",
+        "java.security.krb5.conf": "/etc/knox/conf/krb5.conf",
+        "gateway.port": "8443"
+      },
+
+      "users-ldif": {
+        "content": "\n            # Licensed to the Apache Software Foundation (ASF) under one\n            # or more contributor license agreements.  See the NOTICE file\n            # distributed with this work for additional information\n            # regarding copyright ownership.  The ASF licenses this file\n            # to you under the Apache License, Version 2.0 (the\n            # \"License\"); you may not use this file except in compliance\n            # with the License.  You may obtain a copy of the License at\n            #\n            #     http://www.apache.org/licenses/LICENSE-2.0\n            #\n            # Unless required by applicable law or agreed to in writing, software\n            # distributed under the License is distributed on an \"AS IS\" BASIS,\n            # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n            # See the License for the specific language governing permissions and\n            # limitations under the Li
 cense.\n\n            version: 1\n\n            # Please replace with site specific values\n            dn: dc=hadoop,dc=apache,dc=org\n            objectclass: organization\n            objectclass: dcObject\n            o: Hadoop\n            dc: hadoop\n\n            # Entry for a sample people container\n            # Please replace with site specific values\n            dn: ou=people,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:organizationalUnit\n            ou: people\n\n            # Entry for a sample end user\n            # Please replace with site specific values\n            dn: uid=guest,ou=people,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:person\n            objectclass:organizationalPerson\n            objectclass:inetOrgPerson\n            cn: Guest\n            sn: User\n            uid: guest\n            userPassword:guest-password\n\n            # entry for sample user admin\n            dn
 : uid=admin,ou=people,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:person\n            objectclass:organizationalPerson\n            objectclass:inetOrgPerson\n            cn: Admin\n            sn: Admin\n            uid: admin\n            userPassword:admin-password\n\n            # entry for sample user sam\n            dn: uid=sam,ou=people,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:person\n            objectclass:organizationalPerson\n            objectclass:inetOrgPerson\n            cn: sam\n            sn: sam\n            uid: sam\n            userPassword:sam-password\n\n            # entry for sample user tom\n            dn: uid=tom,ou=people,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:person\n            objectclass:organizationalPerson\n            objectclass:inetOrgPerson\n            cn: tom\n            sn: tom\n            uid: tom\n            userPassw
 ord:tom-password\n\n            # create FIRST Level groups branch\n            dn: ou=groups,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:organizationalUnit\n            ou: groups\n            description: generic groups branch\n\n            # create the analyst group under groups\n            dn: cn=analyst,ou=groups,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass: groupofnames\n            cn: analyst\n            description:analyst  group\n            member: uid=sam,ou=people,dc=hadoop,dc=apache,dc=org\n            member: uid=tom,ou=people,dc=hadoop,dc=apache,dc=org\n\n\n            # create the scientist group under groups\n            dn: cn=scientist,ou=groups,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass: groupofnames\n            cn: scientist\n            description: scientist group\n            member: uid=sam,ou=people,dc=hadoop,dc=apache,dc=org"
+      },
+
+      "topology": {
+        "content": "\n        <topology>\n\n            <gateway>\n\n                <provider>\n                    <role>authentication</role>\n                    <name>ShiroProvider</name>\n                    <enabled>true</enabled>\n                    <param>\n                        <name>sessionTimeout</name>\n                        <value>30</value>\n                    </param>\n                    <param>\n                        <name>main.ldapRealm</name>\n                        <value>org.apache.hadoop.gateway.shirorealm.KnoxLdapRealm</value>\n                    </param>\n                    <param>\n                        <name>main.ldapRealm.userDnTemplate</name>\n                        <value>uid={0},ou=people,dc=hadoop,dc=apache,dc=org</value>\n                    </param>\n                    <param>\n                        <name>main.ldapRealm.contextFactory.url</name>\n                        <value>ldap://{{knox_host_name}}:33389</value>\n               
      </param>\n                    <param>\n                        <name>main.ldapRealm.contextFactory.authenticationMechanism</name>\n                        <value>simple</value>\n                    </param>\n                    <param>\n                        <name>urls./**</name>\n                        <value>authcBasic</value>\n                    </param>\n                </provider>\n\n                <provider>\n                    <role>identity-assertion</role>\n                    <name>Default</name>\n                    <enabled>true</enabled>\n                </provider>\n\n            </gateway>\n\n            <service>\n                <role>NAMENODE</role>\n                <url>hdfs://{{namenode_host}}:{{namenode_rpc_port}}</url>\n            </service>\n\n            <service>\n                <role>JOBTRACKER</role>\n                <url>rpc://{{rm_host}}:{{jt_rpc_port}}</url>\n            </service>\n\n            <service>\n                <role>WEBHDFS</ro
 le>\n                <url>http://{{namenode_host}}:{{namenode_http_port}}/webhdfs</url>\n            </service>\n\n            <service>\n                <role>WEBHCAT</role>\n                <url>http://{{webhcat_server_host}}:{{templeton_port}}/templeton</url>\n            </service>\n\n            <service>\n                <role>OOZIE</role>\n                <url>http://{{oozie_server_host}}:{{oozie_server_port}}/oozie</url>\n            </service>\n\n            <service>\n                <role>WEBHBASE</role>\n                <url>http://{{hbase_master_host}}:{{hbase_master_port}}</url>\n            </service>\n\n            <service>\n                <role>HIVE</role>\n                <url>http://{{hive_server_host}}:{{hive_http_port}}/{{hive_http_path}}</url>\n            </service>\n\n            <service>\n                <role>RESOURCEMANAGER</role>\n                <url>http://{{rm_host}}:{{rm_port}}/ws</url>\n            </service>\n        </topology>"
+      },
+
+      "ldap-log4j": {
+        "content": "\n        # Licensed to the Apache Software Foundation (ASF) under one\n        # or more contributor license agreements.  See the NOTICE file\n        # distributed with this work for additional information\n        # regarding copyright ownership.  The ASF licenses this file\n        # to you under the Apache License, Version 2.0 (the\n        # \"License\"); you may not use this file except in compliance\n        # with the License.  You may obtain a copy of the License at\n        #\n        #     http://www.apache.org/licenses/LICENSE-2.0\n        #\n        # Unless required by applicable law or agreed to in writing, software\n        # distributed under the License is distributed on an \"AS IS\" BASIS,\n        # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n        # See the License for the specific language governing permissions and\n        # limitations under the License.\n        #testing\n\n        app.log.dir=${launcher.d
 ir}/../logs\n        app.log.file=${launcher.name}.log\n\n        log4j.rootLogger=ERROR, drfa\n        log4j.logger.org.apache.directory.server.ldap.LdapServer=INFO\n        log4j.logger.org.apache.directory=WARN\n\n        log4j.appender.stdout=org.apache.log4j.ConsoleAppender\n        log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\n        log4j.appender.stdout.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n\n\n        log4j.appender.drfa=org.apache.log4j.DailyRollingFileAppender\n        log4j.appender.drfa.File=${app.log.dir}/${app.log.file}\n        log4j.appender.drfa.DatePattern=.yyyy-MM-dd\n        log4j.appender.drfa.layout=org.apache.log4j.PatternLayout\n        log4j.appender.drfa.layout.ConversionPattern=%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n"
+      },
+
+      "gateway-log4j": {
+        "content": "\n\n      # Licensed to the Apache Software Foundation (ASF) under one\n      # or more contributor license agreements. See the NOTICE file\n      # distributed with this work for additional information\n      # regarding copyright ownership. The ASF licenses this file\n      # to you under the Apache License, Version 2.0 (the\n      # \"License\"); you may not use this file except in compliance\n      # with the License. You may obtain a copy of the License at\n      #\n      # http://www.apache.org/licenses/LICENSE-2.0\n      #\n      # Unless required by applicable law or agreed to in writing, software\n      # distributed under the License is distributed on an \"AS IS\" BASIS,\n      # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n      # See the License for the specific language governing permissions and\n      # limitations under the License.\n\n      app.log.dir=${launcher.dir}/../logs\n      app.log.file=${launcher.name}.log\n 
      app.audit.file=${launcher.name}-audit.log\n\n      log4j.rootLogger=ERROR, drfa\n\n      log4j.logger.org.apache.hadoop.gateway=INFO\n      #log4j.logger.org.apache.hadoop.gateway=DEBUG\n\n      #log4j.logger.org.eclipse.jetty=DEBUG\n      #log4j.logger.org.apache.shiro=DEBUG\n      #log4j.logger.org.apache.http=DEBUG\n      #log4j.logger.org.apache.http.client=DEBUG\n      #log4j.logger.org.apache.http.headers=DEBUG\n      #log4j.logger.org.apache.http.wire=DEBUG\n\n      log4j.appender.stdout=org.apache.log4j.ConsoleAppender\n      log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\n      log4j.appender.stdout.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n\n\n      log4j.appender.drfa=org.apache.log4j.DailyRollingFileAppender\n      log4j.appender.drfa.File=${app.log.dir}/${app.log.file}\n      log4j.appender.drfa.DatePattern=.yyyy-MM-dd\n      log4j.appender.drfa.layout=org.apache.log4j.PatternLayout\n      log4j.appender.drfa.layout.ConversionPattern
 =%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n\n\n      log4j.logger.audit=INFO, auditfile\n      log4j.appender.auditfile=org.apache.log4j.DailyRollingFileAppender\n      log4j.appender.auditfile.File=${app.log.dir}/${app.audit.file}\n      log4j.appender.auditfile.Append = true\n      log4j.appender.auditfile.DatePattern = '.'yyyy-MM-dd\n      log4j.appender.auditfile.layout = org.apache.hadoop.gateway.audit.log4j.layout.AuditLayout"
+      },
+      "knox-env": {
+        "knox_master_secret": "sa",
+        "knox_group": "knox",
+        "knox_pid_dir": "/var/run/knox",
+        "knox_user": "knox"
+      },
+      "kafka-env": {
+        "content": "\n#!/bin/bash\n\n# Set KAFKA specific environment variables here.\n\n# The java implementation to use.\nexport JAVA_HOME={{java64_home}}\nexport PATH=$PATH:$JAVA_HOME/bin",
+        "kafka_user": "kafka",
+        "kafka_log_dir": "/var/log/kafka",
+        "kafka_pid_dir": "/var/run/kafka"
+      },
+      "kafka-log4j": {
+        "content": "\n#\n#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements.  See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership.  The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License.  You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied.  See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#\n#\n#\nkafka.logs.dir=logs\n\nlog4j.rootLogger=INFO, stdout\n\nlog4j.appender.stdout=org.apache.log4j.ConsoleAppender\nlog4j.appender.stdout.layout=org.apache.log
 4j.PatternLayout\nlog4j.appender.stdout.layout.ConversionPattern=[%d] %p %m (%c)%n\n\nlog4j.appender.kafkaAppender=org.apache.log4j.DailyRollingFileAppender\nlog4j.appender.kafkaAppender.DatePattern='.'yyyy-MM-dd-HH\nlog4j.appender.kafkaAppender.File=${kafka.logs.dir}/server.log\nlog4j.appender.kafkaAppender.layout=org.apache.log4j.PatternLayout\nlog4j.appender.kafkaAppender.layout.ConversionPattern=[%d] %p %m (%c)%n\n\nlog4j.appender.stateChangeAppender=org.apache.log4j.DailyRollingFileAppender\nlog4j.appender.stateChangeAppender.DatePattern='.'yyyy-MM-dd-HH\nlog4j.appender.stateChangeAppender.File=${kafka.logs.dir}/state-change.log\nlog4j.appender.stateChangeAppender.layout=org.apache.log4j.PatternLayout\nlog4j.appender.stateChangeAppender.layout.ConversionPattern=[%d] %p %m (%c)%n\n\nlog4j.appender.requestAppender=org.apache.log4j.DailyRollingFileAppender\nlog4j.appender.requestAppender.DatePattern='.'yyyy-MM-dd-HH\nlog4j.appender.requestAppender.File=${kafka.logs.dir}/kafka-requ
 est.log\nlog4j.appender.requestAppender.layout=org.apache.log4j.PatternLayout\nlog4j.appender.requestAppender.layout.ConversionPattern=[%d] %p %m (%c)%n\n\nlog4j.appender.cleanerAppender=org.apache.log4j.DailyRollingFileAppender\nlog4j.appender.cleanerAppender.DatePattern='.'yyyy-MM-dd-HH\nlog4j.appender.cleanerAppender.File=${kafka.logs.dir}/log-cleaner.log\nlog4j.appender.cleanerAppender.layout=org.apache.log4j.PatternLayout\nlog4j.appender.cleanerAppender.layout.ConversionPattern=[%d] %p %m (%c)%n\n\nlog4j.appender.controllerAppender=org.apache.log4j.DailyRollingFileAppender\nlog4j.appender.controllerAppender.DatePattern='.'yyyy-MM-dd-HH\nlog4j.appender.controllerAppender.File=${kafka.logs.dir}/controller.log\nlog4j.appender.controllerAppender.layout=org.apache.log4j.PatternLayout\nlog4j.appender.controllerAppender.layout.ConversionPattern=[%d] %p %m (%c)%n\n\n# Turn on all our debugging info\n#log4j.logger.kafka.producer.async.DefaultEventHandler=DEBUG, kafkaAppender\n#log4j.log
 ger.kafka.client.ClientUtils=DEBUG, kafkaAppender\n#log4j.logger.kafka.perf=DEBUG, kafkaAppender\n#log4j.logger.kafka.perf.ProducerPerformance$ProducerThread=DEBUG, kafkaAppender\n#log4j.logger.org.I0Itec.zkclient.ZkClient=DEBUG\nlog4j.logger.kafka=INFO, kafkaAppender\nlog4j.logger.kafka.network.RequestChannel$=WARN, requestAppender\nlog4j.additivity.kafka.network.RequestChannel$=false\n\n#log4j.logger.kafka.network.Processor=TRACE, requestAppender\n#log4j.logger.kafka.server.KafkaApis=TRACE, requestAppender\n#log4j.additivity.kafka.server.KafkaApis=false\nlog4j.logger.kafka.request.logger=WARN, requestAppender\nlog4j.additivity.kafka.request.logger=false\n\nlog4j.logger.kafka.controller=TRACE, controllerAppender\nlog4j.additivity.kafka.controller=false\n\nlog4j.logger.kafka.log.LogCleaner=INFO, cleanerAppender\nlog4j.additivity.kafka.log.LogCleaner=false\n\nlog4j.logger.state.change.logger=TRACE, stateChangeAppender\nlog4j.additivity.state.change.logger=false"
+      },
+      "kafka-broker": {
+        "log.segment.bytes": "1073741824",
+        "socket.send.buffer.bytes": "102400",
+        "num.network.threads": "3",
+        "log.flush.scheduler.interval.ms": "3000",
+        "kafka.ganglia.metrics.host": "localhost",
+        "zookeeper.session.timeout.ms": "6000",
+        "replica.lag.time.max.ms": "10000",
+        "num.io.threads": "8",
+        "kafka.ganglia.metrics.group": "kafka",
+        "replica.lag.max.messages": "4000",
+        "port": "6667",
+        "log.retention.bytes": "-1",
+        "fetch.purgatory.purge.interval.requests": "10000",
+        "producer.purgatory.purge.interval.requests": "10000",
+        "default.replication.factor": "1",
+        "replica.high.watermark.checkpoint.interval.ms": "5000",
+        "zookeeper.connect": "c6402.ambari.apache.org:2181",
+        "controlled.shutdown.retry.backoff.ms": "5000",
+        "num.partitions": "1",
+        "log.flush.interval.messages": "10000",
+        "replica.fetch.min.bytes": "1",
+        "queued.max.requests": "500",
+        "controlled.shutdown.max.retries": "3",
+        "replica.fetch.wait.max.ms": "500",
+        "controlled.shutdown.enable": "false",
+        "log.roll.hours": "168",
+        "log.cleanup.interval.mins": "10",
+        "replica.socket.receive.buffer.bytes": "65536",
+        "zookeeper.connection.timeout.ms": "6000",
+        "replica.fetch.max.bytes": "1048576",
+        "num.replica.fetchers": "1",
+        "socket.request.max.bytes": "104857600",
+        "message.max.bytes": "1000000",
+        "zookeeper.sync.time.ms": "2000",
+        "socket.receive.buffer.bytes": "102400",
+        "controller.message.queue.size": "10",
+        "log.flush.interval.ms": "3000",
+        "log.dirs": "/tmp/log/dir",
+        "controller.socket.timeout.ms": "30000",
+        "replica.socket.timeout.ms": "30000",
+        "auto.create.topics.enable": "true",
+        "log.index.size.max.bytes": "10485760",
+        "kafka.ganglia.metrics.port": "8649",
+        "log.index.interval.bytes": "4096",
+        "log.retention.hours": "168"
+      },
+      "application-properties": {
+        "atlas.cluster.name" : "c2",
+        "atlas.graph.storage.backend": "berkeleyje",
+        "atlas.graph.storage.directory": "data/berkley",
+        "atlas.graph.index.search.backend": "elasticsearch",
+        "atlas.graph.index.search.directory": "data/es",
+        "atlas.graph.index.search.elasticsearch.client-only": false,
+        "atlas.graph.index.search.elasticsearch.local-mode": true,
+        "atlas.lineage.hive.table.type.name": "Table",
+        "atlas.lineage.hive.column.type.name": "Column",
+        "atlas.lineage.hive.table.column.name": "columns",
+        "atlas.lineage.hive.process.type.name": "LoadProcess",
+        "atlas.lineage.hive.process.inputs.name": "inputTables",
+        "atlas.lineage.hive.process.outputs.name": "outputTables",
+        "atlas.enableTLS": false,
+        "atlas.authentication.method": "simple",
+        "atlas.authentication.principal": "atlas",
+        "atlas.authentication.keytab": "/etc/security/keytabs/atlas.service.keytab",
+        "atlas.http.authentication.enabled": false,
+        "atlas.http.authentication.type": "simple",
+        "atlas.http.authentication.kerberos.principal": "HTTP/_HOST@EXAMPLE.COM",
+        "atlas.http.authentication.kerberos.keytab": "/etc/security/keytabs/spnego.service.keytab",
+        "atlas.http.authentication.kerberos.name.rules": "DEFAULT",
+        "atlas.server.http.port" : "21000",
+        "atlas.notification.embedded" : false,
+        "atlas.kafka.bootstrap.servers" : "c6401.ambari.apache.org:6667",
+        "atlas.kafka.data" : "/usr/hdp/current/atlas-server/data/kafka",
+        "atlas.kafka.entities.group.id" : "entities",
+        "atlas.kafka.hook.group.id" : "atlas",
+        "atlas.kafka.zookeeper.connect" : "c6401.ambari.apache.org:2181"
+      },
+      "atlas-env": {
+        "content": "# The java implementation to use. If JAVA_HOME is not found we expect java and jar to be in path\nexport JAVA_HOME={{java64_home}}\n# any additional java opts you want to set. This will apply to both client and server operations\nexport METADATA_OPTS={{metadata_opts}}\n# metadata configuration directory\nexport METADATA_CONF={{conf_dir}}\n# Where log files are stored. Defatult is logs directory under the base install location\nexport METADATA_LOG_DIR={{log_dir}}\n# additional classpath entries\nexport METADATACPPATH={{metadata_classpath}}\n# data dir\nexport METADATA_DATA_DIR={{data_dir}}\n# Where do you want to expand the war file. By Default it is in /server/webapp dir under the base install dir.\nexport METADATA_EXPANDED_WEBAPP_DIR={{expanded_war_dir}}",
+        "metadata_user": "atlas",
+        "metadata_port": 21000,
+        "metadata_pid_dir": "/var/run/atlas",
+        "metadata_log_dir": "/var/log/atlas",
+        "metadata_data_dir": "/var/lib/atlas/data",
+        "metadata_expanded_war_dir": "/var/lib/atlas/server/webapp",
+        "metadata_conf_file": "application.properties"
+      },
+      "ranger-hbase-plugin-properties": {
+            "ranger-hbase-plugin-enabled":"yes"
+      },
+      "ranger-hive-plugin-properties": {
+            "ranger-hive-plugin-enabled":"yes"
+       },
+      "ranger-env": {
+            "xml_configurations_supported" : "true"
+      },
+      "logsearch-solr-env": {
+        "logsearch_solr_user": "solr",
+        "logsearch_solr_group": "solr",
+        "logsearch_solr_port": "8886",
+        "logsearch_solr_minmem": "512m",
+        "logsearch_solr_maxmem": "512m",
+        "logsearch_solr_znode": "/logsearch",
+        "logsearch_solr_conf": "/etc/ambari-logsearch-solr",
+        "logsearch_solr_pid_dir": "/var/run/ambari-logsearch-solr",
+        "logsearch_solr_datadir": "/opt/logsearch_solr/data",
+        "logsearch_solr_log_dir": "/var/log/ambari-logsearch-solr",
+        "content": "# By default the script will use JAVA_HOME to determine which java\n# to use, but you can set a specific path for Solr to use without\n# affecting other Java applications on your server/workstation.\nSOLR_JAVA_HOME={{java64_home}}\n\n# Increase Java Min/Max Heap as needed to support your indexing / query needs\nSOLR_JAVA_MEM=\"-Xms{{solr_min_mem}} -Xmx{{solr_max_mem}}\"\n\n# Enable verbose GC logging\nGC_LOG_OPTS=\"-verbose:gc -XX:+PrintHeapAtGC -XX:+PrintGCDetails \\\n-XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime\"\n\n# These GC settings have shown to work well for a number of common Solr workloads\nGC_TUNE=\"-XX:NewRatio=3 \\\n-XX:SurvivorRatio=4 \\\n-XX:TargetSurvivorRatio=90 \\\n-XX:MaxTenuringThreshold=8 \\\n-XX:+UseConcMarkSweepGC \\\n-XX:+UseParNewGC \\\n-XX:ConcGCThreads=4 -XX:ParallelGCThreads=4 \\\n-XX:+CMSScavengeBeforeRemark \\\n-XX:PretenureSizeThreshold=64m \\\n-XX:+UseCMSInitiatingOc
 cupancyOnly \\\n-XX:CMSInitiatingOccupancyFraction=50 \\\n-XX:CMSMaxAbortablePrecleanTime=6000 \\\n-XX:+CMSParallelRemarkEnabled \\\n-XX:+ParallelRefProcEnabled\"\n\n# Set the ZooKeeper connection string if using an external ZooKeeper ensemble\n# e.g. host1:2181,host2:2181/chroot\n# Leave empty if not using SolrCloud\nZK_HOST=\"{{zookeeper_quorum}}{{solr_znode}}\"\n\n# Set the ZooKeeper client timeout (for SolrCloud mode)\nZK_CLIENT_TIMEOUT=\"60000\"\n\n# By default the start script uses \"localhost\"; override the hostname here\n# for production SolrCloud environments to control the hostname exposed to cluster state\n#SOLR_HOST=\"192.168.1.1\"\n\n# By default the start script uses UTC; override the timezone if needed\n#SOLR_TIMEZONE=\"UTC\"\n\n# Set to true to activate the JMX RMI connector to allow remote JMX client applications\n# to monitor the JVM hosting Solr; set to \"false\" to disable that behavior\n# (false is recommended in production environments)\nENABLE_REMOTE_JMX_OPTS
 =\"false\"\n\n# The script will use SOLR_PORT+10000 for the RMI_PORT or you can set it here\n# RMI_PORT=18983\n\n# Anything you add to the SOLR_OPTS variable will be included in the java\n# start command line as-is, in ADDITION to other options. If you specify the\n# -a option on start script, those options will be appended as well. Examples:\n#SOLR_OPTS=\"$SOLR_OPTS -Dsolr.autoSoftCommit.maxTime=3000\"\n#SOLR_OPTS=\"$SOLR_OPTS -Dsolr.autoCommit.maxTime=60000\"\n#SOLR_OPTS=\"$SOLR_OPTS -Dsolr.clustering.enabled=true\"\n\n# Location where the bin/solr script will save PID files for running instances\n# If not set, the script will create PID files in $SOLR_TIP/bin\nSOLR_PID_DIR={{solr_piddir}}\n\n# Path to a directory where Solr creates index files, the specified directory\n# must contain a solr.xml; by default, Solr will use server/solr\nSOLR_HOME={{logsearch_solr_datadir}}\n\n# Solr provides a default Log4J configuration properties file in server/resources\n# however, you may want t
 o customize the log settings and file appender location\n# so you can point the script to use a different log4j.properties file\nLOG4J_PROPS={{logsearch_solr_datadir}}/resources/log4j.properties\n\n# Location where Solr should write logs to; should agree with the file appender\n# settings in server/resources/log4j.properties\nSOLR_LOGS_DIR={{solr_log_dir}}\n\n# Sets the port Solr binds to, default is 8983\nSOLR_PORT={{solr_port}}\n\n# Uncomment to set SSL-related system properties\n# Be sure to update the paths to the correct keystore for your environment\n#SOLR_SSL_OPTS=\"-Djavax.net.ssl.keyStore=etc/solr-ssl.keystore.jks \\\n#-Djavax.net.ssl.keyStorePassword=secret \\\n#-Djavax.net.ssl.trustStore=etc/solr-ssl.keystore.jks \\\n#-Djavax.net.ssl.trustStorePassword=secret\"\n\n# Uncomment to set a specific SSL port (-Djetty.ssl.port=N); if not set\n# and you are using SSL, then the start script will use SOLR_PORT for the SSL port\n#SOLR_SSL_PORT="
+      },
+      "logsearch-solr-xml": {
+        "content": "\n&lt;solr&gt;\n  &lt;solrcloud&gt;\n    &lt;str name=\"host\"&gt;${host:}&lt;/str&gt;\n    &lt;int name=\"hostPort\"&gt;${jetty.port:}&lt;/int&gt;\n    &lt;str name=\"hostContext\"&gt;${hostContext:solr}&lt;/str&gt;\n    &lt;int name=\"zkClientTimeout\"&gt;${zkClientTimeout:15000}&lt;/int&gt;\n    &lt;bool name=\"genericCoreNodeNames\"&gt;${genericCoreNodeNames:true}&lt;/bool&gt;\n  &lt;/solrcloud&gt;\n&lt;/solr&gt;"
+      },
+      "logsearch-solr-log4j": {
+        "content": "\n#  Logging level\nsolr.log={{solr_log_dir}}\n#log4j.rootLogger=INFO, file, CONSOLE\nlog4j.rootLogger=INFO, file\n\nlog4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender\n\nlog4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout\nlog4j.appender.CONSOLE.layout.ConversionPattern=%-4r [%t] %-5p %c %x [%X{collection} %X{shard} %X{replica} %X{core}] \\u2013 %m%n\n\n#- size rotation with log cleanup.\nlog4j.appender.file=org.apache.log4j.RollingFileAppender\nlog4j.appender.file.MaxFileSize=10MB\nlog4j.appender.file.MaxBackupIndex=9\n\n#- File to log to and log format\nlog4j.appender.file.File=${solr.log}/solr.log\nlog4j.appender.file.layout=org.apache.log4j.PatternLayout\nlog4j.appender.file.layout.ConversionPattern=%d{ISO8601} [%t] %-5p [%X{collection} %X{shard} %X{replica} %X{core}] %C (%F:%L) - %m%n\n\nlog4j.logger.org.apache.zookeeper=WARN\nlog4j.logger.org.apache.hadoop=WARN\n\n# set to INFO to enable infostream log messages\nlog4j.logger.org.apache.solr.u
 pdate.LoggingInfoStream=OFF"
+      },
+      "solr-zoo-env": {
+        "content": "\n# The number of milliseconds of each tick\ntickTime=2000\n# The number of ticks that the initial\n# synchronization phase can take\ninitLimit=10\n# The number of ticks that can pass between\n# sending a request and getting an acknowledgement\nsyncLimit=5\n\n# the directory where the snapshot is stored.\n# dataDir=/opt/zookeeper/data\n# NOTE: Solr defaults the dataDir to $solrHome/zoo_data\n\n# the port at which the clients will connect\n# clientPort=2181\n# NOTE: Solr sets this based on zkRun / zkHost params"
+      },
+      "solr-sh": {
+        "content": "\n#!/bin/bash\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements.  See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); you may not use this file except in compliance with\n# the License.  You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n#This script is a wrapper for calling bin/solr but using custom properties\nSOLR_INCLUDE={{logsearch_solr_conf}}/solr.in.sh {{solr_bindir}}/solr $*"
+      },
+      "logsearch-env": {
+        "logsearch_user": "logsearch",
+        "logsearch_group": "logsearch",
+        "logsearch_pid_dir": "/var/run/ambari-logsearch-portal",
+        "logsearch_log_dir": "/var/log/ambari-logsearch-portal",
+        "logsearch_debug_enabled": "false",
+        "logsearch_debug_port": "5005",
+        "logsearch_solr_audit_logs_use_ranger": "false",
+        "content": "# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements.  See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); you may not use this file except in compliance with\n# the License.  You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#solr.url=http://{{solr_host}}:{{solr_port}}/solr\n\n#Service Logs and History colletion\nsolr.zkhosts={{zookeeper_quorum}}{{solr_znode}}\nsolr.core.logs={{logsearch_collection_s
 ervice_logs}}\nsolr.core.history=history\n\nsolr.service_logs.split_interval_mins={{service_logs_collection_splits_interval_mins}}\nsolr.service_logs.shards={{logsearch_numshards}}\nsolr.service_logs.replication_factor={{logsearch_repfactor}}\n\nsolr.servicelogs.fields={{logsearch_service_logs_fields}}\n\n#Audit logs\nauditlog.solr.zkhosts={{solr_audit_logs_zk_quorum}}{{solr_audit_logs_zk_node}}\nauditlog.solr.core.logs={{solr_collection_audit_logs}}\nauditlog.solr.url={{solr_audit_logs_url}}\n\nsolr.audit_logs.split_interval_mins={{audit_logs_collection_splits_interval_mins}}\nsolr.audit_logs.shards={{logsearch_numshards}}\nsolr.audit_logs.replication_factor={{logsearch_repfactor}}"
+      },
+      "logsearch-service_logs-solrconfig": {
+        "content": "&lt;?xml version=\"1.0\" encoding=\"UTF-8\" ?&gt;\n&lt;!--\n Licensed to the Apache Software Foundation (ASF) under one or more\n contributor license agreements.  See the NOTICE file distributed with\n this work for additional information regarding copyright ownership.\n The ASF licenses this file to You under the Apache License, Version 2.0\n (the \"License\"); you may not use this file except in compliance with\n the License.  You may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n--&gt;\n\n&lt;!-- \n     For more details about configurations options that may appear in\n     this file, see http://wiki.apache.or
 g/solr/SolrConfigXml. \n--&gt;\n&lt;config&gt;\n  &lt;!-- In all configuration below, a prefix of \"solr.\" for class names\n       is an alias that causes solr to search appropriate packages,\n       including org.apache.solr.(search|update|request|core|analysis)\n\n       You may also specify a fully qualified Java classname if you\n       have your own custom plugins.\n    --&gt;\n\n  &lt;!-- Controls what version of Lucene various components of Solr\n       adhere to.  Generally, you want to use the latest version to\n       get all bug fixes and improvements. It is highly recommended\n       that you fully re-index after changing this setting as it can\n       affect both how text is indexed and queried.\n  --&gt;\n  &lt;luceneMatchVersion&gt;5.0.0&lt;/luceneMatchVersion&gt;\n\n  &lt;!-- &lt;lib/&gt; directives can be used to instruct Solr to load any Jars\n       identified and use them to resolve any \"plugins\" specified in\n       your solrconfig.xml or schema.xml (ie: Anal
 yzers, Request\n       Handlers, etc...).\n\n       All directories and paths are resolved relative to the\n       instanceDir.\n\n       Please note that &lt;lib/&gt; directives are processed in the order\n       that they appear in your solrconfig.xml file, and are \"stacked\" \n       on top of each other when building a ClassLoader - so if you have \n       plugin jars with dependencies on other jars, the \"lower level\" \n       dependency jars should be loaded first.\n\n       If a \"./lib\" directory exists in your instanceDir, all files\n       found in it are included as if you had used the following\n       syntax...\n       \n              &lt;lib dir=\"./lib\" /&gt;\n    --&gt;\n\n  &lt;!-- A 'dir' option by itself adds any files found in the directory \n       to the classpath, this is useful for including all jars in a\n       directory.\n\n       When a 'regex' is specified in addition to a 'dir', only the\n       files in that directory which completely match the reg
 ex\n       (anchored on both ends) will be included.\n\n       If a 'dir' option (with or without a regex) is used and nothing\n       is found that matches, a warning will be logged.\n\n       The examples below can be used to load some solr-contribs along \n       with their external dependencies.\n    --&gt;\n  &lt;lib dir=\"${solr.install.dir:../../../..}/dist/\" regex=\"solr-dataimporthandler-.*\\.jar\" /&gt;\n\n  &lt;lib dir=\"${solr.install.dir:../../../..}/contrib/extraction/lib\" regex=\".*\\.jar\" /&gt;\n  &lt;lib dir=\"${solr.install.dir:../../../..}/dist/\" regex=\"solr-cell-\\d.*\\.jar\" /&gt;\n\n  &lt;lib dir=\"${solr.install.dir:../../../..}/contrib/clustering/lib/\" regex=\".*\\.jar\" /&gt;\n  &lt;lib dir=\"${solr.install.dir:../../../..}/dist/\" regex=\"solr-clustering-\\d.*\\.jar\" /&gt;\n\n  &lt;lib dir=\"${solr.install.dir:../../../..}/contrib/langid/lib/\" regex=\".*\\.jar\" /&gt;\n  &lt;lib dir=\"${solr.install.dir:../../../..}/dist/\" regex=\"solr-langid-\\d.*
 \\.jar\" /&gt;\n\n  &lt;lib dir=\"${solr.install.dir:../../../..}/contrib/velocity/lib\" regex=\".*\\.jar\" /&gt;\n  &lt;lib dir=\"${solr.install.dir:../../../..}/dist/\" regex=\"solr-velocity-\\d.*\\.jar\" /&gt;\n\n  &lt;!-- an exact 'path' can be used instead of a 'dir' to specify a \n       specific jar file.  This will cause a serious error to be logged \n       if it can't be loaded.\n    --&gt;\n  &lt;!--\n     &lt;lib path=\"../a-jar-that-does-not-exist.jar\" /&gt; \n  --&gt;\n  \n  &lt;!-- Data Directory\n\n       Used to specify an alternate directory to hold all index data\n       other than the default ./data under the Solr home.  If\n       replication is in use, this should match the replication\n       configuration.\n    --&gt;\n  &lt;dataDir&gt;${solr.data.dir:}&lt;/dataDir&gt;\n\n\n  &lt;!-- The DirectoryFactory to use for indexes.\n       \n       solr.StandardDirectoryFactory is filesystem\n       based and tries to pick the best implementation for the current\n  
      JVM and platform.  solr.NRTCachingDirectoryFactory, the default,\n       wraps solr.StandardDirectoryFactory and caches small files in memory\n       for better NRT performance.\n\n       One can force a particular implementation via solr.MMapDirectoryFactory,\n       solr.NIOFSDirectoryFactory, or solr.SimpleFSDirectoryFactory.\n\n       solr.RAMDirectoryFactory is memory based, not\n       persistent, and doesn't work with replication.\n    --&gt;\n  &lt;directoryFactory name=\"DirectoryFactory\" \n                    class=\"${solr.directoryFactory:solr.NRTCachingDirectoryFactory}\"&gt;\n    \n         \n    &lt;!-- These will be used if you are using the solr.HdfsDirectoryFactory,\n         otherwise they will be ignored. If you don't plan on using hdfs,\n         you can safely remove this section. --&gt;      \n    &lt;!-- The root directory that collection data should be written to. --&gt;     \n    &lt;str name=\"solr.hdfs.home\"&gt;${solr.hdfs.home:}&lt;/str&gt;\n    &
 lt;!-- The hadoop configuration files to use for the hdfs client. --&gt;    \n    &lt;str name=\"solr.hdfs.confdir\"&gt;${solr.hdfs.confdir:}&lt;/str&gt;\n    &lt;!-- Enable/Disable the hdfs cache. --&gt;    \n    &lt;str name=\"solr.hdfs.blockcache.enabled\"&gt;${solr.hdfs.blockcache.enabled:true}&lt;/str&gt;\n    &lt;!-- Enable/Disable using one global cache for all SolrCores. \n         The settings used will be from the first HdfsDirectoryFactory created. --&gt;    \n    &lt;str name=\"solr.hdfs.blockcache.global\"&gt;${solr.hdfs.blockcache.global:true}&lt;/str&gt;\n    \n  &lt;/directoryFactory&gt; \n\n  &lt;!-- The CodecFactory for defining the format of the inverted index.\n       The default implementation is SchemaCodecFactory, which is the official Lucene\n       index format, but hooks into the schema to provide per-field customization of\n       the postings lists and per-document values in the fieldType element\n       (postingsFormat/docValuesFormat). Note that most of
  the alternative implementations\n       are experimental, so if you choose to customize the index format, it's a good\n       idea to convert back to the official format e.g. via IndexWriter.addIndexes(IndexReader)\n       before upgrading to a newer version to avoid unnecessary reindexing.\n  --&gt;\n  &lt;codecFactory class=\"solr.SchemaCodecFactory\"/&gt;\n\n  &lt;!-- To enable dynamic schema REST APIs, use the following for &lt;schemaFactory&gt;: --&gt;\n  \n       &lt;schemaFactory class=\"ManagedIndexSchemaFactory\"&gt;\n         &lt;bool name=\"mutable\"&gt;true&lt;/bool&gt;\n         &lt;str name=\"managedSchemaResourceName\"&gt;managed-schema&lt;/str&gt;\n       &lt;/schemaFactory&gt;\n&lt;!--       \n       When ManagedIndexSchemaFactory is specified, Solr will load the schema from\n       the resource named in 'managedSchemaResourceName', rather than from schema.xml.\n       Note that the managed schema resource CANNOT be named schema.xml.  If the managed\n       schema 
 does not exist, Solr will create it after reading schema.xml, then rename\n       'schema.xml' to 'schema.xml.bak'. \n       \n       Do NOT hand edit the managed schema - external modifications will be ignored and\n       overwritten as a result of schema modification REST API calls.\n\n       When ManagedIndexSchemaFactory is specified with mutable = true, schema\n       modification REST API calls will be allowed; otherwise, error responses will be\n       sent back for these requests. \n\n  &lt;schemaFactory class=\"ClassicIndexSchemaFactory\"/&gt;\n  --&gt;\n\n  &lt;!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n       Index Config - These settings control low-level behavior of indexing\n       Most example settings here show the default value, but are commented\n       out, to more easily see where customizations have been made.\n       \n       Note: This replaces &lt;indexDefaults&gt; and &lt;mainIndex&gt; from older versions\n       ~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --&gt;\n  &lt;indexConfig&gt;\n    &lt;!-- maxFieldLength was removed in 4.0. To get similar behavior, include a \n         LimitTokenCountFilterFactory in your fieldType definition. E.g. \n     &lt;filter class=\"solr.LimitTokenCountFilterFactory\" maxTokenCount=\"10000\"/&gt;\n    --&gt;\n    &lt;!-- Maximum time to wait for a write lock (ms) for an IndexWriter. Default: 1000 --&gt;\n    &lt;!-- &lt;writeLockTimeout&gt;1000&lt;/writeLockTimeout&gt;  --&gt;\n    &lt;!-- LogSearch customization to avoid timeouts --&gt;\n    &lt;writeLockTimeout&gt;10000&lt;/writeLockTimeout&gt;\n\n    &lt;!-- The maximum number of simultaneous threads that may be\n         indexing documents at once in IndexWriter; if more than this\n         many threads arrive they will wait for others to finish.\n         Default in Solr/Lucene is 8. --&gt;\n    &lt;!-- &lt;maxIndexingThreads&gt;8&lt;/maxIndexingThreads&gt;  --&gt;\n    &lt;!-- LogSearch cu
 stomization of increase performance --&gt;\n    &lt;maxIndexingThreads&gt;50&lt;/maxIndexingThreads&gt;\n\n    &lt;!-- Expert: Enabling compound file will use less files for the index, \n         using fewer file descriptors on the expense of performance decrease. \n         Default in Lucene is \"true\". Default in Solr is \"false\" (since 3.6) --&gt;\n    &lt;!-- &lt;useCompoundFile&gt;false&lt;/useCompoundFile&gt; --&gt;\n\n    &lt;!-- ramBufferSizeMB sets the amount of RAM that may be used by Lucene\n         indexing for buffering added documents and deletions before they are\n         flushed to the Directory.\n         maxBufferedDocs sets a limit on the number of documents buffered\n         before flushing.\n         If both ramBufferSizeMB and maxBufferedDocs is set, then\n         Lucene will flush based on whichever limit is hit first.\n         The default is 100 MB.  --&gt;\n    &lt;!-- &lt;ramBufferSizeMB&gt;100&lt;/ramBufferSizeMB&gt; --&gt;\n    &lt;!-- &lt;maxBuffe
 redDocs&gt;1000&lt;/maxBufferedDocs&gt; --&gt;\n\n    &lt;!-- Expert: Merge Policy \n         The Merge Policy in Lucene controls how merging of segments is done.\n         The default since Solr/Lucene 3.3 is TieredMergePolicy.\n         The default since Lucene 2.3 was the LogByteSizeMergePolicy,\n         Even older versions of Lucene used LogDocMergePolicy.\n      --&gt;\n    &lt;!--\n        &lt;mergePolicy class=\"org.apache.lucene.index.TieredMergePolicy\"&gt;\n          &lt;int name=\"maxMergeAtOnce\"&gt;10&lt;/int&gt;\n          &lt;int name=\"segmentsPerTier\"&gt;10&lt;/int&gt;\n        &lt;/mergePolicy&gt;\n      --&gt;\n       \n    &lt;!-- Merge Factor\n         The merge factor controls how many segments will get merged at a time.\n         For TieredMergePolicy, mergeFactor is a convenience parameter which\n         will set both MaxMergeAtOnce and SegmentsPerTier at once.\n         For LogByteSizeMergePolicy, mergeFactor decides how many new segments\n         will b
 e allowed before they are merged into one.\n         Default is 10 for both merge policies.\n      --&gt;\n    &lt;!-- \n    &lt;mergeFactor&gt;10&lt;/mergeFactor&gt;\n      --&gt;\n    &lt;!-- LogSearch customization. Increased to 25 to maximize indexing speed --&gt;\n    &lt;mergeFactor&gt;25&lt;/mergeFactor&gt;\n\n    &lt;!-- Expert: Merge Scheduler\n         The Merge Scheduler in Lucene controls how merges are\n         performed.  The ConcurrentMergeScheduler (Lucene 2.3 default)\n         can perform merges in the background using separate threads.\n         The SerialMergeScheduler (Lucene 2.2 default) does not.\n     --&gt;\n    &lt;!-- \n       &lt;mergeScheduler class=\"org.apache.lucene.index.ConcurrentMergeScheduler\"/&gt;\n       --&gt;\n\n    &lt;!-- LockFactory \n\n         This option specifies which Lucene LockFactory implementation\n         to use.\n      \n         single = SingleInstanceLockFactory - suggested for a\n                  read-only index or when th
 ere is no possibility of\n                  another process trying to modify the index.\n         native = NativeFSLockFactory - uses OS native file locking.\n                  Do not use when multiple solr webapps in the same\n                  JVM are attempting to share a single index.\n         simple = SimpleFSLockFactory  - uses a plain file for locking\n\n         Defaults: 'native' is default for Solr3.6 and later, otherwise\n                   'simple' is the default\n\n         More details on the nuances of each LockFactory...\n         http://wiki.apache.org/lucene-java/AvailableLockFactories\n    --&gt;\n    &lt;lockType&gt;${solr.lock.type:native}&lt;/lockType&gt;\n\n    &lt;!-- Unlock On Startup\n\n         If true, unlock any held write or commit locks on startup.\n         This defeats the locking mechanism that allows multiple\n         processes to safely access a lucene index, and should be used\n         with care. Default is \"false\".\n\n         This is not n
 eeded if lock type is 'single'\n     --&gt;\n    &lt;!--\n    &lt;unlockOnStartup&gt;false&lt;/unlockOnStartup&gt;\n      --&gt;\n\n    &lt;!-- Commit Deletion Policy\n         Custom deletion policies can be specified here. The class must\n         implement org.apache.lucene.index.IndexDeletionPolicy.\n\n         The default Solr IndexDeletionPolicy implementation supports\n         deleting index commit points on number of commits, age of\n         commit point and optimized status.\n         \n         The latest commit point should always be preserved regardless\n         of the criteria.\n    --&gt;\n    &lt;!-- \n    &lt;deletionPolicy class=\"solr.SolrDeletionPolicy\"&gt;\n    --&gt;\n      &lt;!-- The number of commit points to be kept --&gt;\n      &lt;!-- &lt;str name=\"maxCommitsToKeep\"&gt;1&lt;/str&gt; --&gt;\n      &lt;!-- The number of optimized commit points to be kept --&gt;\n      &lt;!-- &lt;str name=\"maxOptimizedCommitsToKeep\"&gt;0&lt;/str&gt; --&gt;\n      &l
 t;!--\n          Delete all commit points once they have reached the given age.\n          Supports DateMathParser syntax e.g.\n        --&gt;\n      &lt;!--\n         &lt;str name=\"maxCommitAge\"&gt;30MINUTES&lt;/str&gt;\n         &lt;str name=\"maxCommitAge\"&gt;1DAY&lt;/str&gt;\n      --&gt;\n    &lt;!-- \n    &lt;/deletionPolicy&gt;\n    --&gt;\n\n    &lt;!-- Lucene Infostream\n       \n         To aid in advanced debugging, Lucene provides an \"InfoStream\"\n         of detailed information when indexing.\n\n         Setting the value to true will instruct the underlying Lucene\n         IndexWriter to write its info stream to solr's log. By default,\n         this is enabled here, and controlled through log4j.properties.\n      --&gt;\n     &lt;infoStream&gt;true&lt;/infoStream&gt;\n  &lt;/indexConfig&gt;\n\n\n  &lt;!-- JMX\n       \n       This example enables JMX if and only if an existing MBeanServer\n       is found, use this if you want to configure JMX through JVM\n    
    parameters. Remove this to disable exposing Solr configuration\n       and statistics to JMX.\n\n       For more details see http://wiki.apache.org/solr/SolrJmx\n    --&gt;\n  &lt;jmx /&gt;\n  &lt;!-- If you want to connect to a particular server, specify the\n       agentId \n    --&gt;\n  &lt;!-- &lt;jmx agentId=\"myAgent\" /&gt; --&gt;\n  &lt;!-- If you want to start a new MBeanServer, specify the serviceUrl --&gt;\n  &lt;!-- &lt;jmx serviceUrl=\"service:jmx:rmi:///jndi/rmi://localhost:9999/solr\"/&gt;\n    --&gt;\n\n  &lt;!-- The default high-performance update handler --&gt;\n  &lt;updateHandler class=\"solr.DirectUpdateHandler2\"&gt;\n\n    &lt;!-- Enables a transaction log, used for real-time get, durability, and\n         and solr cloud replica recovery.  The log can grow as big as\n         uncommitted changes to the index, so use of a hard autoCommit\n         is recommended (see below).\n         \"dir\" - the target directory for transaction logs, defaults to the\n   
              solr data directory.  --&gt; \n    &lt;updateLog&gt;\n      &lt;str name=\"dir\"&gt;${solr.ulog.dir:}&lt;/str&gt;\n    &lt;/updateLog&gt;\n \n    &lt;!-- AutoCommit\n\n         Perform a hard commit automatically under certain conditions.\n         Instead of enabling autoCommit, consider using \"commitWithin\"\n         when adding documents. \n\n         http://wiki.apache.org/solr/UpdateXmlMessages\n\n         maxDocs - Maximum number of documents to add since the last\n                   commit before automatically triggering a new commit.\n\n         maxTime - Maximum amount of time in ms that is allowed to pass\n                   since a document was added before automatically\n                   triggering a new commit. \n         openSearcher - if false, the commit causes recent index changes\n           to be flushed to stable storage, but does not cause a new\n           searcher to be opened to make those changes visible.\n\n         If the updateLog is enab
 led, then it's highly recommended to\n         have some sort of hard autoCommit to limit the log size.\n      --&gt;\n     &lt;autoCommit&gt; \n       &lt;maxTime&gt;${solr.autoCommit.maxTime:15000}&lt;/maxTime&gt; \n       &lt;openSearcher&gt;false&lt;/openSearcher&gt; \n     &lt;/autoCommit&gt;\n\n    &lt;!-- softAutoCommit is like autoCommit except it causes a\n         'soft' commit which only ensures that changes are visible\n         but does not ensure that data is synced to disk.  This is\n         faster and more near-realtime friendly than a hard commit.\n      --&gt;\n\n     &lt;autoSoftCommit&gt; \n       &lt;maxTime&gt;${solr.autoSoftCommit.maxTime:5000}&lt;/maxTime&gt; \n     &lt;/autoSoftCommit&gt;\n\n    &lt;!-- Update Related Event Listeners\n         \n         Various IndexWriter related events can trigger Listeners to\n         take actions.\n\n         postCommit - fired after every commit or optimize command\n         postOptimize - fired after every optimize 
 command\n      --&gt;\n    &lt;!-- The RunExecutableListener executes an external command from a\n         hook such as postCommit or postOptimize.\n         \n         exe - the name of the executable to run\n         dir - dir to use as the current working directory. (default=\".\")\n         wait - the calling thread waits until the executable returns. \n                (default=\"true\")\n         args - the arguments to pass to the program.  (default is none)\n         env - environment variables to set.  (default is none)\n      --&gt;\n    &lt;!-- This example shows how RunExecutableListener could be used\n         with the script based replication...\n         http://wiki.apache.org/solr/CollectionDistribution\n      --&gt;\n    &lt;!--\n       &lt;listener event=\"postCommit\" class=\"solr.RunExecutableListener\"&gt;\n         &lt;str name=\"exe\"&gt;solr/bin/snapshooter&lt;/str&gt;\n         &lt;str name=\"dir\"&gt;.&lt;/str&gt;\n         &lt;bool name=\"wait\"&gt;true&lt;
 /bool&gt;\n         &lt;arr name=\"args\"&gt; &lt;str&gt;arg1&lt;/str&gt; &lt;str&gt;arg2&lt;/str&gt; &lt;/arr&gt;\n         &lt;arr name=\"env\"&gt; &lt;str&gt;MYVAR=val1&lt;/str&gt; &lt;/arr&gt;\n       &lt;/listener&gt;\n      --&gt;\n\n  &lt;/updateHandler&gt;\n  \n  &lt;!-- IndexReaderFactory\n\n       Use the following format to specify a custom IndexReaderFactory,\n       which allows for alternate IndexReader implementations.\n\n       ** Experimental Feature **\n\n       Please note - Using a custom IndexReaderFactory may prevent\n       certain other features from working. The API to\n       IndexReaderFactory may change without warning or may even be\n       removed from future releases if the problems cannot be\n       resolved.\n\n\n       ** Features that may not work with custom IndexReaderFactory **\n\n       The ReplicationHandler assumes a disk-resident index. Using a\n       custom IndexReader implementation may cause incompatibility\n       with ReplicationHandle
 r and may cause replication to not work\n       correctly. See SOLR-1366 for details.\n\n    --&gt;\n  &lt;!--\n  &lt;indexReaderFactory name=\"IndexReaderFactory\" class=\"package.class\"&gt;\n    &lt;str name=\"someArg\"&gt;Some Value&lt;/str&gt;\n  &lt;/indexReaderFactory &gt;\n  --&gt;\n\n  &lt;!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n       Query section - these settings control query time things like caches\n       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --&gt;\n  &lt;query&gt;\n    &lt;!-- Max Boolean Clauses\n\n         Maximum number of clauses in each BooleanQuery,  an exception\n         is thrown if exceeded.\n\n         ** WARNING **\n         \n         This option actually modifies a global Lucene property that\n         will affect all SolrCores.  If multiple solrconfig.xml files\n         disagree on this property, the value at any given moment will\n         be based on the last SolrCore to be initiali
 zed.\n         \n      --&gt;\n    &lt;maxBooleanClauses&gt;1024&lt;/maxBooleanClauses&gt;\n\n\n    &lt;!-- Solr Internal Query Caches\n\n         There are two implementations of cache available for Solr,\n         LRUCache, based on a synchronized LinkedHashMap, and\n         FastLRUCache, based on a ConcurrentHashMap.  \n\n         FastLRUCache has faster gets and slower puts in single\n         threaded operation and thus is generally faster than LRUCache\n         when the hit ratio of the cache is high (&gt; 75%), and may be\n         faster under other scenarios on multi-cpu systems.\n    --&gt;\n\n    &lt;!-- Filter Cache\n\n         Cache used by SolrIndexSearcher for filters (DocSets),\n         unordered sets of *all* documents that match a query.  When a\n         new searcher is opened, its caches may be prepopulated or\n         \"autowarmed\" using data from caches in the old searcher.\n         autowarmCount is the number of items to prepopulate.  For\n         LRUCa
 che, the autowarmed items will be the most recently\n         accessed items.\n\n         Parameters:\n           class - the SolrCache implementation LRUCache or\n               (LRUCache or FastLRUCache)\n           size - the maximum number of entries in the cache\n           initialSize - the initial capacity (number of entries) of\n               the cache.  (see java.util.HashMap)\n           autowarmCount - the number of entries to prepopulate from\n               and old cache.  \n      --&gt;\n    &lt;filterCache class=\"solr.FastLRUCache\"\n                 size=\"512\"\n                 initialSize=\"512\"\n                 autowarmCount=\"0\"/&gt;\n\n    &lt;!-- Query Result Cache\n         \n         Caches results of searches - ordered lists of document ids\n         (DocList) based on a query, a sort, and the range of documents requested.  \n      --&gt;\n    &lt;queryResultCache class=\"solr.LRUCache\"\n                     size=\"512\"\n                     initialS
 ize=\"512\"\n                     autowarmCount=\"0\"/&gt;\n   \n    &lt;!-- Document Cache\n\n         Caches Lucene Document objects (the stored fields for each\n         document).  Since Lucene internal document ids are transient,\n         this cache will not be autowarmed.  \n      --&gt;\n    &lt;documentCache class=\"solr.LRUCache\"\n                   size=\"512\"\n                   initialSize=\"512\"\n                   autowarmCount=\"0\"/&gt;\n    \n    &lt;!-- custom cache currently used by block join --&gt; \n    &lt;cache name=\"perSegFilter\"\n      class=\"solr.search.LRUCache\"\n      size=\"10\"\n      initialSize=\"0\"\n      autowarmCount=\"10\"\n      regenerator=\"solr.NoOpRegenerator\" /&gt;\n\n    &lt;!-- Field Value Cache\n         \n         Cache used to hold field values that are quickly accessible\n         by document id.  The fieldValueCache is created by default\n         even if not configured here.\n      --&gt;\n    &lt;!--\n       &lt;fieldValu
 eCache class=\"solr.FastLRUCache\"\n                        size=\"512\"\n                        autowarmCount=\"128\"\n                        showItems=\"32\" /&gt;\n      --&gt;\n\n    &lt;!-- Custom Cache\n\n         Example of a generic cache.  These caches may be accessed by\n         name through SolrIndexSearcher.getCache(),cacheLookup(), and\n         cacheInsert().  The purpose is to enable easy caching of\n         user/application level data.  The regenerator argument should\n         be specified as an implementation of solr.CacheRegenerator \n         if autowarming is desired.  \n      --&gt;\n    &lt;!--\n       &lt;cache name=\"myUserCache\"\n              class=\"solr.LRUCache\"\n              size=\"4096\"\n              initialSize=\"1024\"\n              autowarmCount=\"1024\"\n              regenerator=\"com.mycompany.MyRegenerator\"\n              /&gt;\n      --&gt;\n\n\n    &lt;!-- Lazy Field Loading\n\n         If true, stored fields that are not requested
  will be loaded\n         lazily.  This can result in a significant speed improvement\n         if the usual case is to not load all stored fields,\n         especially if the skipped fields are large compressed text\n         fields.\n    --&gt;\n    &lt;enableLazyFieldLoading&gt;true&lt;/enableLazyFieldLoading&gt;\n\n   &lt;!-- Use Filter For Sorted Query\n\n        A possible optimization that attempts to use a filter to\n        satisfy a search.  If the requested sort does not include\n        score, then the filterCache will be checked for a filter\n        matching the query. If found, the filter will be used as the\n        source of document ids, and then the sort will be applied to\n        that.\n\n        For most situations, this will not be useful unless you\n        frequently get the same search repeatedly with different sort\n        options, and none of them ever use \"score\"\n     --&gt;\n   &lt;!--\n      &lt;useFilterForSortedQuery&gt;true&lt;/useFilterForSorte
 dQuery&gt;\n     --&gt;\n\n   &lt;!-- Result Window Size\n\n        An optimization for use with the queryResultCache.  When a search\n        is requested, a superset of the requested number of document ids\n        are collected.  For example, if a search for a particular query\n        requests matching documents 10 through 19, and queryWindowSize is 50,\n        then documents 0 through 49 will be collected and cached.  Any further\n        requests in that range can be satisfied via the cache.  \n     --&gt;\n   &lt;queryResultWindowSize&gt;20&lt;/queryResultWindowSize&gt;\n\n   &lt;!-- Maximum number of documents to cache for any entry in the\n        queryResultCache. \n     --&gt;\n   &lt;queryResultMaxDocsCached&gt;200&lt;/queryResultMaxDocsCached&gt;\n\n   &lt;!-- Query Related Event Listeners\n\n        Various IndexSearcher related events can trigger Listeners to\n        take actions.\n\n        newSearcher - fired whenever a new searcher is being prepared\n        and 
 there is a current searcher handling requests (aka\n        registered).  It can be used to prime certain caches to\n        prevent long request times for certain requests.\n\n        firstSearcher - fired whenever a new searcher is being\n        prepared but there is no current registered searcher to handle\n        requests or to gain autowarming data from.\n\n        \n     --&gt;\n    &lt;!-- QuerySenderListener takes an array of NamedList and executes a\n         local query request for each NamedList in sequence. \n      --&gt;\n    &lt;listener event=\"newSearcher\" class=\"solr.QuerySenderListener\"&gt;\n      &lt;arr name=\"queries\"&gt;\n        &lt;!--\n           &lt;lst&gt;&lt;str name=\"q\"&gt;solr&lt;/str&gt;&lt;str name=\"sort\"&gt;price asc&lt;/str&gt;&lt;/lst&gt;\n           &lt;lst&gt;&lt;str name=\"q\"&gt;rocks&lt;/str&gt;&lt;str name=\"sort\"&gt;weight asc&lt;/str&gt;&lt;/lst&gt;\n          --&gt;\n      &lt;/arr&gt;\n    &lt;/listener&gt;\n    &lt;listener ev
 ent=\"firstSearcher\" class=\"solr.QuerySenderListener\"&gt;\n      &lt;arr name=\"queries\"&gt;\n        &lt;lst&gt;\n          &lt;str name=\"q\"&gt;static firstSearcher warming in solrconfig.xml&lt;/str&gt;\n        &lt;/lst&gt;\n      &lt;/arr&gt;\n    &lt;/listener&gt;\n\n    &lt;!-- Use Cold Searcher\n\n         If a search request comes in and there is no current\n         registered searcher, then immediately register the still\n         warming searcher and use it.  If \"false\" then all requests\n         will block until the first searcher is done warming.\n      --&gt;\n    &lt;useColdSearcher&gt;false&lt;/useColdSearcher&gt;\n\n    &lt;!-- Max Warming Searchers\n         \n         Maximum number of searchers that may be warming in the\n         background concurrently.  An error is returned if this limit\n         is exceeded.\n\n         Recommend values of 1-2 for read-only slaves, higher for\n         masters w/o cache warming.\n      --&gt;\n    &lt;maxWarmingSearc
 hers&gt;2&lt;/maxWarmingSearchers&gt;\n\n  &lt;/query&gt;\n\n\n  &lt;!-- Request Dispatcher\n\n       This section contains instructions for how the SolrDispatchFilter\n       should behave when processing requests for this SolrCore.\n\n       handleSelect is a legacy option that affects the behavior of requests\n       such as /select?qt=XXX\n\n       handleSelect=\"true\" will cause the SolrDispatchFilter to process\n       the request and dispatch the query to a handler specified by the \n       \"qt\" param, assuming \"/select\" isn't already registered.\n\n       handleSelect=\"false\" will cause the SolrDispatchFilter to\n       ignore \"/select\" requests, resulting in a 404 unless a handler\n       is explicitly registered with the name \"/select\"\n\n       handleSelect=\"true\" is not recommended for new users, but is the default\n       for backwards compatibility\n    --&gt;\n  &lt;requestDispatcher handleSelect=\"false\" &gt;\n    &lt;!-- Request Parsing\n\n         The
 se settings indicate how Solr Requests may be parsed, and\n         what restrictions may be placed on the ContentStreams from\n         those requests\n\n         enableRemoteStreaming - enables use of the stream.file\n         and stream.url parameters for specifying remote streams.\n\n         multipartUploadLimitInKB - specifies the max size (in KiB) of\n         Multipart File Uploads that Solr will allow in a Request.\n         \n         formdataUploadLimitInKB - specifies the max size (in KiB) of\n         form data (application/x-www-form-urlencoded) sent via\n         POST. You can use POST to pass request parameters not\n         fitting into the URL.\n         \n         addHttpRequestToContext - if set to true, it will instruct\n         the requestParsers to include the original HttpServletRequest\n         object in the context map of the SolrQueryRequest under the \n         key \"httpRequest\". It will not be used by any of the existing\n         Solr components, bu
 t may be useful when developing custom \n         plugins.\n         \n         *** WARNING ***\n         The settings below authorize Solr to fetch remote files, You\n         should make sure your system has some authentication before\n         using enableRemoteStreaming=\"true\"\n\n      --&gt; \n    &lt;requestParsers enableRemoteStreaming=\"true\" \n                    multipartUploadLimitInKB=\"2048000\"\n                    formdataUploadLimitInKB=\"2048\"\n                    addHttpRequestToContext=\"false\"/&gt;\n\n    &lt;!-- HTTP Caching\n\n         Set HTTP caching related parameters (for proxy caches and clients).\n\n         The options below instruct Solr not to output any HTTP Caching\n         related headers\n      --&gt;\n    &lt;httpCaching never304=\"true\" /&gt;\n    &lt;!-- If you include a &lt;cacheControl&gt; directive, it will be used to\n         generate a Cache-Control header (as well as an Expires header\n         if the value contains \"max-age=\")\n
          \n         By default, no Cache-Control header is generated.\n         \n         You can use the &lt;cacheControl&gt; option even if you have set\n         never304=\"true\"\n      --&gt;\n    &lt;!--\n       &lt;httpCaching never304=\"true\" &gt;\n         &lt;cacheControl&gt;max-age=30, public&lt;/cacheControl&gt; \n       &lt;/httpCaching&gt;\n      --&gt;\n    &lt;!-- To enable Solr to respond with automatically generated HTTP\n         Caching headers, and to response to Cache Validation requests\n         correctly, set the value of never304=\"false\"\n         \n         This will cause Solr to generate Last-Modified and ETag\n         headers based on the properties of the Index.\n\n         The following options can also be specified to affect the\n         values of these headers...\n\n         lastModFrom - the default value is \"openTime\" which means the\n         Last-Modified value (and validation against If-Modified-Since\n         requests) will all be rel
 ative to when the current Searcher\n         was opened.  You can change it to lastModFrom=\"dirLastMod\" if\n         you want the value to exactly correspond to when the physical\n         index was last modified.\n\n         etagSeed=\"...\" is an option you can change to force the ETag\n         header (and validation against If-None-Match requests) to be\n         different even if the index has not changed (ie: when making\n         significant changes to your config file)\n\n         (lastModifiedFrom and etagSeed are both ignored if you use\n         the never304=\"true\" option)\n      --&gt;\n    &lt;!--\n       &lt;httpCaching lastModifiedFrom=\"openTime\"\n                    etagSeed=\"Solr\"&gt;\n         &lt;cacheControl&gt;max-age=30, public&lt;/cacheControl&gt; \n       &lt;/httpCaching&gt;\n      --&gt;\n  &lt;/requestDispatcher&gt;\n\n  &lt;!-- Request Handlers \n\n       http://wiki.apache.org/solr/SolrRequestHandler\n\n       Incoming queries will be dispatched 
 to a specific handler by name\n       based on the path specified in the request.\n\n       Legacy behavior: If the request path uses \"/select\" but no Request\n       Handler has that name, and if handleSelect=\"true\" has been specified in\n       the requestDispatcher, then the Request Handler is dispatched based on\n       the qt parameter.  Handlers without a leading '/' are accessed this way\n       like so: http://host/app/[core/]select?qt=name  If no qt is\n       given, then the requestHandler that declares default=\"true\" will be\n       used or the one named \"standard\".\n\n       If a Request Handler is declared with startup=\"lazy\", then it will\n       not be initialized until the first request that uses it.\n\n    --&gt;\n\n  &lt;requestHandler name=\"/dataimport\" class=\"solr.DataImportHandler\"&gt;\n    &lt;lst name=\"defaults\"&gt;\n      &lt;str name=\"config\"&gt;solr-data-config.xml&lt;/str&gt;\n    &lt;/lst&gt;\n  &lt;/requestHandler&gt;\n\n  &lt;!-- Searc
 hHandler\n\n       http://wiki.apache.org/solr/SearchHandler\n\n       For processing Search Queries, the primary Request Handler\n       provided with Solr is \"SearchHandler\" It delegates to a sequent\n       of SearchComponents (see below) and supports distributed\n       queries across multiple shards\n    --&gt;\n  &lt;requestHandler name=\"/select\" class=\"solr.SearchHandler\"&gt;\n    &lt;!-- default values for query parameters can be specified, these\n         will be overridden by parameters in the request\n      --&gt;\n     &lt;lst name=\"defaults\"&gt;\n       &lt;str name=\"echoParams\"&gt;explicit&lt;/str&gt;\n       &lt;int name=\"rows\"&gt;10&lt;/int&gt;\n       &lt;str name=\"df\"&gt;text&lt;/str&gt;\n     &lt;/lst&gt;\n    &lt;!-- In addition to defaults, \"appends\" params can be specified\n         to identify values which should be appended to the list of\n         multi-val params from the query (or the existing \"defaults\").\n      --&gt;\n    &lt;!-- In th
 is example, the param \"fq=instock:true\" would be appended to\n         any query time fq params the user may specify, as a mechanism for\n         partitioning the index, independent of any user selected filtering\n         that may also be desired (perhaps as a result of faceted searching).\n\n         NOTE: there is *absolutely* nothing a client can do to prevent these\n         \"appends\" values from being used, so don't use this mechanism\n         unless you are sure you always want it.\n      --&gt;\n    &lt;!--\n       &lt;lst name=\"appends\"&gt;\n         &lt;str name=\"fq\"&gt;inStock:true&lt;/str&gt;\n       &lt;/lst&gt;\n      --&gt;\n    &lt;!-- \"invariants\" are a way of letting the Solr maintainer lock down\n         the options available to Solr clients.  Any params values\n         specified here are used regardless of what values may be specified\n         in either the query, the \"defaults\", or the \"appends\" params.\n\n         In this example, the facet.f
 ield and facet.query params would\n         be fixed, limiting the facets clients can use.  Faceting is\n         not turned on by default - but if the client does specify\n         facet=true in the request, these are the only facets they\n         will be able to see counts for; regardless of what other\n         facet.field or facet.query params they may specify.\n\n         NOTE: there is *absolutely* nothing a client can do to prevent these\n         \"invariants\" values from being used, so don't use this mechanism\n         unless you are sure you always want it.\n      --&gt;\n    &lt;!--\n       &lt;lst name=\"invariants\"&gt;\n         &lt;str name=\"facet.field\"&gt;cat&lt;/str&gt;\n         &lt;str name=\"facet.field\"&gt;manu_exact&lt;/str&gt;\n         &lt;str name=\"facet.query\"&gt;price:[* TO 500]&lt;/str&gt;\n         &lt;str name=\"facet.query\"&gt;price:[500 TO *]&lt;/str&gt;\n       &lt;/lst&gt;\n      --&gt;\n    &lt;!-- If the default list of SearchComponents 
 is not desired, that\n         list can either be overridden completely, or components can be\n         prepended or appended to the default list.  (see below)\n      --&gt;\n    &lt;!--\n       &lt;arr name=\"components\"&gt;\n         &lt;str&gt;nameOfCustomComponent1&lt;/str&gt;\n         &lt;str&gt;nameOfCustomComponent2&lt;/str&gt;\n       &lt;/arr&gt;\n      --&gt;\n    &lt;/requestHandler&gt;\n\n  &lt;!-- A request handler that returns indented JSON by default --&gt;\n  &lt;requestHandler name=\"/query\" class=\"solr.SearchHandler\"&gt;\n     &lt;lst name=\"defaults\"&gt;\n       &lt;str name=\"echoParams\"&gt;explicit&lt;/str&gt;\n       &lt;str name=\"wt\"&gt;json&lt;/str&gt;\n       &lt;str name=\"indent\"&gt;true&lt;/str&gt;\n       &lt;str name=\"df\"&gt;text&lt;/str&gt;\n     &lt;/lst&gt;\n  &lt;/requestHandler&gt;\n\n\n  &lt;!-- realtime get handler, guaranteed to return the latest stored fields of\n       any document, without the need to commit or open a new searcher
 .  The\n       current implementation relies on the updateLog feature being enabled.\n\n       ** WARNING **\n       Do NOT disable the realtime get handler at /get if you are using\n       SolrCloud otherwise any leader election will cause a full sync in ALL\n       replicas for the shard in question. Similarly, a replica recovery will\n       also always fetch the complete index from the leader because a partial\n       sync will not be possible in the absence of this handler.\n  --&gt;\n  &lt;requestHandler name=\"/get\" class=\"solr.RealTimeGetHandler\"&gt;\n     &lt;lst name=\"defaults\"&gt;\n       &lt;str name=\"omitHeader\"&gt;true&lt;/str&gt;\n       &lt;str name=\"wt\"&gt;json&lt;/str&gt;\n       &lt;str name=\"indent\"&gt;true&lt;/str&gt;\n     &lt;/lst&gt;\n  &lt;/requestHandler&gt;\n\n\n  &lt;!-- A Robust Example\n\n       This example SearchHandler declaration shows off usage of the\n       SearchHandler with many defaults declared\n\n       Note that multiple instance
 s of the same Request Handler\n       (SearchHandler) can be registered multiple times with different\n       names (and different init parameters)\n    --&gt;\n  &lt;requestHandler name=\"/browse\" class=\"solr.SearchHandler\"&gt;\n    &lt;lst name=\"defaults\"&gt;\n      &lt;str name=\"echoParams\"&gt;explicit&lt;/str&gt;\n\n      &lt;!-- VelocityResponseWriter settings --&gt;\n      &lt;str name=\"wt\"&gt;velocity&lt;/str&gt;\n      &lt;str name=\"v.template\"&gt;browse&lt;/str&gt;\n      &lt;str name=\"v.layout\"&gt;layout&lt;/str&gt;\n\n      &lt;!-- Query settings --&gt;\n      &lt;str name=\"defType\"&gt;edismax&lt;/str&gt;\n      &lt;str name=\"q.alt\"&gt;*:*&lt;/str&gt;\n      &lt;str name=\"rows\"&gt;10&lt;/str&gt;\n      &lt;str name=\"fl\"&gt;*,score&lt;/str&gt;\n\n      &lt;!-- Faceting defaults --&gt;\n      &lt;str name=\"facet\"&gt;on&lt;/str&gt;\n      &lt;str name=\"facet.mincount\"&gt;1&lt;/str&gt;\n    &lt;/lst&gt;\n  &lt;/requestHandler&gt;\n\n\n  &lt;initParams
  path=\"/update/**,/query,/select,/tvrh,/elevate,/spell,/browse\"&gt;\n    &lt;lst name=\"defaults\"&gt;\n      &lt;str name=\"df\"&gt;text&lt;/str&gt;\n      &lt;str name=\"update.chain\"&gt;add-unknown-fields-to-the-schema&lt;/str&gt;\n    &lt;/lst&gt;\n  &lt;/initParams&gt;\n\n  &lt;!-- Update Request Handler.\n       \n       http://wiki.apache.org/solr/UpdateXmlMessages\n\n       The canonical Request Handler for Modifying the Index through\n       commands specified using XML, JSON, CSV, or JAVABIN\n\n       Note: Since solr1.1 requestHandlers requires a valid content\n       type header if posted in the body. For example, curl now\n       requires: -H 'Content-type:text/xml; charset=utf-8'\n       \n       To override the request content type and force a specific \n       Content-type, use the request parameter: \n         ?update.contentType=text/csv\n       \n       This handler will pick a response format to match the input\n       if the 'wt' parameter is not explicit\n  
   --&gt;\n  &lt;requestHandler name=\"/update\" class=\"solr.UpdateRequestHandler\"&gt;\n    &lt;!-- See below for information on defining \n         updateRequestProcessorChains that can be used by name \n         on each Update Request\n      --&gt;\n    &lt;!--\n       &lt;lst name=\"defaults\"&gt;\n         &lt;str name=\"update.chain\"&gt;dedupe&lt;/str&gt;\n       &lt;/lst&gt;\n       --&gt;\n  &lt;/requestHandler&gt;\n\n  &lt;!-- Solr Cell Update Request Handler\n\n       http://wiki.apache.org/solr/ExtractingRequestHandler \n\n    --&gt;\n  &lt;requestHandler name=\"/update/extract\" \n                  startup=\"lazy\"\n                  class=\"solr.extraction.ExtractingRequestHandler\" &gt;\n    &lt;lst name=\"defaults\"&gt;\n      &lt;str name=\"lowernames\"&gt;true&lt;/str&gt;\n      &lt;str name=\"uprefix\"&gt;ignored_&lt;/str&gt;\n\n      &lt;!-- capture link hrefs but ignore div attributes --&gt;\n      &lt;str name=\"captureAttr\"&gt;true&lt;/str&gt;\n      &lt;str 
 name=\"fmap.a\"&gt;links&lt;/str&gt;\n      &lt;str name=\"fmap.div\"&gt;ignored_&lt;/str&gt;\n    &lt;/lst&gt;\n  &lt;/requestHandler&gt;\n\n\n  &lt;!-- Field Analysis Request Handler\n\n       RequestHandler that provides much the same functionality as\n       analysis.jsp. Provides the ability to specify multiple field\n       types and field names in the same request and outputs\n       index-time and query-time analysis for each of them.\n\n       Request parameters are:\n       analysis.fieldname - field name whose analyzers are to be used\n\n       analysis.fieldtype - field type whose analyzers are to be used\n       analysis.fieldvalue - text for index-time analysis\n       q (or analysis.q) - text for query time analysis\n       analysis.showmatch (true|false) - When set to true and when\n           query analysis is performed, the produced tokens of the\n           field value analysis will be marked as \"matched\" for every\n           token that is produces by the query
  analysis\n   --&gt;\n  &lt;requestHandler name=\"/analysis/field\" \n                  startup=\"lazy\"\n                  class=\"solr.FieldAnalysisRequestHandler\" /&gt;\n\n\n  &lt;!-- Document Analysis Handler\n\n       http://wiki.apache.org/solr/AnalysisRequestHandler\n\n       An analysis handler that provides a breakdown of the analysis\n       process of provided documents. This handler expects a (single)\n       content stream with the following format:\n\n       &lt;docs&gt;\n         &lt;doc&gt;\n           &lt;field name=\"id\"&gt;1&lt;/field&gt;\n           &lt;field name=\"name\"&gt;The Name&lt;/field&gt;\n           &lt;field name=\"text\"&gt;The Text Value&lt;/field&gt;\n         &lt;/doc&gt;\n         &lt;doc&gt;...&lt;/doc&gt;\n         &lt;doc&gt;...&lt;/doc&gt;\n         ...\n       &lt;/docs&gt;\n\n    Note: Each document must contain a field which serves as the\n    unique key. This key is used in the returned response to associate\n    an analysis breakdown t
 o the analyzed document.\n\n    Like the FieldAnalysisRequestHandler, this handler also supports\n    query analysis by sending either an \"analysis.query\" or \"q\"\n    request parameter that holds the query text to be analyzed. It\n    also supports the \"analysis.showmatch\" parameter which when set to\n    true, all field tokens that match the query tokens will be marked\n    as a \"match\". \n  --&gt;\n  &lt;requestHandler name=\"/analysis/document\" \n                  class=\"solr.DocumentAnalysisRequestHandler\" \n                  startup=\"lazy\" /&gt;\n\n  &lt;!-- Admin Handlers\n\n       Admin Handlers - This will register all the standard admin\n       RequestHandlers.  \n    --&gt;\n  &lt;requestHandler name=\"/admin/\" \n                  class=\"solr.admin.AdminHandlers\" /&gt;\n  &lt;!-- This single handler is equivalent to the following... --&gt;\n  &lt;!--\n     &lt;requestHandler name=\"/admin/luke\"       class=\"solr.admin.LukeRequestHandler\" /&gt;\n     &lt;
 requestHandler name=\"/admin/system\"     class=\"solr.admin.SystemInfoHandler\" /&gt;\n     &lt;requestHandler name=\"/admin/plugins\"    class=\"solr.admin.PluginInfoHandler\" /&gt;\n     &lt;requestHandler name=\"/admin/threads\"    class=\"solr.admin.ThreadDumpHandler\" /&gt;\n     &lt;requestHandler name=\"/admin/properties\" class=\"solr.admin.PropertiesRequestHandler\" /&gt;\n     &lt;requestHandler name=\"/admin/file\"       class=\"solr.admin.ShowFileRequestHandler\" &gt;\n    --&gt;\n  &lt;!-- If you wish to hide files under ${solr.home}/conf, explicitly\n       register the ShowFileRequestHandler using the definition below. \n       NOTE: The glob pattern ('*') is the only pattern supported at present, *.xml will\n             not exclude all files ending in '.xml'. Use it to exclude _all_ updates\n    --&gt;\n  &lt;!--\n     &lt;requestHandler name=\"/admin/file\" \n                     class=\"solr.admin.ShowFileRequestHandler\" &gt;\n       &lt;lst name=\"invariants\"&
 gt;\n         &lt;str name=\"hidden\"&gt;synonyms.txt&lt;/str&gt; \n         &lt;str name=\"hidden\"&gt;anotherfile.txt&lt;/str&gt; \n         &lt;str name=\"hidden\"&gt;*&lt;/str&gt; \n       &lt;/lst&gt;\n     &lt;/requestHandler&gt;\n    --&gt;\n\n  &lt;!--\n    Enabling this request handler (which is NOT a default part of the admin handler) will allow the Solr UI to edit\n    all the config files. This is intended for secure/development use ONLY! Leaving available and publically\n    accessible is a security vulnerability and should be done with extreme caution!\n  --&gt;\n  &lt;!--\n  &lt;requestHandler name=\"/admin/fileedit\" class=\"solr.admin.EditFileRequestHandler\" &gt;\n    &lt;lst name=\"invariants\"&gt;\n         &lt;str name=\"hidden\"&gt;synonyms.txt&lt;/str&gt;\n         &lt;str name=\"hidden\"&gt;anotherfile.txt&lt;/str&gt;\n    &lt;/lst&gt;\n  &lt;/requestHandler&gt;\n  --&gt;\n  &lt;!-- ping/healthcheck --&gt;\n  &lt;requestHandler name=\"/admin/ping\" class=\"so
 lr.PingRequestHandler\"&gt;\n    &lt;lst name=\"invariants\"&gt;\n      &lt;str name=\"q\"&gt;solrpingquery&lt;/str&gt;\n    &lt;/lst&gt;\n    &lt;lst name=\"defaults\"&gt;\n      &lt;str name=\"echoParams\"&gt;all&lt;/str&gt;\n    &lt;/lst&gt;\n    &lt;!-- An optional feature of the PingRequestHandler is to configure the \n         handler with a \"healthcheckFile\" which can be used to enable/disable \n         the PingRequestHandler.\n         relative paths are resolved against the data dir \n      --&gt;\n    &lt;!-- &lt;str name=\"healthcheckFile\"&gt;server-enabled.txt&lt;/str&gt; --&gt;\n  &lt;/requestHandler&gt;\n\n  &lt;!-- Echo the request contents back to the client --&gt;\n  &lt;requestHandler name=\"/debug/dump\" class=\"solr.DumpRequestHandler\" &gt;\n    &lt;lst name=\"defaults\"&gt;\n     &lt;str name=\"echoParams\"&gt;explicit&lt;/str&gt; \n     &lt;str name=\"echoHandler\"&gt;true&lt;/str&gt;\n    &lt;/lst&gt;\n  &lt;/requestHandler&gt;\n  \n  &lt;!-- Solr Replica
 tion\n\n       The SolrReplicationHandler supports replicating indexes from a\n       \"master\" used for indexing and \"slaves\" used for queries.\n\n       http://wiki.apache.org/solr/SolrReplication \n\n       It is also necessary for SolrCloud to function (in Cloud mode, the\n       replication handler is used to bulk transfer segments when nodes \n       are added or need to recover).\n\n       https://wiki.apache.org/solr/SolrCloud/\n    --&gt;\n  &lt;requestHandler name=\"/replication\" class=\"solr.ReplicationHandler\" &gt; \n    &lt;!--\n       To enable simple master/slave replication, uncomment one of the \n       sections below, depending on whether this solr instance should be\n       the \"master\" or a \"slave\".  If this instance is a \"slave\" you will \n       also need to fill in the masterUrl to point to a real machine.\n    --&gt;\n    &lt;!--\n       &lt;lst name=\"master\"&gt;\n         &lt;str name=\"replicateAfter\"&gt;commit&lt;/str&gt;\n         &lt;str na
 me=\"replicateAfter\"&gt;startup&lt;/str&gt;\n         &lt;str name=\"confFiles\"&gt;schema.xml,stopwords.txt&lt;/str&gt;\n       &lt;/lst&gt;\n    --&gt;\n    &lt;!--\n       &lt;lst name=\"slave\"&gt;\n         &lt;str name=\"masterUrl\"&gt;http://your-master-hostname:8983/solr&lt;/str&gt;\n         &lt;str name=\"pollInterval\"&gt;00:00:60&lt;/str&gt;\n       &lt;/lst&gt;\n    --&gt;\n  &lt;/requestHandler&gt;\n\n  &lt;!-- Search Components\n\n       Search components are registered to SolrCore and used by \n       instances of SearchHandler (which can access them by name)\n       \n       By default, the following components are available:\n       \n       &lt;searchComponent name=\"query\"     class=\"solr.QueryComponent\" /&gt;\n       &lt;searchComponent name=\"facet\"     class=\"solr.FacetComponent\" /&gt;\n       &lt;searchComponent name=\"mlt\"       class=\"solr.MoreLikeThisComponent\" /&gt;\n       &lt;searchComponent name=\"highlight\" class=\"solr.HighlightComponent\"
  /&gt;\n       &lt;searchComponent name=\"stats\"     class=\"solr.StatsComponent\" /&gt;\n       &lt;searchComponent name=\"debug\"     class=\"solr.DebugComponent\" /&gt;\n   \n       Default configuration in a requestHandler would look like:\n\n       &lt;arr name=\"components\"&gt;\n         &lt;str&gt;query&lt;/str&gt;\n         &lt;str&gt;facet&lt;/str&gt;\n         &lt;str&gt;mlt&lt;/str&gt;\n         &lt;str&gt;highligh

<TRUNCATED>

[7/8] ambari git commit: AMBARI-15806. Initial commit for Logsearch service stack definition (oleewere)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-audit_logs-solrconfig.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-audit_logs-solrconfig.xml b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-audit_logs-solrconfig.xml
new file mode 100644
index 0000000..4da16b1
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-audit_logs-solrconfig.xml
@@ -0,0 +1,1928 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * 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.
+ */
+-->
+
+<!-- This is a special config file for properties used to monitor status of the service -->
+<configuration supports_adding_forbidden="true">
+
+  <property>
+    <name>logsearch_audit_logs_max_retention</name>
+    <value>7</value>
+    <display-name>Max retention</display-name>
+    <description>Days to retain the audit logs in Solr</description>
+  </property>
+
+  <!-- solrconfig.xml -->
+
+  <property>
+    <name>content</name>
+    <description>This is the jinja template for solrconfig.xml file for service logs</description>
+    <value>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
+&lt;!--
+ 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.
+--&gt;
+
+&lt;!--
+     For more details about configurations options that may appear in
+     this file, see http://wiki.apache.org/solr/SolrConfigXml.
+--&gt;
+&lt;config&gt;
+  &lt;!-- In all configuration below, a prefix of "solr." for class names
+       is an alias that causes solr to search appropriate packages,
+       including org.apache.solr.(search|update|request|core|analysis)
+
+       You may also specify a fully qualified Java classname if you
+       have your own custom plugins.
+    --&gt;
+
+  &lt;!-- Controls what version of Lucene various components of Solr
+       adhere to.  Generally, you want to use the latest version to
+       get all bug fixes and improvements. It is highly recommended
+       that you fully re-index after changing this setting as it can
+       affect both how text is indexed and queried.
+  --&gt;
+  &lt;luceneMatchVersion&gt;5.0.0&lt;/luceneMatchVersion&gt;
+
+  &lt;!-- &lt;lib/&gt; directives can be used to instruct Solr to load any Jars
+       identified and use them to resolve any "plugins" specified in
+       your solrconfig.xml or schema.xml (ie: Analyzers, Request
+       Handlers, etc...).
+
+       All directories and paths are resolved relative to the
+       instanceDir.
+
+       Please note that &lt;lib/&gt; directives are processed in the order
+       that they appear in your solrconfig.xml file, and are "stacked"
+       on top of each other when building a ClassLoader - so if you have
+       plugin jars with dependencies on other jars, the "lower level"
+       dependency jars should be loaded first.
+
+       If a "./lib" directory exists in your instanceDir, all files
+       found in it are included as if you had used the following
+       syntax...
+
+              &lt;lib dir="./lib" /&gt;
+    --&gt;
+
+  &lt;!-- A 'dir' option by itself adds any files found in the directory
+       to the classpath, this is useful for including all jars in a
+       directory.
+
+       When a 'regex' is specified in addition to a 'dir', only the
+       files in that directory which completely match the regex
+       (anchored on both ends) will be included.
+
+       If a 'dir' option (with or without a regex) is used and nothing
+       is found that matches, a warning will be logged.
+
+       The examples below can be used to load some solr-contribs along
+       with their external dependencies.
+    --&gt;
+  &lt;lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-dataimporthandler-.*\.jar" /&gt;
+
+  &lt;lib dir="${solr.install.dir:../../../..}/contrib/extraction/lib" regex=".*\.jar" /&gt;
+  &lt;lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-cell-\d.*\.jar" /&gt;
+
+  &lt;lib dir="${solr.install.dir:../../../..}/contrib/clustering/lib/" regex=".*\.jar" /&gt;
+  &lt;lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-clustering-\d.*\.jar" /&gt;
+
+  &lt;lib dir="${solr.install.dir:../../../..}/contrib/langid/lib/" regex=".*\.jar" /&gt;
+  &lt;lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-langid-\d.*\.jar" /&gt;
+
+  &lt;lib dir="${solr.install.dir:../../../..}/contrib/velocity/lib" regex=".*\.jar" /&gt;
+  &lt;lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-velocity-\d.*\.jar" /&gt;
+
+  &lt;!-- an exact 'path' can be used instead of a 'dir' to specify a
+       specific jar file.  This will cause a serious error to be logged
+       if it can't be loaded.
+    --&gt;
+  &lt;!--
+     &lt;lib path="../a-jar-that-does-not-exist.jar" /&gt;
+  --&gt;
+
+  &lt;!-- Data Directory
+
+       Used to specify an alternate directory to hold all index data
+       other than the default ./data under the Solr home.  If
+       replication is in use, this should match the replication
+       configuration.
+    --&gt;
+  &lt;dataDir&gt;${solr.data.dir:}&lt;/dataDir&gt;
+
+
+  &lt;!-- The DirectoryFactory to use for indexes.
+
+       solr.StandardDirectoryFactory is filesystem
+       based and tries to pick the best implementation for the current
+       JVM and platform.  solr.NRTCachingDirectoryFactory, the default,
+       wraps solr.StandardDirectoryFactory and caches small files in memory
+       for better NRT performance.
+
+       One can force a particular implementation via solr.MMapDirectoryFactory,
+       solr.NIOFSDirectoryFactory, or solr.SimpleFSDirectoryFactory.
+
+       solr.RAMDirectoryFactory is memory based, not
+       persistent, and doesn't work with replication.
+    --&gt;
+  &lt;directoryFactory name="DirectoryFactory"
+                    class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"&gt;
+
+
+    &lt;!-- These will be used if you are using the solr.HdfsDirectoryFactory,
+         otherwise they will be ignored. If you don't plan on using hdfs,
+         you can safely remove this section. --&gt;
+    &lt;!-- The root directory that collection data should be written to. --&gt;
+    &lt;str name="solr.hdfs.home"&gt;${solr.hdfs.home:}&lt;/str&gt;
+    &lt;!-- The hadoop configuration files to use for the hdfs client. --&gt;
+    &lt;str name="solr.hdfs.confdir"&gt;${solr.hdfs.confdir:}&lt;/str&gt;
+    &lt;!-- Enable/Disable the hdfs cache. --&gt;
+    &lt;str name="solr.hdfs.blockcache.enabled"&gt;${solr.hdfs.blockcache.enabled:true}&lt;/str&gt;
+    &lt;!-- Enable/Disable using one global cache for all SolrCores.
+         The settings used will be from the first HdfsDirectoryFactory created. --&gt;
+    &lt;str name="solr.hdfs.blockcache.global"&gt;${solr.hdfs.blockcache.global:true}&lt;/str&gt;
+
+  &lt;/directoryFactory&gt;
+
+  &lt;!-- The CodecFactory for defining the format of the inverted index.
+       The default implementation is SchemaCodecFactory, which is the official Lucene
+       index format, but hooks into the schema to provide per-field customization of
+       the postings lists and per-document values in the fieldType element
+       (postingsFormat/docValuesFormat). Note that most of the alternative implementations
+       are experimental, so if you choose to customize the index format, it's a good
+       idea to convert back to the official format e.g. via IndexWriter.addIndexes(IndexReader)
+       before upgrading to a newer version to avoid unnecessary reindexing.
+  --&gt;
+  &lt;codecFactory class="solr.SchemaCodecFactory"/&gt;
+
+  &lt;!-- To enable dynamic schema REST APIs, use the following for &lt;schemaFactory&gt;: --&gt;
+
+       &lt;schemaFactory class="ManagedIndexSchemaFactory"&gt;
+         &lt;bool name="mutable"&gt;true&lt;/bool&gt;
+         &lt;str name="managedSchemaResourceName"&gt;managed-schema&lt;/str&gt;
+       &lt;/schemaFactory&gt;
+&lt;!--
+       When ManagedIndexSchemaFactory is specified, Solr will load the schema from
+       the resource named in 'managedSchemaResourceName', rather than from schema.xml.
+       Note that the managed schema resource CANNOT be named schema.xml.  If the managed
+       schema does not exist, Solr will create it after reading schema.xml, then rename
+       'schema.xml' to 'schema.xml.bak'.
+
+       Do NOT hand edit the managed schema - external modifications will be ignored and
+       overwritten as a result of schema modification REST API calls.
+
+       When ManagedIndexSchemaFactory is specified with mutable = true, schema
+       modification REST API calls will be allowed; otherwise, error responses will be
+       sent back for these requests.
+
+  &lt;schemaFactory class="ClassicIndexSchemaFactory"/&gt;
+  --&gt;
+
+  &lt;!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+       Index Config - These settings control low-level behavior of indexing
+       Most example settings here show the default value, but are commented
+       out, to more easily see where customizations have been made.
+
+       Note: This replaces &lt;indexDefaults&gt; and &lt;mainIndex&gt; from older versions
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --&gt;
+  &lt;indexConfig&gt;
+    &lt;!-- maxFieldLength was removed in 4.0. To get similar behavior, include a
+         LimitTokenCountFilterFactory in your fieldType definition. E.g.
+     &lt;filter class="solr.LimitTokenCountFilterFactory" maxTokenCount="10000"/&gt;
+    --&gt;
+    &lt;!-- Maximum time to wait for a write lock (ms) for an IndexWriter. Default: 1000 --&gt;
+    &lt;!-- &lt;writeLockTimeout&gt;1000&lt;/writeLockTimeout&gt;  --&gt;
+    &lt;!-- LogSearch customization to avoid timeouts --&gt;
+    &lt;writeLockTimeout&gt;10000&lt;/writeLockTimeout&gt;
+
+    &lt;!-- The maximum number of simultaneous threads that may be
+         indexing documents at once in IndexWriter; if more than this
+         many threads arrive they will wait for others to finish.
+         Default in Solr/Lucene is 8. --&gt;
+    &lt;!-- &lt;maxIndexingThreads&gt;8&lt;/maxIndexingThreads&gt;  --&gt;
+    &lt;!-- LogSearch customization of increase performance --&gt;
+    &lt;maxIndexingThreads&gt;50&lt;/maxIndexingThreads&gt;
+
+    &lt;!-- Expert: Enabling compound file will use less files for the index,
+         using fewer file descriptors on the expense of performance decrease.
+         Default in Lucene is "true". Default in Solr is "false" (since 3.6) --&gt;
+    &lt;!-- &lt;useCompoundFile&gt;false&lt;/useCompoundFile&gt; --&gt;
+
+    &lt;!-- ramBufferSizeMB sets the amount of RAM that may be used by Lucene
+         indexing for buffering added documents and deletions before they are
+         flushed to the Directory.
+         maxBufferedDocs sets a limit on the number of documents buffered
+         before flushing.
+         If both ramBufferSizeMB and maxBufferedDocs is set, then
+         Lucene will flush based on whichever limit is hit first.
+         The default is 100 MB.  --&gt;
+    &lt;!-- &lt;ramBufferSizeMB&gt;100&lt;/ramBufferSizeMB&gt; --&gt;
+    &lt;!-- &lt;maxBufferedDocs&gt;1000&lt;/maxBufferedDocs&gt; --&gt;
+
+    &lt;!-- Expert: Merge Policy
+         The Merge Policy in Lucene controls how merging of segments is done.
+         The default since Solr/Lucene 3.3 is TieredMergePolicy.
+         The default since Lucene 2.3 was the LogByteSizeMergePolicy,
+         Even older versions of Lucene used LogDocMergePolicy.
+      --&gt;
+    &lt;!--
+        &lt;mergePolicy class="org.apache.lucene.index.TieredMergePolicy"&gt;
+          &lt;int name="maxMergeAtOnce"&gt;10&lt;/int&gt;
+          &lt;int name="segmentsPerTier"&gt;10&lt;/int&gt;
+        &lt;/mergePolicy&gt;
+      --&gt;
+
+    &lt;!-- Merge Factor
+         The merge factor controls how many segments will get merged at a time.
+         For TieredMergePolicy, mergeFactor is a convenience parameter which
+         will set both MaxMergeAtOnce and SegmentsPerTier at once.
+         For LogByteSizeMergePolicy, mergeFactor decides how many new segments
+         will be allowed before they are merged into one.
+         Default is 10 for both merge policies.
+      --&gt;
+    &lt;!--
+    &lt;mergeFactor&gt;10&lt;/mergeFactor&gt;
+      --&gt;
+    &lt;!-- LogSearch customization. Increased to 25 to maximize indexing speed --&gt;
+    &lt;mergeFactor&gt;25&lt;/mergeFactor&gt;
+
+    &lt;!-- Expert: Merge Scheduler
+         The Merge Scheduler in Lucene controls how merges are
+         performed.  The ConcurrentMergeScheduler (Lucene 2.3 default)
+         can perform merges in the background using separate threads.
+         The SerialMergeScheduler (Lucene 2.2 default) does not.
+     --&gt;
+    &lt;!--
+       &lt;mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/&gt;
+       --&gt;
+
+    &lt;!-- LockFactory
+
+         This option specifies which Lucene LockFactory implementation
+         to use.
+
+         single = SingleInstanceLockFactory - suggested for a
+                  read-only index or when there is no possibility of
+                  another process trying to modify the index.
+         native = NativeFSLockFactory - uses OS native file locking.
+                  Do not use when multiple solr webapps in the same
+                  JVM are attempting to share a single index.
+         simple = SimpleFSLockFactory  - uses a plain file for locking
+
+         Defaults: 'native' is default for Solr3.6 and later, otherwise
+                   'simple' is the default
+
+         More details on the nuances of each LockFactory...
+         http://wiki.apache.org/lucene-java/AvailableLockFactories
+    --&gt;
+    &lt;lockType&gt;${solr.lock.type:native}&lt;/lockType&gt;
+
+    &lt;!-- Unlock On Startup
+
+         If true, unlock any held write or commit locks on startup.
+         This defeats the locking mechanism that allows multiple
+         processes to safely access a lucene index, and should be used
+         with care. Default is "false".
+
+         This is not needed if lock type is 'single'
+     --&gt;
+    &lt;!--
+    &lt;unlockOnStartup&gt;false&lt;/unlockOnStartup&gt;
+      --&gt;
+
+    &lt;!-- Commit Deletion Policy
+         Custom deletion policies can be specified here. The class must
+         implement org.apache.lucene.index.IndexDeletionPolicy.
+
+         The default Solr IndexDeletionPolicy implementation supports
+         deleting index commit points on number of commits, age of
+         commit point and optimized status.
+
+         The latest commit point should always be preserved regardless
+         of the criteria.
+    --&gt;
+    &lt;!--
+    &lt;deletionPolicy class="solr.SolrDeletionPolicy"&gt;
+    --&gt;
+      &lt;!-- The number of commit points to be kept --&gt;
+      &lt;!-- &lt;str name="maxCommitsToKeep"&gt;1&lt;/str&gt; --&gt;
+      &lt;!-- The number of optimized commit points to be kept --&gt;
+      &lt;!-- &lt;str name="maxOptimizedCommitsToKeep"&gt;0&lt;/str&gt; --&gt;
+      &lt;!--
+          Delete all commit points once they have reached the given age.
+          Supports DateMathParser syntax e.g.
+        --&gt;
+      &lt;!--
+         &lt;str name="maxCommitAge"&gt;30MINUTES&lt;/str&gt;
+         &lt;str name="maxCommitAge"&gt;1DAY&lt;/str&gt;
+      --&gt;
+    &lt;!--
+    &lt;/deletionPolicy&gt;
+    --&gt;
+
+    &lt;!-- Lucene Infostream
+
+         To aid in advanced debugging, Lucene provides an "InfoStream"
+         of detailed information when indexing.
+
+         Setting the value to true will instruct the underlying Lucene
+         IndexWriter to write its info stream to solr's log. By default,
+         this is enabled here, and controlled through log4j.properties.
+      --&gt;
+     &lt;infoStream&gt;true&lt;/infoStream&gt;
+  &lt;/indexConfig&gt;
+
+
+  &lt;!-- JMX
+
+       This example enables JMX if and only if an existing MBeanServer
+       is found, use this if you want to configure JMX through JVM
+       parameters. Remove this to disable exposing Solr configuration
+       and statistics to JMX.
+
+       For more details see http://wiki.apache.org/solr/SolrJmx
+    --&gt;
+  &lt;jmx /&gt;
+  &lt;!-- If you want to connect to a particular server, specify the
+       agentId
+    --&gt;
+  &lt;!-- &lt;jmx agentId="myAgent" /&gt; --&gt;
+  &lt;!-- If you want to start a new MBeanServer, specify the serviceUrl --&gt;
+  &lt;!-- &lt;jmx serviceUrl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr"/&gt;
+    --&gt;
+
+  &lt;!-- The default high-performance update handler --&gt;
+  &lt;updateHandler class="solr.DirectUpdateHandler2"&gt;
+
+    &lt;!-- Enables a transaction log, used for real-time get, durability, and
+         and solr cloud replica recovery.  The log can grow as big as
+         uncommitted changes to the index, so use of a hard autoCommit
+         is recommended (see below).
+         "dir" - the target directory for transaction logs, defaults to the
+                solr data directory.  --&gt;
+    &lt;updateLog&gt;
+      &lt;str name="dir"&gt;${solr.ulog.dir:}&lt;/str&gt;
+    &lt;/updateLog&gt;
+
+    &lt;!-- AutoCommit
+
+         Perform a hard commit automatically under certain conditions.
+         Instead of enabling autoCommit, consider using "commitWithin"
+         when adding documents.
+
+         http://wiki.apache.org/solr/UpdateXmlMessages
+
+         maxDocs - Maximum number of documents to add since the last
+                   commit before automatically triggering a new commit.
+
+         maxTime - Maximum amount of time in ms that is allowed to pass
+                   since a document was added before automatically
+                   triggering a new commit.
+         openSearcher - if false, the commit causes recent index changes
+           to be flushed to stable storage, but does not cause a new
+           searcher to be opened to make those changes visible.
+
+         If the updateLog is enabled, then it's highly recommended to
+         have some sort of hard autoCommit to limit the log size.
+      --&gt;
+     &lt;autoCommit&gt;
+       &lt;maxTime&gt;${solr.autoCommit.maxTime:15000}&lt;/maxTime&gt;
+       &lt;openSearcher&gt;false&lt;/openSearcher&gt;
+     &lt;/autoCommit&gt;
+
+    &lt;!-- softAutoCommit is like autoCommit except it causes a
+         'soft' commit which only ensures that changes are visible
+         but does not ensure that data is synced to disk.  This is
+         faster and more near-realtime friendly than a hard commit.
+      --&gt;
+
+     &lt;autoSoftCommit&gt;
+       &lt;maxTime&gt;${solr.autoSoftCommit.maxTime:5000}&lt;/maxTime&gt;
+     &lt;/autoSoftCommit&gt;
+
+    &lt;!-- Update Related Event Listeners
+
+         Various IndexWriter related events can trigger Listeners to
+         take actions.
+
+         postCommit - fired after every commit or optimize command
+         postOptimize - fired after every optimize command
+      --&gt;
+    &lt;!-- The RunExecutableListener executes an external command from a
+         hook such as postCommit or postOptimize.
+
+         exe - the name of the executable to run
+         dir - dir to use as the current working directory. (default=".")
+         wait - the calling thread waits until the executable returns.
+                (default="true")
+         args - the arguments to pass to the program.  (default is none)
+         env - environment variables to set.  (default is none)
+      --&gt;
+    &lt;!-- This example shows how RunExecutableListener could be used
+         with the script based replication...
+         http://wiki.apache.org/solr/CollectionDistribution
+      --&gt;
+    &lt;!--
+       &lt;listener event="postCommit" class="solr.RunExecutableListener"&gt;
+         &lt;str name="exe"&gt;solr/bin/snapshooter&lt;/str&gt;
+         &lt;str name="dir"&gt;.&lt;/str&gt;
+         &lt;bool name="wait"&gt;true&lt;/bool&gt;
+         &lt;arr name="args"&gt; &lt;str&gt;arg1&lt;/str&gt; &lt;str&gt;arg2&lt;/str&gt; &lt;/arr&gt;
+         &lt;arr name="env"&gt; &lt;str&gt;MYVAR=val1&lt;/str&gt; &lt;/arr&gt;
+       &lt;/listener&gt;
+      --&gt;
+
+  &lt;/updateHandler&gt;
+
+  &lt;!-- IndexReaderFactory
+
+       Use the following format to specify a custom IndexReaderFactory,
+       which allows for alternate IndexReader implementations.
+
+       ** Experimental Feature **
+
+       Please note - Using a custom IndexReaderFactory may prevent
+       certain other features from working. The API to
+       IndexReaderFactory may change without warning or may even be
+       removed from future releases if the problems cannot be
+       resolved.
+
+
+       ** Features that may not work with custom IndexReaderFactory **
+
+       The ReplicationHandler assumes a disk-resident index. Using a
+       custom IndexReader implementation may cause incompatibility
+       with ReplicationHandler and may cause replication to not work
+       correctly. See SOLR-1366 for details.
+
+    --&gt;
+  &lt;!--
+  &lt;indexReaderFactory name="IndexReaderFactory" class="package.class"&gt;
+    &lt;str name="someArg"&gt;Some Value&lt;/str&gt;
+  &lt;/indexReaderFactory &gt;
+  --&gt;
+
+  &lt;!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+       Query section - these settings control query time things like caches
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --&gt;
+  &lt;query&gt;
+    &lt;!-- Max Boolean Clauses
+
+         Maximum number of clauses in each BooleanQuery,  an exception
+         is thrown if exceeded.
+
+         ** WARNING **
+
+         This option actually modifies a global Lucene property that
+         will affect all SolrCores.  If multiple solrconfig.xml files
+         disagree on this property, the value at any given moment will
+         be based on the last SolrCore to be initialized.
+
+      --&gt;
+    &lt;maxBooleanClauses&gt;1024&lt;/maxBooleanClauses&gt;
+
+
+    &lt;!-- Solr Internal Query Caches
+
+         There are two implementations of cache available for Solr,
+         LRUCache, based on a synchronized LinkedHashMap, and
+         FastLRUCache, based on a ConcurrentHashMap.
+
+         FastLRUCache has faster gets and slower puts in single
+         threaded operation and thus is generally faster than LRUCache
+         when the hit ratio of the cache is high (&gt; 75%), and may be
+         faster under other scenarios on multi-cpu systems.
+    --&gt;
+
+    &lt;!-- Filter Cache
+
+         Cache used by SolrIndexSearcher for filters (DocSets),
+         unordered sets of *all* documents that match a query.  When a
+         new searcher is opened, its caches may be prepopulated or
+         "autowarmed" using data from caches in the old searcher.
+         autowarmCount is the number of items to prepopulate.  For
+         LRUCache, the autowarmed items will be the most recently
+         accessed items.
+
+         Parameters:
+           class - the SolrCache implementation LRUCache or
+               (LRUCache or FastLRUCache)
+           size - the maximum number of entries in the cache
+           initialSize - the initial capacity (number of entries) of
+               the cache.  (see java.util.HashMap)
+           autowarmCount - the number of entries to prepopulate from
+               and old cache.
+      --&gt;
+    &lt;filterCache class="solr.FastLRUCache"
+                 size="512"
+                 initialSize="512"
+                 autowarmCount="0"/&gt;
+
+    &lt;!-- Query Result Cache
+
+         Caches results of searches - ordered lists of document ids
+         (DocList) based on a query, a sort, and the range of documents requested.
+      --&gt;
+    &lt;queryResultCache class="solr.LRUCache"
+                     size="512"
+                     initialSize="512"
+                     autowarmCount="0"/&gt;
+
+    &lt;!-- Document Cache
+
+         Caches Lucene Document objects (the stored fields for each
+         document).  Since Lucene internal document ids are transient,
+         this cache will not be autowarmed.
+      --&gt;
+    &lt;documentCache class="solr.LRUCache"
+                   size="512"
+                   initialSize="512"
+                   autowarmCount="0"/&gt;
+
+    &lt;!-- custom cache currently used by block join --&gt;
+    &lt;cache name="perSegFilter"
+      class="solr.search.LRUCache"
+      size="10"
+      initialSize="0"
+      autowarmCount="10"
+      regenerator="solr.NoOpRegenerator" /&gt;
+
+    &lt;!-- Field Value Cache
+
+         Cache used to hold field values that are quickly accessible
+         by document id.  The fieldValueCache is created by default
+         even if not configured here.
+      --&gt;
+    &lt;!--
+       &lt;fieldValueCache class="solr.FastLRUCache"
+                        size="512"
+                        autowarmCount="128"
+                        showItems="32" /&gt;
+      --&gt;
+
+    &lt;!-- Custom Cache
+
+         Example of a generic cache.  These caches may be accessed by
+         name through SolrIndexSearcher.getCache(),cacheLookup(), and
+         cacheInsert().  The purpose is to enable easy caching of
+         user/application level data.  The regenerator argument should
+         be specified as an implementation of solr.CacheRegenerator
+         if autowarming is desired.
+      --&gt;
+    &lt;!--
+       &lt;cache name="myUserCache"
+              class="solr.LRUCache"
+              size="4096"
+              initialSize="1024"
+              autowarmCount="1024"
+              regenerator="com.mycompany.MyRegenerator"
+              /&gt;
+      --&gt;
+
+
+    &lt;!-- Lazy Field Loading
+
+         If true, stored fields that are not requested will be loaded
+         lazily.  This can result in a significant speed improvement
+         if the usual case is to not load all stored fields,
+         especially if the skipped fields are large compressed text
+         fields.
+    --&gt;
+    &lt;enableLazyFieldLoading&gt;true&lt;/enableLazyFieldLoading&gt;
+
+   &lt;!-- Use Filter For Sorted Query
+
+        A possible optimization that attempts to use a filter to
+        satisfy a search.  If the requested sort does not include
+        score, then the filterCache will be checked for a filter
+        matching the query. If found, the filter will be used as the
+        source of document ids, and then the sort will be applied to
+        that.
+
+        For most situations, this will not be useful unless you
+        frequently get the same search repeatedly with different sort
+        options, and none of them ever use "score"
+     --&gt;
+   &lt;!--
+      &lt;useFilterForSortedQuery&gt;true&lt;/useFilterForSortedQuery&gt;
+     --&gt;
+
+   &lt;!-- Result Window Size
+
+        An optimization for use with the queryResultCache.  When a search
+        is requested, a superset of the requested number of document ids
+        are collected.  For example, if a search for a particular query
+        requests matching documents 10 through 19, and queryWindowSize is 50,
+        then documents 0 through 49 will be collected and cached.  Any further
+        requests in that range can be satisfied via the cache.
+     --&gt;
+   &lt;queryResultWindowSize&gt;20&lt;/queryResultWindowSize&gt;
+
+   &lt;!-- Maximum number of documents to cache for any entry in the
+        queryResultCache.
+     --&gt;
+   &lt;queryResultMaxDocsCached&gt;200&lt;/queryResultMaxDocsCached&gt;
+
+   &lt;!-- Query Related Event Listeners
+
+        Various IndexSearcher related events can trigger Listeners to
+        take actions.
+
+        newSearcher - fired whenever a new searcher is being prepared
+        and there is a current searcher handling requests (aka
+        registered).  It can be used to prime certain caches to
+        prevent long request times for certain requests.
+
+        firstSearcher - fired whenever a new searcher is being
+        prepared but there is no current registered searcher to handle
+        requests or to gain autowarming data from.
+
+
+     --&gt;
+    &lt;!-- QuerySenderListener takes an array of NamedList and executes a
+         local query request for each NamedList in sequence.
+      --&gt;
+    &lt;listener event="newSearcher" class="solr.QuerySenderListener"&gt;
+      &lt;arr name="queries"&gt;
+        &lt;!--
+           &lt;lst&gt;&lt;str name="q"&gt;solr&lt;/str&gt;&lt;str name="sort"&gt;price asc&lt;/str&gt;&lt;/lst&gt;
+           &lt;lst&gt;&lt;str name="q"&gt;rocks&lt;/str&gt;&lt;str name="sort"&gt;weight asc&lt;/str&gt;&lt;/lst&gt;
+          --&gt;
+      &lt;/arr&gt;
+    &lt;/listener&gt;
+    &lt;listener event="firstSearcher" class="solr.QuerySenderListener"&gt;
+      &lt;arr name="queries"&gt;
+        &lt;lst&gt;
+          &lt;str name="q"&gt;static firstSearcher warming in solrconfig.xml&lt;/str&gt;
+        &lt;/lst&gt;
+      &lt;/arr&gt;
+    &lt;/listener&gt;
+
+    &lt;!-- Use Cold Searcher
+
+         If a search request comes in and there is no current
+         registered searcher, then immediately register the still
+         warming searcher and use it.  If "false" then all requests
+         will block until the first searcher is done warming.
+      --&gt;
+    &lt;useColdSearcher&gt;false&lt;/useColdSearcher&gt;
+
+    &lt;!-- Max Warming Searchers
+
+         Maximum number of searchers that may be warming in the
+         background concurrently.  An error is returned if this limit
+         is exceeded.
+
+         Recommend values of 1-2 for read-only slaves, higher for
+         masters w/o cache warming.
+      --&gt;
+    &lt;maxWarmingSearchers&gt;2&lt;/maxWarmingSearchers&gt;
+
+  &lt;/query&gt;
+
+
+  &lt;!-- Request Dispatcher
+
+       This section contains instructions for how the SolrDispatchFilter
+       should behave when processing requests for this SolrCore.
+
+       handleSelect is a legacy option that affects the behavior of requests
+       such as /select?qt=XXX
+
+       handleSelect="true" will cause the SolrDispatchFilter to process
+       the request and dispatch the query to a handler specified by the
+       "qt" param, assuming "/select" isn't already registered.
+
+       handleSelect="false" will cause the SolrDispatchFilter to
+       ignore "/select" requests, resulting in a 404 unless a handler
+       is explicitly registered with the name "/select"
+
+       handleSelect="true" is not recommended for new users, but is the default
+       for backwards compatibility
+    --&gt;
+  &lt;requestDispatcher handleSelect="false" &gt;
+    &lt;!-- Request Parsing
+
+         These settings indicate how Solr Requests may be parsed, and
+         what restrictions may be placed on the ContentStreams from
+         those requests
+
+         enableRemoteStreaming - enables use of the stream.file
+         and stream.url parameters for specifying remote streams.
+
+         multipartUploadLimitInKB - specifies the max size (in KiB) of
+         Multipart File Uploads that Solr will allow in a Request.
+
+         formdataUploadLimitInKB - specifies the max size (in KiB) of
+         form data (application/x-www-form-urlencoded) sent via
+         POST. You can use POST to pass request parameters not
+         fitting into the URL.
+
+         addHttpRequestToContext - if set to true, it will instruct
+         the requestParsers to include the original HttpServletRequest
+         object in the context map of the SolrQueryRequest under the
+         key "httpRequest". It will not be used by any of the existing
+         Solr components, but may be useful when developing custom
+         plugins.
+
+         *** WARNING ***
+         The settings below authorize Solr to fetch remote files, You
+         should make sure your system has some authentication before
+         using enableRemoteStreaming="true"
+
+      --&gt;
+    &lt;requestParsers enableRemoteStreaming="true"
+                    multipartUploadLimitInKB="2048000"
+                    formdataUploadLimitInKB="2048"
+                    addHttpRequestToContext="false"/&gt;
+
+    &lt;!-- HTTP Caching
+
+         Set HTTP caching related parameters (for proxy caches and clients).
+
+         The options below instruct Solr not to output any HTTP Caching
+         related headers
+      --&gt;
+    &lt;httpCaching never304="true" /&gt;
+    &lt;!-- If you include a &lt;cacheControl&gt; directive, it will be used to
+         generate a Cache-Control header (as well as an Expires header
+         if the value contains "max-age=")
+
+         By default, no Cache-Control header is generated.
+
+         You can use the &lt;cacheControl&gt; option even if you have set
+         never304="true"
+      --&gt;
+    &lt;!--
+       &lt;httpCaching never304="true" &gt;
+         &lt;cacheControl&gt;max-age=30, public&lt;/cacheControl&gt;
+       &lt;/httpCaching&gt;
+      --&gt;
+    &lt;!-- To enable Solr to respond with automatically generated HTTP
+         Caching headers, and to response to Cache Validation requests
+         correctly, set the value of never304="false"
+
+         This will cause Solr to generate Last-Modified and ETag
+         headers based on the properties of the Index.
+
+         The following options can also be specified to affect the
+         values of these headers...
+
+         lastModFrom - the default value is "openTime" which means the
+         Last-Modified value (and validation against If-Modified-Since
+         requests) will all be relative to when the current Searcher
+         was opened.  You can change it to lastModFrom="dirLastMod" if
+         you want the value to exactly correspond to when the physical
+         index was last modified.
+
+         etagSeed="..." is an option you can change to force the ETag
+         header (and validation against If-None-Match requests) to be
+         different even if the index has not changed (ie: when making
+         significant changes to your config file)
+
+         (lastModifiedFrom and etagSeed are both ignored if you use
+         the never304="true" option)
+      --&gt;
+    &lt;!--
+       &lt;httpCaching lastModifiedFrom="openTime"
+                    etagSeed="Solr"&gt;
+         &lt;cacheControl&gt;max-age=30, public&lt;/cacheControl&gt;
+       &lt;/httpCaching&gt;
+      --&gt;
+  &lt;/requestDispatcher&gt;
+
+  &lt;!-- Request Handlers
+
+       http://wiki.apache.org/solr/SolrRequestHandler
+
+       Incoming queries will be dispatched to a specific handler by name
+       based on the path specified in the request.
+
+       Legacy behavior: If the request path uses "/select" but no Request
+       Handler has that name, and if handleSelect="true" has been specified in
+       the requestDispatcher, then the Request Handler is dispatched based on
+       the qt parameter.  Handlers without a leading '/' are accessed this way
+       like so: http://host/app/[core/]select?qt=name  If no qt is
+       given, then the requestHandler that declares default="true" will be
+       used or the one named "standard".
+
+       If a Request Handler is declared with startup="lazy", then it will
+       not be initialized until the first request that uses it.
+
+    --&gt;
+
+  &lt;requestHandler name="/dataimport" class="solr.DataImportHandler"&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="config"&gt;solr-data-config.xml&lt;/str&gt;
+    &lt;/lst&gt;
+  &lt;/requestHandler&gt;
+
+  &lt;!-- SearchHandler
+
+       http://wiki.apache.org/solr/SearchHandler
+
+       For processing Search Queries, the primary Request Handler
+       provided with Solr is "SearchHandler" It delegates to a sequent
+       of SearchComponents (see below) and supports distributed
+       queries across multiple shards
+    --&gt;
+  &lt;requestHandler name="/select" class="solr.SearchHandler"&gt;
+    &lt;!-- default values for query parameters can be specified, these
+         will be overridden by parameters in the request
+      --&gt;
+     &lt;lst name="defaults"&gt;
+       &lt;str name="echoParams"&gt;explicit&lt;/str&gt;
+       &lt;int name="rows"&gt;10&lt;/int&gt;
+       &lt;str name="df"&gt;text&lt;/str&gt;
+     &lt;/lst&gt;
+    &lt;!-- In addition to defaults, "appends" params can be specified
+         to identify values which should be appended to the list of
+         multi-val params from the query (or the existing "defaults").
+      --&gt;
+    &lt;!-- In this example, the param "fq=instock:true" would be appended to
+         any query time fq params the user may specify, as a mechanism for
+         partitioning the index, independent of any user selected filtering
+         that may also be desired (perhaps as a result of faceted searching).
+
+         NOTE: there is *absolutely* nothing a client can do to prevent these
+         "appends" values from being used, so don't use this mechanism
+         unless you are sure you always want it.
+      --&gt;
+    &lt;!--
+       &lt;lst name="appends"&gt;
+         &lt;str name="fq"&gt;inStock:true&lt;/str&gt;
+       &lt;/lst&gt;
+      --&gt;
+    &lt;!-- "invariants" are a way of letting the Solr maintainer lock down
+         the options available to Solr clients.  Any params values
+         specified here are used regardless of what values may be specified
+         in either the query, the "defaults", or the "appends" params.
+
+         In this example, the facet.field and facet.query params would
+         be fixed, limiting the facets clients can use.  Faceting is
+         not turned on by default - but if the client does specify
+         facet=true in the request, these are the only facets they
+         will be able to see counts for; regardless of what other
+         facet.field or facet.query params they may specify.
+
+         NOTE: there is *absolutely* nothing a client can do to prevent these
+         "invariants" values from being used, so don't use this mechanism
+         unless you are sure you always want it.
+      --&gt;
+    &lt;!--
+       &lt;lst name="invariants"&gt;
+         &lt;str name="facet.field"&gt;cat&lt;/str&gt;
+         &lt;str name="facet.field"&gt;manu_exact&lt;/str&gt;
+         &lt;str name="facet.query"&gt;price:[* TO 500]&lt;/str&gt;
+         &lt;str name="facet.query"&gt;price:[500 TO *]&lt;/str&gt;
+       &lt;/lst&gt;
+      --&gt;
+    &lt;!-- If the default list of SearchComponents is not desired, that
+         list can either be overridden completely, or components can be
+         prepended or appended to the default list.  (see below)
+      --&gt;
+    &lt;!--
+       &lt;arr name="components"&gt;
+         &lt;str&gt;nameOfCustomComponent1&lt;/str&gt;
+         &lt;str&gt;nameOfCustomComponent2&lt;/str&gt;
+       &lt;/arr&gt;
+      --&gt;
+    &lt;/requestHandler&gt;
+
+  &lt;!-- A request handler that returns indented JSON by default --&gt;
+  &lt;requestHandler name="/query" class="solr.SearchHandler"&gt;
+     &lt;lst name="defaults"&gt;
+       &lt;str name="echoParams"&gt;explicit&lt;/str&gt;
+       &lt;str name="wt"&gt;json&lt;/str&gt;
+       &lt;str name="indent"&gt;true&lt;/str&gt;
+       &lt;str name="df"&gt;text&lt;/str&gt;
+     &lt;/lst&gt;
+  &lt;/requestHandler&gt;
+
+
+  &lt;!-- realtime get handler, guaranteed to return the latest stored fields of
+       any document, without the need to commit or open a new searcher.  The
+       current implementation relies on the updateLog feature being enabled.
+
+       ** WARNING **
+       Do NOT disable the realtime get handler at /get if you are using
+       SolrCloud otherwise any leader election will cause a full sync in ALL
+       replicas for the shard in question. Similarly, a replica recovery will
+       also always fetch the complete index from the leader because a partial
+       sync will not be possible in the absence of this handler.
+  --&gt;
+  &lt;requestHandler name="/get" class="solr.RealTimeGetHandler"&gt;
+     &lt;lst name="defaults"&gt;
+       &lt;str name="omitHeader"&gt;true&lt;/str&gt;
+       &lt;str name="wt"&gt;json&lt;/str&gt;
+       &lt;str name="indent"&gt;true&lt;/str&gt;
+     &lt;/lst&gt;
+  &lt;/requestHandler&gt;
+
+
+  &lt;!-- A Robust Example
+
+       This example SearchHandler declaration shows off usage of the
+       SearchHandler with many defaults declared
+
+       Note that multiple instances of the same Request Handler
+       (SearchHandler) can be registered multiple times with different
+       names (and different init parameters)
+    --&gt;
+  &lt;requestHandler name="/browse" class="solr.SearchHandler"&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="echoParams"&gt;explicit&lt;/str&gt;
+
+      &lt;!-- VelocityResponseWriter settings --&gt;
+      &lt;str name="wt"&gt;velocity&lt;/str&gt;
+      &lt;str name="v.template"&gt;browse&lt;/str&gt;
+      &lt;str name="v.layout"&gt;layout&lt;/str&gt;
+
+      &lt;!-- Query settings --&gt;
+      &lt;str name="defType"&gt;edismax&lt;/str&gt;
+      &lt;str name="q.alt"&gt;*:*&lt;/str&gt;
+      &lt;str name="rows"&gt;10&lt;/str&gt;
+      &lt;str name="fl"&gt;*,score&lt;/str&gt;
+
+      &lt;!-- Faceting defaults --&gt;
+      &lt;str name="facet"&gt;on&lt;/str&gt;
+      &lt;str name="facet.mincount"&gt;1&lt;/str&gt;
+    &lt;/lst&gt;
+  &lt;/requestHandler&gt;
+
+
+  &lt;initParams path="/update/**,/query,/select,/tvrh,/elevate,/spell,/browse"&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="df"&gt;text&lt;/str&gt;
+      &lt;str name="update.chain"&gt;add-unknown-fields-to-the-schema&lt;/str&gt;
+    &lt;/lst&gt;
+  &lt;/initParams&gt;
+
+  &lt;!-- Update Request Handler.
+
+       http://wiki.apache.org/solr/UpdateXmlMessages
+
+       The canonical Request Handler for Modifying the Index through
+       commands specified using XML, JSON, CSV, or JAVABIN
+
+       Note: Since solr1.1 requestHandlers requires a valid content
+       type header if posted in the body. For example, curl now
+       requires: -H 'Content-type:text/xml; charset=utf-8'
+
+       To override the request content type and force a specific
+       Content-type, use the request parameter:
+         ?update.contentType=text/csv
+
+       This handler will pick a response format to match the input
+       if the 'wt' parameter is not explicit
+    --&gt;
+  &lt;requestHandler name="/update" class="solr.UpdateRequestHandler"&gt;
+    &lt;!-- See below for information on defining
+         updateRequestProcessorChains that can be used by name
+         on each Update Request
+      --&gt;
+    &lt;!--
+       &lt;lst name="defaults"&gt;
+         &lt;str name="update.chain"&gt;dedupe&lt;/str&gt;
+       &lt;/lst&gt;
+       --&gt;
+  &lt;/requestHandler&gt;
+
+  &lt;!-- Solr Cell Update Request Handler
+
+       http://wiki.apache.org/solr/ExtractingRequestHandler
+
+    --&gt;
+  &lt;requestHandler name="/update/extract"
+                  startup="lazy"
+                  class="solr.extraction.ExtractingRequestHandler" &gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="lowernames"&gt;true&lt;/str&gt;
+      &lt;str name="uprefix"&gt;ignored_&lt;/str&gt;
+
+      &lt;!-- capture link hrefs but ignore div attributes --&gt;
+      &lt;str name="captureAttr"&gt;true&lt;/str&gt;
+      &lt;str name="fmap.a"&gt;links&lt;/str&gt;
+      &lt;str name="fmap.div"&gt;ignored_&lt;/str&gt;
+    &lt;/lst&gt;
+  &lt;/requestHandler&gt;
+
+
+  &lt;!-- Field Analysis Request Handler
+
+       RequestHandler that provides much the same functionality as
+       analysis.jsp. Provides the ability to specify multiple field
+       types and field names in the same request and outputs
+       index-time and query-time analysis for each of them.
+
+       Request parameters are:
+       analysis.fieldname - field name whose analyzers are to be used
+
+       analysis.fieldtype - field type whose analyzers are to be used
+       analysis.fieldvalue - text for index-time analysis
+       q (or analysis.q) - text for query time analysis
+       analysis.showmatch (true|false) - When set to true and when
+           query analysis is performed, the produced tokens of the
+           field value analysis will be marked as "matched" for every
+           token that is produces by the query analysis
+   --&gt;
+  &lt;requestHandler name="/analysis/field"
+                  startup="lazy"
+                  class="solr.FieldAnalysisRequestHandler" /&gt;
+
+
+  &lt;!-- Document Analysis Handler
+
+       http://wiki.apache.org/solr/AnalysisRequestHandler
+
+       An analysis handler that provides a breakdown of the analysis
+       process of provided documents. This handler expects a (single)
+       content stream with the following format:
+
+       &lt;docs&gt;
+         &lt;doc&gt;
+           &lt;field name="id"&gt;1&lt;/field&gt;
+           &lt;field name="name"&gt;The Name&lt;/field&gt;
+           &lt;field name="text"&gt;The Text Value&lt;/field&gt;
+         &lt;/doc&gt;
+         &lt;doc&gt;...&lt;/doc&gt;
+         &lt;doc&gt;...&lt;/doc&gt;
+         ...
+       &lt;/docs&gt;
+
+    Note: Each document must contain a field which serves as the
+    unique key. This key is used in the returned response to associate
+    an analysis breakdown to the analyzed document.
+
+    Like the FieldAnalysisRequestHandler, this handler also supports
+    query analysis by sending either an "analysis.query" or "q"
+    request parameter that holds the query text to be analyzed. It
+    also supports the "analysis.showmatch" parameter which when set to
+    true, all field tokens that match the query tokens will be marked
+    as a "match".
+  --&gt;
+  &lt;requestHandler name="/analysis/document"
+                  class="solr.DocumentAnalysisRequestHandler"
+                  startup="lazy" /&gt;
+
+  &lt;!-- Admin Handlers
+
+       Admin Handlers - This will register all the standard admin
+       RequestHandlers.
+    --&gt;
+  &lt;requestHandler name="/admin/"
+                  class="solr.admin.AdminHandlers" /&gt;
+  &lt;!-- This single handler is equivalent to the following... --&gt;
+  &lt;!--
+     &lt;requestHandler name="/admin/luke"       class="solr.admin.LukeRequestHandler" /&gt;
+     &lt;requestHandler name="/admin/system"     class="solr.admin.SystemInfoHandler" /&gt;
+     &lt;requestHandler name="/admin/plugins"    class="solr.admin.PluginInfoHandler" /&gt;
+     &lt;requestHandler name="/admin/threads"    class="solr.admin.ThreadDumpHandler" /&gt;
+     &lt;requestHandler name="/admin/properties" class="solr.admin.PropertiesRequestHandler" /&gt;
+     &lt;requestHandler name="/admin/file"       class="solr.admin.ShowFileRequestHandler" &gt;
+    --&gt;
+  &lt;!-- If you wish to hide files under ${solr.home}/conf, explicitly
+       register the ShowFileRequestHandler using the definition below.
+       NOTE: The glob pattern ('*') is the only pattern supported at present, *.xml will
+             not exclude all files ending in '.xml'. Use it to exclude _all_ updates
+    --&gt;
+  &lt;!--
+     &lt;requestHandler name="/admin/file"
+                     class="solr.admin.ShowFileRequestHandler" &gt;
+       &lt;lst name="invariants"&gt;
+         &lt;str name="hidden"&gt;synonyms.txt&lt;/str&gt;
+         &lt;str name="hidden"&gt;anotherfile.txt&lt;/str&gt;
+         &lt;str name="hidden"&gt;*&lt;/str&gt;
+       &lt;/lst&gt;
+     &lt;/requestHandler&gt;
+    --&gt;
+
+  &lt;!--
+    Enabling this request handler (which is NOT a default part of the admin handler) will allow the Solr UI to edit
+    all the config files. This is intended for secure/development use ONLY! Leaving available and publically
+    accessible is a security vulnerability and should be done with extreme caution!
+  --&gt;
+  &lt;!--
+  &lt;requestHandler name="/admin/fileedit" class="solr.admin.EditFileRequestHandler" &gt;
+    &lt;lst name="invariants"&gt;
+         &lt;str name="hidden"&gt;synonyms.txt&lt;/str&gt;
+         &lt;str name="hidden"&gt;anotherfile.txt&lt;/str&gt;
+    &lt;/lst&gt;
+  &lt;/requestHandler&gt;
+  --&gt;
+  &lt;!-- ping/healthcheck --&gt;
+  &lt;requestHandler name="/admin/ping" class="solr.PingRequestHandler"&gt;
+    &lt;lst name="invariants"&gt;
+      &lt;str name="q"&gt;solrpingquery&lt;/str&gt;
+    &lt;/lst&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="echoParams"&gt;all&lt;/str&gt;
+    &lt;/lst&gt;
+    &lt;!-- An optional feature of the PingRequestHandler is to configure the
+         handler with a "healthcheckFile" which can be used to enable/disable
+         the PingRequestHandler.
+         relative paths are resolved against the data dir
+      --&gt;
+    &lt;!-- &lt;str name="healthcheckFile"&gt;server-enabled.txt&lt;/str&gt; --&gt;
+  &lt;/requestHandler&gt;
+
+  &lt;!-- Echo the request contents back to the client --&gt;
+  &lt;requestHandler name="/debug/dump" class="solr.DumpRequestHandler" &gt;
+    &lt;lst name="defaults"&gt;
+     &lt;str name="echoParams"&gt;explicit&lt;/str&gt;
+     &lt;str name="echoHandler"&gt;true&lt;/str&gt;
+    &lt;/lst&gt;
+  &lt;/requestHandler&gt;
+
+  &lt;!-- Solr Replication
+
+       The SolrReplicationHandler supports replicating indexes from a
+       "master" used for indexing and "slaves" used for queries.
+
+       http://wiki.apache.org/solr/SolrReplication
+
+       It is also necessary for SolrCloud to function (in Cloud mode, the
+       replication handler is used to bulk transfer segments when nodes
+       are added or need to recover).
+
+       https://wiki.apache.org/solr/SolrCloud/
+    --&gt;
+  &lt;requestHandler name="/replication" class="solr.ReplicationHandler" &gt;
+    &lt;!--
+       To enable simple master/slave replication, uncomment one of the
+       sections below, depending on whether this solr instance should be
+       the "master" or a "slave".  If this instance is a "slave" you will
+       also need to fill in the masterUrl to point to a real machine.
+    --&gt;
+    &lt;!--
+       &lt;lst name="master"&gt;
+         &lt;str name="replicateAfter"&gt;commit&lt;/str&gt;
+         &lt;str name="replicateAfter"&gt;startup&lt;/str&gt;
+         &lt;str name="confFiles"&gt;schema.xml,stopwords.txt&lt;/str&gt;
+       &lt;/lst&gt;
+    --&gt;
+    &lt;!--
+       &lt;lst name="slave"&gt;
+         &lt;str name="masterUrl"&gt;http://your-master-hostname:8983/solr&lt;/str&gt;
+         &lt;str name="pollInterval"&gt;00:00:60&lt;/str&gt;
+       &lt;/lst&gt;
+    --&gt;
+  &lt;/requestHandler&gt;
+
+  &lt;!-- Search Components
+
+       Search components are registered to SolrCore and used by
+       instances of SearchHandler (which can access them by name)
+
+       By default, the following components are available:
+
+       &lt;searchComponent name="query"     class="solr.QueryComponent" /&gt;
+       &lt;searchComponent name="facet"     class="solr.FacetComponent" /&gt;
+       &lt;searchComponent name="mlt"       class="solr.MoreLikeThisComponent" /&gt;
+       &lt;searchComponent name="highlight" class="solr.HighlightComponent" /&gt;
+       &lt;searchComponent name="stats"     class="solr.StatsComponent" /&gt;
+       &lt;searchComponent name="debug"     class="solr.DebugComponent" /&gt;
+
+       Default configuration in a requestHandler would look like:
+
+       &lt;arr name="components"&gt;
+         &lt;str&gt;query&lt;/str&gt;
+         &lt;str&gt;facet&lt;/str&gt;
+         &lt;str&gt;mlt&lt;/str&gt;
+         &lt;str&gt;highlight&lt;/str&gt;
+         &lt;str&gt;stats&lt;/str&gt;
+         &lt;str&gt;debug&lt;/str&gt;
+       &lt;/arr&gt;
+
+       If you register a searchComponent to one of the standard names,
+       that will be used instead of the default.
+
+       To insert components before or after the 'standard' components, use:
+
+       &lt;arr name="first-components"&gt;
+         &lt;str&gt;myFirstComponentName&lt;/str&gt;
+       &lt;/arr&gt;
+
+       &lt;arr name="last-components"&gt;
+         &lt;str&gt;myLastComponentName&lt;/str&gt;
+       &lt;/arr&gt;
+
+       NOTE: The component registered with the name "debug" will
+       always be executed after the "last-components"
+
+     --&gt;
+
+   &lt;!-- Spell Check
+
+        The spell check component can return a list of alternative spelling
+        suggestions.
+
+        http://wiki.apache.org/solr/SpellCheckComponent
+     --&gt;
+  &lt;searchComponent name="spellcheck" class="solr.SpellCheckComponent"&gt;
+
+    &lt;str name="queryAnalyzerFieldType"&gt;key_lower_case&lt;/str&gt;
+
+    &lt;!-- Multiple "Spell Checkers" can be declared and used by this
+         component
+      --&gt;
+
+    &lt;!-- a spellchecker built from a field of the main index --&gt;
+    &lt;lst name="spellchecker"&gt;
+      &lt;str name="name"&gt;default&lt;/str&gt;
+      &lt;str name="field"&gt;text&lt;/str&gt;
+      &lt;str name="classname"&gt;solr.DirectSolrSpellChecker&lt;/str&gt;
+      &lt;!-- the spellcheck distance measure used, the default is the internal levenshtein --&gt;
+      &lt;str name="distanceMeasure"&gt;internal&lt;/str&gt;
+      &lt;!-- minimum accuracy needed to be considered a valid spellcheck suggestion --&gt;
+      &lt;float name="accuracy"&gt;0.5&lt;/float&gt;
+      &lt;!-- the maximum #edits we consider when enumerating terms: can be 1 or 2 --&gt;
+      &lt;int name="maxEdits"&gt;2&lt;/int&gt;
+      &lt;!-- the minimum shared prefix when enumerating terms --&gt;
+      &lt;int name="minPrefix"&gt;1&lt;/int&gt;
+      &lt;!-- maximum number of inspections per result. --&gt;
+      &lt;int name="maxInspections"&gt;5&lt;/int&gt;
+      &lt;!-- minimum length of a query term to be considered for correction --&gt;
+      &lt;int name="minQueryLength"&gt;4&lt;/int&gt;
+      &lt;!-- maximum threshold of documents a query term can appear to be considered for correction --&gt;
+      &lt;float name="maxQueryFrequency"&gt;0.01&lt;/float&gt;
+      &lt;!-- uncomment this to require suggestions to occur in 1% of the documents
+      	&lt;float name="thresholdTokenFrequency"&gt;.01&lt;/float&gt;
+      --&gt;
+    &lt;/lst&gt;
+
+    &lt;!-- a spellchecker that can break or combine words.  See "/spell" handler below for usage --&gt;
+    &lt;lst name="spellchecker"&gt;
+      &lt;str name="name"&gt;wordbreak&lt;/str&gt;
+      &lt;str name="classname"&gt;solr.WordBreakSolrSpellChecker&lt;/str&gt;
+      &lt;str name="field"&gt;name&lt;/str&gt;
+      &lt;str name="combineWords"&gt;true&lt;/str&gt;
+      &lt;str name="breakWords"&gt;true&lt;/str&gt;
+      &lt;int name="maxChanges"&gt;10&lt;/int&gt;
+    &lt;/lst&gt;
+
+    &lt;!-- a spellchecker that uses a different distance measure --&gt;
+    &lt;!--
+       &lt;lst name="spellchecker"&gt;
+         &lt;str name="name"&gt;jarowinkler&lt;/str&gt;
+         &lt;str name="field"&gt;spell&lt;/str&gt;
+         &lt;str name="classname"&gt;solr.DirectSolrSpellChecker&lt;/str&gt;
+         &lt;str name="distanceMeasure"&gt;
+           org.apache.lucene.search.spell.JaroWinklerDistance
+         &lt;/str&gt;
+       &lt;/lst&gt;
+     --&gt;
+
+    &lt;!-- a spellchecker that use an alternate comparator
+
+         comparatorClass be one of:
+          1. score (default)
+          2. freq (Frequency first, then score)
+          3. A fully qualified class name
+      --&gt;
+    &lt;!--
+       &lt;lst name="spellchecker"&gt;
+         &lt;str name="name"&gt;freq&lt;/str&gt;
+         &lt;str name="field"&gt;lowerfilt&lt;/str&gt;
+         &lt;str name="classname"&gt;solr.DirectSolrSpellChecker&lt;/str&gt;
+         &lt;str name="comparatorClass"&gt;freq&lt;/str&gt;
+      --&gt;
+
+    &lt;!-- A spellchecker that reads the list of words from a file --&gt;
+    &lt;!--
+       &lt;lst name="spellchecker"&gt;
+         &lt;str name="classname"&gt;solr.FileBasedSpellChecker&lt;/str&gt;
+         &lt;str name="name"&gt;file&lt;/str&gt;
+         &lt;str name="sourceLocation"&gt;spellings.txt&lt;/str&gt;
+         &lt;str name="characterEncoding"&gt;UTF-8&lt;/str&gt;
+         &lt;str name="spellcheckIndexDir"&gt;spellcheckerFile&lt;/str&gt;
+       &lt;/lst&gt;
+      --&gt;
+  &lt;/searchComponent&gt;
+
+  &lt;!-- A request handler for demonstrating the spellcheck component.
+
+       NOTE: This is purely as an example.  The whole purpose of the
+       SpellCheckComponent is to hook it into the request handler that
+       handles your normal user queries so that a separate request is
+       not needed to get suggestions.
+
+       IN OTHER WORDS, THERE IS REALLY GOOD CHANCE THE SETUP BELOW IS
+       NOT WHAT YOU WANT FOR YOUR PRODUCTION SYSTEM!
+
+       See http://wiki.apache.org/solr/SpellCheckComponent for details
+       on the request parameters.
+    --&gt;
+  &lt;requestHandler name="/spell" class="solr.SearchHandler" startup="lazy"&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="df"&gt;text&lt;/str&gt;
+      &lt;!-- Solr will use suggestions from both the 'default' spellchecker
+           and from the 'wordbreak' spellchecker and combine them.
+           collations (re-written queries) can include a combination of
+           corrections from both spellcheckers --&gt;
+      &lt;str name="spellcheck.dictionary"&gt;default&lt;/str&gt;
+      &lt;str name="spellcheck.dictionary"&gt;wordbreak&lt;/str&gt;
+      &lt;str name="spellcheck"&gt;on&lt;/str&gt;
+      &lt;str name="spellcheck.extendedResults"&gt;true&lt;/str&gt;
+      &lt;str name="spellcheck.count"&gt;10&lt;/str&gt;
+      &lt;str name="spellcheck.alternativeTermCount"&gt;5&lt;/str&gt;
+      &lt;str name="spellcheck.maxResultsForSuggest"&gt;5&lt;/str&gt;
+      &lt;str name="spellcheck.collate"&gt;true&lt;/str&gt;
+      &lt;str name="spellcheck.collateExtendedResults"&gt;true&lt;/str&gt;
+      &lt;str name="spellcheck.maxCollationTries"&gt;10&lt;/str&gt;
+      &lt;str name="spellcheck.maxCollations"&gt;5&lt;/str&gt;
+    &lt;/lst&gt;
+    &lt;arr name="last-components"&gt;
+      &lt;str&gt;spellcheck&lt;/str&gt;
+    &lt;/arr&gt;
+  &lt;/requestHandler&gt;
+
+  &lt;searchComponent name="suggest" class="solr.SuggestComponent"&gt;
+  	&lt;lst name="suggester"&gt;
+      &lt;str name="name"&gt;mySuggester&lt;/str&gt;
+      &lt;str name="lookupImpl"&gt;FuzzyLookupFactory&lt;/str&gt;      &lt;!-- org.apache.solr.spelling.suggest.fst --&gt;
+      &lt;str name="dictionaryImpl"&gt;DocumentDictionaryFactory&lt;/str&gt;     &lt;!-- org.apache.solr.spelling.suggest.HighFrequencyDictionaryFactory --&gt;
+      &lt;str name="field"&gt;cat&lt;/str&gt;
+      &lt;str name="weightField"&gt;price&lt;/str&gt;
+      &lt;str name="suggestAnalyzerFieldType"&gt;string&lt;/str&gt;
+    &lt;/lst&gt;
+  &lt;/searchComponent&gt;
+
+  &lt;requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy"&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="suggest"&gt;true&lt;/str&gt;
+      &lt;str name="suggest.count"&gt;10&lt;/str&gt;
+    &lt;/lst&gt;
+    &lt;arr name="components"&gt;
+      &lt;str&gt;suggest&lt;/str&gt;
+    &lt;/arr&gt;
+  &lt;/requestHandler&gt;
+  &lt;!-- Term Vector Component
+
+       http://wiki.apache.org/solr/TermVectorComponent
+    --&gt;
+  &lt;searchComponent name="tvComponent" class="solr.TermVectorComponent"/&gt;
+
+  &lt;!-- A request handler for demonstrating the term vector component
+
+       This is purely as an example.
+
+       In reality you will likely want to add the component to your
+       already specified request handlers.
+    --&gt;
+  &lt;requestHandler name="/tvrh" class="solr.SearchHandler" startup="lazy"&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="df"&gt;text&lt;/str&gt;
+      &lt;bool name="tv"&gt;true&lt;/bool&gt;
+    &lt;/lst&gt;
+    &lt;arr name="last-components"&gt;
+      &lt;str&gt;tvComponent&lt;/str&gt;
+    &lt;/arr&gt;
+  &lt;/requestHandler&gt;
+
+  &lt;!-- Clustering Component
+
+       You'll need to set the solr.clustering.enabled system property
+       when running solr to run with clustering enabled:
+
+            java -Dsolr.clustering.enabled=true -jar start.jar
+
+       http://wiki.apache.org/solr/ClusteringComponent
+       http://carrot2.github.io/solr-integration-strategies/
+    --&gt;
+  &lt;searchComponent name="clustering"
+                   enable="${solr.clustering.enabled:false}"
+                   class="solr.clustering.ClusteringComponent" &gt;
+    &lt;lst name="engine"&gt;
+      &lt;str name="name"&gt;lingo&lt;/str&gt;
+
+      &lt;!-- Class name of a clustering algorithm compatible with the Carrot2 framework.
+
+           Currently available open source algorithms are:
+           * org.carrot2.clustering.lingo.LingoClusteringAlgorithm
+           * org.carrot2.clustering.stc.STCClusteringAlgorithm
+           * org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm
+
+           See http://project.carrot2.org/algorithms.html for more information.
+
+           A commercial algorithm Lingo3G (needs to be installed separately) is defined as:
+           * com.carrotsearch.lingo3g.Lingo3GClusteringAlgorithm
+        --&gt;
+      &lt;str name="carrot.algorithm"&gt;org.carrot2.clustering.lingo.LingoClusteringAlgorithm&lt;/str&gt;
+
+      &lt;!-- Override location of the clustering algorithm's resources
+           (attribute definitions and lexical resources).
+
+           A directory from which to load algorithm-specific stop words,
+           stop labels and attribute definition XMLs.
+
+           For an overview of Carrot2 lexical resources, see:
+           http://download.carrot2.org/head/manual/#chapter.lexical-resources
+
+           For an overview of Lingo3G lexical resources, see:
+           http://download.carrotsearch.com/lingo3g/manual/#chapter.lexical-resources
+       --&gt;
+      &lt;str name="carrot.resourcesDir"&gt;clustering/carrot2&lt;/str&gt;
+    &lt;/lst&gt;
+
+    &lt;!-- An example definition for the STC clustering algorithm. --&gt;
+    &lt;lst name="engine"&gt;
+      &lt;str name="name"&gt;stc&lt;/str&gt;
+      &lt;str name="carrot.algorithm"&gt;org.carrot2.clustering.stc.STCClusteringAlgorithm&lt;/str&gt;
+    &lt;/lst&gt;
+
+    &lt;!-- An example definition for the bisecting kmeans clustering algorithm. --&gt;
+    &lt;lst name="engine"&gt;
+      &lt;str name="name"&gt;kmeans&lt;/str&gt;
+      &lt;str name="carrot.algorithm"&gt;org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm&lt;/str&gt;
+    &lt;/lst&gt;
+  &lt;/searchComponent&gt;
+
+  &lt;!-- A request handler for demonstrating the clustering component
+
+       This is purely as an example.
+
+       In reality you will likely want to add the component to your
+       already specified request handlers.
+    --&gt;
+  &lt;requestHandler name="/clustering"
+                  startup="lazy"
+                  enable="${solr.clustering.enabled:false}"
+                  class="solr.SearchHandler"&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;bool name="clustering"&gt;true&lt;/bool&gt;
+      &lt;bool name="clustering.results"&gt;true&lt;/bool&gt;
+      &lt;!-- Field name with the logical "title" of a each document (optional) --&gt;
+      &lt;str name="carrot.title"&gt;name&lt;/str&gt;
+      &lt;!-- Field name with the logical "URL" of a each document (optional) --&gt;
+      &lt;str name="carrot.url"&gt;id&lt;/str&gt;
+      &lt;!-- Field name with the logical "content" of a each document (optional) --&gt;
+      &lt;str name="carrot.snippet"&gt;features&lt;/str&gt;
+      &lt;!-- Apply highlighter to the title/ content and use this for clustering. --&gt;
+      &lt;bool name="carrot.produceSummary"&gt;true&lt;/bool&gt;
+      &lt;!-- the maximum number of labels per cluster --&gt;
+      &lt;!--&lt;int name="carrot.numDescriptions"&gt;5&lt;/int&gt;--&gt;
+      &lt;!-- produce sub clusters --&gt;
+      &lt;bool name="carrot.outputSubClusters"&gt;false&lt;/bool&gt;
+
+      &lt;!-- Configure the remaining request handler parameters. --&gt;
+      &lt;str name="defType"&gt;edismax&lt;/str&gt;
+      &lt;str name="qf"&gt;
+        text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
+      &lt;/str&gt;
+      &lt;str name="q.alt"&gt;*:*&lt;/str&gt;
+      &lt;str name="rows"&gt;10&lt;/str&gt;
+      &lt;str name="fl"&gt;*,score&lt;/str&gt;
+    &lt;/lst&gt;
+    &lt;arr name="last-components"&gt;
+      &lt;str&gt;clustering&lt;/str&gt;
+    &lt;/arr&gt;
+  &lt;/requestHandler&gt;
+
+  &lt;!-- Terms Component
+
+       http://wiki.apache.org/solr/TermsComponent
+
+       A component to return terms and document frequency of those
+       terms
+    --&gt;
+  &lt;searchComponent name="terms" class="solr.TermsComponent"/&gt;
+
+  &lt;!-- A request handler for demonstrating the terms component --&gt;
+  &lt;requestHandler name="/terms" class="solr.SearchHandler" startup="lazy"&gt;
+     &lt;lst name="defaults"&gt;
+      &lt;bool name="terms"&gt;true&lt;/bool&gt;
+      &lt;bool name="distrib"&gt;false&lt;/bool&gt;
+    &lt;/lst&gt;
+    &lt;arr name="components"&gt;
+      &lt;str&gt;terms&lt;/str&gt;
+    &lt;/arr&gt;
+  &lt;/requestHandler&gt;
+
+
+  &lt;!-- Query Elevation Component
+
+       http://wiki.apache.org/solr/QueryElevationComponent
+
+       a search component that enables you to configure the top
+       results for a given query regardless of the normal lucene
+       scoring.
+    --&gt;
+  &lt;searchComponent name="elevator" class="solr.QueryElevationComponent" &gt;
+    &lt;!-- pick a fieldType to analyze queries --&gt;
+    &lt;str name="queryFieldType"&gt;string&lt;/str&gt;
+    &lt;str name="config-file"&gt;elevate.xml&lt;/str&gt;
+  &lt;/searchComponent&gt;
+
+  &lt;!-- A request handler for demonstrating the elevator component --&gt;
+  &lt;requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy"&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="echoParams"&gt;explicit&lt;/str&gt;
+      &lt;str name="df"&gt;text&lt;/str&gt;
+    &lt;/lst&gt;
+    &lt;arr name="last-components"&gt;
+      &lt;str&gt;elevator&lt;/str&gt;
+    &lt;/arr&gt;
+  &lt;/requestHandler&gt;
+
+  &lt;!-- Highlighting Component
+
+       http://wiki.apache.org/solr/HighlightingParameters
+    --&gt;
+  &lt;searchComponent class="solr.HighlightComponent" name="highlight"&gt;
+    &lt;highlighting&gt;
+      &lt;!-- Configure the standard fragmenter --&gt;
+      &lt;!-- This could most likely be commented out in the "default" case --&gt;
+      &lt;fragmenter name="gap"
+                  default="true"
+                  class="solr.highlight.GapFragmenter"&gt;
+        &lt;lst name="defaults"&gt;
+          &lt;int name="hl.fragsize"&gt;100&lt;/int&gt;
+        &lt;/lst&gt;
+      &lt;/fragmenter&gt;
+
+      &lt;!-- A regular-expression-based fragmenter
+           (for sentence extraction)
+        --&gt;
+      &lt;fragmenter name="regex"
+                  class="solr.highlight.RegexFragmenter"&gt;
+        &lt;lst name="defaults"&gt;
+          &lt;!-- slightly smaller fragsizes work better because of slop --&gt;
+          &lt;int name="hl.fragsize"&gt;70&lt;/int&gt;
+          &lt;!-- allow 50% slop on fragment sizes --&gt;
+          &lt;float name="hl.regex.slop"&gt;0.5&lt;/float&gt;
+          &lt;!-- a basic sentence pattern --&gt;
+          &lt;str name="hl.regex.pattern"&gt;[-\w ,/\n\&amp;quot;&amp;apos;]{20,200}&lt;/str&gt;
+        &lt;/lst&gt;
+      &lt;/fragmenter&gt;
+
+      &lt;!-- Configure the standard formatter --&gt;
+      &lt;formatter name="html"
+                 default="true"
+                 class="solr.highlight.HtmlFormatter"&gt;
+        &lt;lst name="defaults"&gt;
+          &lt;str name="hl.simple.pre"&gt;&lt;![CDATA[&lt;em&gt;]]&gt;&lt;/str&gt;
+          &lt;str name="hl.simple.post"&gt;&lt;![CDATA[&lt;/em&gt;]]&gt;&lt;/str&gt;
+        &lt;/lst&gt;
+      &lt;/formatter&gt;
+
+      &lt;!-- Configure the standard encoder --&gt;
+      &lt;encoder name="html"
+               class="solr.highlight.HtmlEncoder" /&gt;
+
+      &lt;!-- Configure the standard fragListBuilder --&gt;
+      &lt;fragListBuilder name="simple"
+                       class="solr.highlight.SimpleFragListBuilder"/&gt;
+
+      &lt;!-- Configure the single fragListBuilder --&gt;
+      &lt;fragListBuilder name="single"
+                       class="solr.highlight.SingleFragListBuilder"/&gt;
+
+      &lt;!-- Configure the weighted fragListBuilder --&gt;
+      &lt;fragListBuilder name="weighted"
+                       default="true"
+                       class="solr.highlight.WeightedFragListBuilder"/&gt;
+
+      &lt;!-- default tag FragmentsBuilder --&gt;
+      &lt;fragmentsBuilder name="default"
+                        default="true"
+                        class="solr.highlight.ScoreOrderFragmentsBuilder"&gt;
+        &lt;!--
+        &lt;lst name="defaults"&gt;
+          &lt;str name="hl.multiValuedSeparatorChar"&gt;/&lt;/str&gt;
+        &lt;/lst&gt;
+        --&gt;
+      &lt;/fragmentsBuilder&gt;
+
+      &lt;!-- multi-colored tag FragmentsBuilder --&gt;
+      &lt;fragmentsBuilder name="colored"
+                        class="solr.highlight.ScoreOrderFragmentsBuilder"&gt;
+        &lt;lst name="defaults"&gt;
+          &lt;str name="hl.tag.pre"&gt;&lt;![CDATA[
+               &lt;b style="background:yellow"&gt;,&lt;b style="background:lawgreen"&gt;,
+               &lt;b style="background:aquamarine"&gt;,&lt;b style="background:magenta"&gt;,
+               &lt;b style="background:palegreen"&gt;,&lt;b style="background:coral"&gt;,
+               &lt;b style="background:wheat"&gt;,&lt;b style="background:khaki"&gt;,
+               &lt;b style="background:lime"&gt;,&lt;b style="background:deepskyblue"&gt;]]&gt;&lt;/str&gt;
+          &lt;str name="hl.tag.post"&gt;&lt;![CDATA[&lt;/b&gt;]]&gt;&lt;/str&gt;
+        &lt;/lst&gt;
+      &lt;/fragmentsBuilder&gt;
+
+      &lt;boundaryScanner name="default"
+                       default="true"
+                       class="solr.highlight.SimpleBoundaryScanner"&gt;
+        &lt;lst name="defaults"&gt;
+          &lt;str name="hl.bs.maxScan"&gt;10&lt;/str&gt;
+          &lt;str name="hl.bs.chars"&gt;.,!? &amp;#9;&amp;#10;&amp;#13;&lt;/str&gt;
+        &lt;/lst&gt;
+      &lt;/boundaryScanner&gt;
+
+      &lt;boundaryScanner name="breakIterator"
+                       class="solr.highlight.BreakIteratorBoundaryScanner"&gt;
+        &lt;lst name="defaults"&gt;
+          &lt;!-- type should be one of CHARACTER, WORD(default), LINE and SENTENCE --&gt;
+          &lt;str name="hl.bs.type"&gt;WORD&lt;/str&gt;
+          &lt;!-- language and country are used when constructing Locale object.  --&gt;
+          &lt;!-- And the Locale object will be used when getting instance of BreakIterator --&gt;
+          &lt;str name="hl.bs.language"&gt;en&lt;/str&gt;
+          &lt;str name="hl.bs.country"&gt;US&lt;/str&gt;
+        &lt;/lst&gt;
+      &lt;/boundaryScanner&gt;
+    &lt;/highlighting&gt;
+  &lt;/searchComponent&gt;
+
+  &lt;!-- Update Processors
+
+       Chains of Update Processor Factories for dealing with Update
+       Requests can be declared, and then used by name in Update
+       Request Processors
+
+       http://wiki.apache.org/solr/UpdateRequestProcessor
+
+    --&gt;
+
+  &lt;!-- Add unknown fields to the schema
+
+       An example field type guessing update processor that will
+       attempt to parse string-typed field values as Booleans, Longs,
+       Doubles, or Dates, and then add schema fields with the guessed
+       field types.
+
+       This requires that the schema is both managed and mutable, by
+       declaring schemaFactory as ManagedIndexSchemaFactory, with
+       mutable specified as true.
+
+       See http://wiki.apache.org/solr/GuessingFieldTypes
+    --&gt;
+  &lt;updateRequestProcessorChain name="add-unknown-fields-to-the-schema"&gt;
+
+    &lt;processor class="solr.DefaultValueUpdateProcessorFactory"&gt;
+        &lt;str name="fieldName"&gt;_ttl_&lt;/str&gt;
+        &lt;str name="value"&gt;+{{logsearch_audit_logs_max_retention}}DAYS&lt;/str&gt;
+    &lt;/processor&gt;
+    &lt;processor class="solr.processor.DocExpirationUpdateProcessorFactory"&gt;
+        &lt;int name="autoDeletePeriodSeconds"&gt;30&lt;/int&gt;
+        &lt;str name="ttlFieldName"&gt;_ttl_&lt;/str&gt;
+        &lt;str name="expirationFieldName"&gt;_expire_at_&lt;/str&gt;
+    &lt;/processor&gt;
+    &lt;processor class="solr.FirstFieldValueUpdateProcessorFactory"&gt;
+      &lt;str name="fieldName"&gt;_expire_at_&lt;/str&gt;
+    &lt;/processor&gt;
+
+
+    &lt;processor class="solr.RemoveBlankFieldUpdateProcessorFactory"/&gt;
+    &lt;processor class="solr.ParseBooleanFieldUpdateProcessorFactory"/&gt;
+    &lt;processor class="solr.ParseLongFieldUpdateProcessorFactory"/&gt;
+    &lt;processor class="solr.ParseDoubleFieldUpdateProcessorFactory"/&gt;
+    &lt;processor class="solr.ParseDateFieldUpdateProcessorFactory"&gt;
+      &lt;arr name="format"&gt;
+        &lt;str&gt;yyyy-MM-dd'T'HH:mm:ss.SSSZ&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd'T'HH:mm:ss,SSSZ&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd'T'HH:mm:ss.SSS&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd'T'HH:mm:ss,SSS&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd'T'HH:mm:ssZ&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd'T'HH:mm:ss&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd'T'HH:mmZ&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd'T'HH:mm&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd HH:mm:ss.SSSZ&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd HH:mm:ss,SSSZ&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd HH:mm:ss.SSS&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd HH:mm:ss,SSS&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd HH:mm:ssZ&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd HH:mm:ss&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd HH:mmZ&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd HH:mm&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd&lt;/str&gt;
+      &lt;/arr&gt;
+    &lt;/processor&gt;
+    &lt;processor class="solr.AddSchemaFieldsUpdateProcessorFactory"&gt;
+      &lt;str name="defaultFieldType"&gt;key_lower_case&lt;/str&gt;
+      &lt;lst name="typeMapping"&gt;
+        &lt;str name="valueClass"&gt;java.lang.Boolean&lt;/str&gt;
+        &lt;str name="fieldType"&gt;booleans&lt;/str&gt;
+      &lt;/lst&gt;
+      &lt;lst name="typeMapping"&gt;
+        &lt;str name="valueClass"&gt;java.util.Date&lt;/str&gt;
+        &lt;str name="fieldType"&gt;tdates&lt;/str&gt;
+      &lt;/lst&gt;
+      &lt;lst name="typeMapping"&gt;
+        &lt;str name="valueClass"&gt;java.lang.Long&lt;/str&gt;
+        &lt;str name="valueClass"&gt;java.lang.Integer&lt;/str&gt;
+        &lt;str name="fieldType"&gt;tlongs&lt;/str&gt;
+      &lt;/lst&gt;
+      &lt;lst name="typeMapping"&gt;
+        &lt;str name="valueClass"&gt;java.lang.Number&lt;/str&gt;
+        &lt;str name="fieldType"&gt;tdoubles&lt;/str&gt;
+      &lt;/lst&gt;
+    &lt;/processor&gt;
+
+    &lt;processor class="solr.LogUpdateProcessorFactory"/&gt;
+    &lt;processor class="solr.RunUpdateProcessorFactory"/&gt;
+  &lt;/updateRequestProcessorChain&gt;
+
+
+  &lt;!-- Deduplication
+
+       An example dedup update processor that creates the "id" field
+       on the fly based on the hash code of some other fields.  This
+       example has overwriteDupes set to false since we are using the
+       id field as the signatureField and Solr will maintain
+       uniqueness based on that anyway.
+
+    --&gt;
+  &lt;!--
+     &lt;updateRequestProcessorChain name="dedupe"&gt;
+       &lt;processor class="solr.processor.SignatureUpdateProcessorFactory"&gt;
+         &lt;bool name="enabled"&gt;true&lt;/bool&gt;
+         &lt;str name="signatureField"&gt;id&lt;/str&gt;
+         &lt;bool name="overwriteDupes"&gt;false&lt;/bool&gt;
+         &lt;str name="fields"&gt;name,features,cat&lt;/str&gt;
+         &lt;str name="signatureClass"&gt;solr.processor.Lookup3Signature&lt;/str&gt;
+       &lt;/processor&gt;
+       &lt;processor class="solr.LogUpdateProcessorFactory" /&gt;
+       &lt;processor class="solr.RunUpdateProcessorFactory" /&gt;
+     &lt;/updateRequestProcessorChain&gt;
+    --&gt;
+
+  &lt;!-- Language identification
+
+       This example update chain identifies the language of the incoming
+       documents using the langid contrib. The detected language is
+       written to field language_s. No field name mapping is done.
+       The fields used for detection are text, title, subject and description,
+       making this example suitable for detecting languages form full-text
+       rich documents injected via ExtractingRequestHandler.
+       See more about langId at http://wiki.apache.org/solr/LanguageDetection
+    --&gt;
+    &lt;!--
+     &lt;updateRequestProcessorChain name="langid"&gt;
+       &lt;processor class="org.apache.solr.update.processor.TikaLanguageIdentifierUpdateProcessorFactory"&gt;
+         &lt;str name="langid.fl"&gt;text,title,subject,description&lt;/str&gt;
+         &lt;str name="langid.langField"&gt;language_s&lt;/str&gt;
+         &lt;str name="langid.fallback"&gt;en&lt;/str&gt;
+       &lt;/processor&gt;
+       &lt;processor class="solr.LogUpdateProcessorFactory" /&gt;
+       &lt;processor class="solr.RunUpdateProcessorFactory" /&gt;
+     &lt;/updateRequestProcessorChain&gt;
+    --&gt;
+
+  &lt;!-- Script update processor
+
+    This example hooks in an update processor implemented using JavaScript.
+
+    See more about the script update processor at http://wiki.apache.org/solr/ScriptUpdateProcessor
+  --&gt;
+  &lt;!--
+    &lt;updateRequestProcessorChain name="script"&gt;
+      &lt;processor class="solr.StatelessScriptUpdateProcessorFactory"&gt;
+        &lt;str name="script"&gt;update-script.js&lt;/str&gt;
+        &lt;lst name="params"&gt;
+          &lt;str name="config_param"&gt;example config parameter&lt;/str&gt;
+        &lt;/lst&gt;
+      &lt;/processor&gt;
+      &lt;processor class="solr.RunUpdateProcessorFactory" /&gt;
+    &lt;/updateRequestProcessorChain&gt;
+  --&gt;
+
+  &lt;!-- Response Writers
+
+       http://wiki.apache.org/solr/QueryResponseWriter
+
+       Request responses will be written using the writer specified by
+       the 'wt' request parameter matching the name of a registered
+       writer.
+
+       The "default" writer is the default and will be used if 'wt' is
+       not specified in the request.
+    --&gt;
+  &lt;!-- The following response writers are implicitly configured unless
+       overridden...
+    --&gt;
+  &lt;!--
+     &lt;queryResponseWriter name="xml"
+                          default="true"
+                          class="solr.XMLResponseWriter" /&gt;
+     &lt;queryResponseWriter name="json" class="solr.JSONResponseWriter"/&gt;
+     &lt;queryResponseWriter name="python" class="solr.PythonResponseWriter"/&gt;
+     &lt;queryResponseWriter name="ruby" class="solr.RubyResponseWriter"/&gt;
+     &lt;queryResponseWriter name="php" class="solr.PHPResponseWriter"/&gt;
+     &lt;queryResponseWriter name="phps" class="solr.PHPSerializedResponseWriter"/&gt;
+     &lt;queryResponseWriter name="csv" class="solr.CSVResponseWriter"/&gt;
+     &lt;queryResponseWriter name="schema.xml" class="solr.SchemaXmlResponseWriter"/&gt;
+    --&gt;
+
+  &lt;queryResponseWriter name="json" class="solr.JSONResponseWriter"&gt;
+     &lt;!-- For the purposes of the tutorial, JSON responses are written as
+      plain text so that they are easy to read in *any* browser.
+      If you expect a MIME type of "application/json" just remove this override.
+     --&gt;
+    &lt;str name="content-type"&gt;text/plain; charset=UTF-8&lt;/str&gt;
+  &lt;/queryResponseWriter&gt;
+
+  &lt;!--
+     Custom response writers can be declared as needed...
+    --&gt;
+  &lt;queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" startup="lazy"&gt;
+    &lt;str name="template.base.dir"&gt;${velocity.template.base.dir:}&lt;/str&gt;
+  &lt;/queryResponseWriter&gt;
+
+  &lt;!-- XSLT response writer transforms the XML output by any xslt file found
+       in Solr's conf/xslt directory.  Changes to xslt files are checked for
+       every xsltCacheLifetimeSeconds.
+    --&gt;
+  &lt;queryResponseWriter name="xslt" class="solr.XSLTResponseWriter"&gt;
+    &lt;int name="xsltCacheLifetimeSeconds"&gt;5&lt;/int&gt;
+  &lt;/queryResponseWriter&gt;
+
+  &lt;!-- Query Parsers
+
+       http://wiki.apache.org/solr/SolrQuerySyntax
+
+       Multiple QParserPlugins can be registered by name, and then
+       used in either the "defType" param for the QueryComponent (used
+       by SearchHandler) or in LocalParams
+    --&gt;
+  &lt;!-- example of registering a query parser --&gt;
+  &lt;!--
+     &lt;queryParser name="myparser" class="com.mycompany.MyQParserPlugin"/&gt;
+    --&gt;
+
+  &lt;!-- Function Parsers
+
+       http://wiki.apache.org/solr/FunctionQuery
+
+       Multiple ValueSourceParsers can be registered by name, and then
+       used as function names when using the "func" QParser.
+    --&gt;
+  &lt;!-- example of registering a custom function parser  --&gt;
+  &lt;!--
+     &lt;valueSourceParser name="myfunc"
+                        class="com.mycompany.MyValueSourceParser" /&gt;
+    --&gt;
+
+
+  &lt;!-- Document Transformers
+       http://wiki.apache.org/solr/DocTransformers
+    --&gt;
+  &lt;!--
+     Could be something like:
+     &lt;transformer name="db" class="com.mycompany.LoadFromDatabaseTransformer" &gt;
+       &lt;int name="connection"&gt;jdbc://....&lt;/int&gt;
+     &lt;/transformer&gt;
+
+     To add a constant value to all docs, use:
+     &lt;transformer name="mytrans2" class="org.apache.solr.response.transform.ValueAugmenterFactory" &gt;
+       &lt;int name="value"&gt;5&lt;/int&gt;
+     &lt;/transformer&gt;
+
+     If you want the user to still be able to change it with _value:something_ use this:
+     &lt;transformer name="mytrans3" class="org.apache.solr.response.transform.ValueAugmenterFactory" &gt;
+       &lt;double name="defaultValue"&gt;5&lt;/double&gt;
+     &lt;/transformer&gt;
+
+      If you are using the QueryElevationComponent, you may wish to mark documents that get boosted.  The
+      EditorialMarkerFactory will do exactly that:
+     &lt;transformer name="qecBooster" class="org.apache.solr.response.transform.EditorialMarkerFactory" /&gt;
+    --&gt;
+
+
+  &lt;!-- Legacy config for the admin interface --&gt;
+  &lt;admin&gt;
+    &lt;defaultQuery&gt;*:*&lt;/defaultQuery&gt;
+  &lt;/admin&gt;
+
+&lt;/config&gt;
+    </value>
+  </property>
+
+</configuration>


[4/8] ambari git commit: AMBARI-15806. Initial commit for Logsearch service stack definition (oleewere)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-solr-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-solr-env.xml b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-solr-env.xml
new file mode 100644
index 0000000..855f0e5
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-solr-env.xml
@@ -0,0 +1,193 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * 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.
+ */
+-->
+<!-- This is a special config file for properties used to monitor status of the service -->
+<configuration supports_adding_forbidden="true">
+
+  <property>
+    <name>logsearch_solr_port</name>
+    <value>8886</value>
+    <description>Solr port</description>
+    <display-name>Logsearch Solr port</display-name>
+  </property>
+
+  <property>
+    <name>logsearch_solr_pid_dir</name>
+    <value>/var/run/ambari-logsearch-solr</value>
+    <description>Solr Process ID Directory</description>
+    <display-name>Logsearch Solr pid dir</display-name>
+  </property>
+
+  <property>
+    <name>logsearch_solr_log_dir</name>
+    <value>/var/log/ambari-logsearch-solr</value>
+    <description>Directory for Solr logs</description>
+    <display-name>Logsearch Solr log dir</display-name>
+  </property>
+
+  <property>
+    <name>logsearch_solr_user</name>
+    <value>solr</value>
+    <property-type>USER</property-type>
+    <description>Solr user</description>
+    <display-name>Logsearch Solr User</display-name>
+    <value-attributes>
+      <type>user</type>
+      <overridable>false</overridable>
+    </value-attributes>
+  </property>
+
+  <property>
+    <name>logsearch_solr_group</name>
+    <value>solr</value>
+    <property-type>GROUP</property-type>
+    <description>Solr group</description>
+    <display-name>Logsearch Solr Group</display-name>
+  </property>
+
+  <property>
+    <name>logsearch_solr_datadir</name>
+    <value>/opt/logsearch_solr/data</value>
+    <display-name>Logsearch Solr data dir</display-name>
+    <description>Directory for storting Solr index. Make sure you have enough disk space</description>
+  </property>
+
+  <property>
+    <name>logsearch_solr_znode</name>
+    <value>/logsearch</value>
+    <description>Zookeeper znode, e.g: /logsearch</description>
+    <display-name>Logsearch Solr ZNode</display-name>
+  </property>
+
+  <property>
+    <name>logsearch_solr_minmem</name>
+    <value>512m</value>
+    <display-name>Logsearch minimum heap size</display-name>
+    <description>Solr minimum heap size e.g.512m</description>
+  </property>
+
+  <property>
+    <name>logsearch_solr_maxmem</name>
+    <value>512m</value>
+    <description>Solr maximum heap size e.g. 512m</description>
+    <display-name>Logsearch maximum heap size</display-name>
+  </property>
+
+
+  <!-- logsearch-solr-env.sh -->
+
+  <property>
+    <name>content</name>
+    <description>This is the jinja template for logsearch-solr-env.sh file</description>
+    <value>
+# By default the script will use JAVA_HOME to determine which java
+# to use, but you can set a specific path for Solr to use without
+# affecting other Java applications on your server/workstation.
+SOLR_JAVA_HOME={{java64_home}}
+
+# Increase Java Min/Max Heap as needed to support your indexing / query needs
+SOLR_JAVA_MEM="-Xms{{logsearch_solr_min_mem}} -Xmx{{logsearch_solr_max_mem}}"
+
+# Enable verbose GC logging
+GC_LOG_OPTS="-verbose:gc -XX:+PrintHeapAtGC -XX:+PrintGCDetails \
+-XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime"
+
+# These GC settings have shown to work well for a number of common Solr workloads
+GC_TUNE="-XX:NewRatio=3 \
+-XX:SurvivorRatio=4 \
+-XX:TargetSurvivorRatio=90 \
+-XX:MaxTenuringThreshold=8 \
+-XX:+UseConcMarkSweepGC \
+-XX:+UseParNewGC \
+-XX:ConcGCThreads=4 -XX:ParallelGCThreads=4 \
+-XX:+CMSScavengeBeforeRemark \
+-XX:PretenureSizeThreshold=64m \
+-XX:+UseCMSInitiatingOccupancyOnly \
+-XX:CMSInitiatingOccupancyFraction=50 \
+-XX:CMSMaxAbortablePrecleanTime=6000 \
+-XX:+CMSParallelRemarkEnabled \
+-XX:+ParallelRefProcEnabled"
+
+# Set the ZooKeeper connection string if using an external ZooKeeper ensemble
+# e.g. host1:2181,host2:2181/chroot
+# Leave empty if not using SolrCloud
+ZK_HOST="{{zookeeper_quorum}}{{logsearch_solr_znode}}"
+
+# Set the ZooKeeper client timeout (for SolrCloud mode)
+ZK_CLIENT_TIMEOUT="60000"
+
+# By default the start script uses "localhost"; override the hostname here
+# for production SolrCloud environments to control the hostname exposed to cluster state
+#SOLR_HOST="192.168.1.1"
+
+# By default the start script uses UTC; override the timezone if needed
+#SOLR_TIMEZONE="UTC"
+
+# Set to true to activate the JMX RMI connector to allow remote JMX client applications
+# to monitor the JVM hosting Solr; set to "false" to disable that behavior
+# (false is recommended in production environments)
+ENABLE_REMOTE_JMX_OPTS="false"
+
+# The script will use SOLR_PORT+10000 for the RMI_PORT or you can set it here
+# RMI_PORT=18983
+
+# Anything you add to the SOLR_OPTS variable will be included in the java
+# start command line as-is, in ADDITION to other options. If you specify the
+# -a option on start script, those options will be appended as well. Examples:
+#SOLR_OPTS="$SOLR_OPTS -Dsolr.autoSoftCommit.maxTime=3000"
+#SOLR_OPTS="$SOLR_OPTS -Dsolr.autoCommit.maxTime=60000"
+#SOLR_OPTS="$SOLR_OPTS -Dsolr.clustering.enabled=true"
+
+# Location where the bin/solr script will save PID files for running instances
+# If not set, the script will create PID files in $SOLR_TIP/bin
+SOLR_PID_DIR={{logsearch_solr_piddir}}
+
+# Path to a directory where Solr creates index files, the specified directory
+# must contain a solr.xml; by default, Solr will use server/solr
+SOLR_HOME={{logsearch_solr_datadir}}
+
+# Solr provides a default Log4J configuration properties file in server/resources
+# however, you may want to customize the log settings and file appender location
+# so you can point the script to use a different log4j.properties file
+LOG4J_PROPS={{logsearch_solr_conf}}/log4j.properties
+
+# Location where Solr should write logs to; should agree with the file appender
+# settings in server/resources/log4j.properties
+SOLR_LOGS_DIR={{logsearch_solr_log_dir}}
+
+# Sets the port Solr binds to, default is 8983
+SOLR_PORT={{logsearch_solr_port}}
+
+# Uncomment to set SSL-related system properties
+# Be sure to update the paths to the correct keystore for your environment
+#SOLR_SSL_OPTS="-Djavax.net.ssl.keyStore=etc/solr-ssl.keystore.jks \
+#-Djavax.net.ssl.keyStorePassword=secret \
+#-Djavax.net.ssl.trustStore=etc/solr-ssl.keystore.jks \
+#-Djavax.net.ssl.trustStorePassword=secret"
+
+# Uncomment to set a specific SSL port (-Djetty.ssl.port=N); if not set
+# and you are using SSL, then the start script will use SOLR_PORT for the SSL port
+#SOLR_SSL_PORT=
+    </value>
+  </property>
+
+
+</configuration>  

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-solr-log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-solr-log4j.xml b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-solr-log4j.xml
new file mode 100644
index 0000000..e99cb81
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-solr-log4j.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * 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.
+ */
+-->
+<configuration supports_adding_forbidden="true">
+
+  <property>
+    <name>content</name>
+    <description>This is the jinja template for log4j.properties</description>
+    <value>
+#  Logging level
+solr.log={{logsearch_solr_log_dir}}
+#log4j.rootLogger=INFO, file, CONSOLE
+log4j.rootLogger=INFO, file
+
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=%-4r [%t] %-5p %c %x [%X{collection} %X{shard} %X{replica} %X{core}] \u2013 %m%n
+
+#- size rotation with log cleanup.
+log4j.appender.file=org.apache.log4j.RollingFileAppender
+log4j.appender.file.MaxFileSize=10MB
+log4j.appender.file.MaxBackupIndex=9
+
+#- File to log to and log format
+log4j.appender.file.File=${solr.log}/solr.log
+log4j.appender.file.layout=org.apache.log4j.PatternLayout
+log4j.appender.file.layout.ConversionPattern=%d{ISO8601} [%t] %-5p [%X{collection} %X{shard} %X{replica} %X{core}] %C (%F:%L) - %m%n
+
+log4j.logger.org.apache.zookeeper=WARN
+log4j.logger.org.apache.hadoop=WARN
+
+# set to INFO to enable infostream log messages
+log4j.logger.org.apache.solr.update.LoggingInfoStream=OFF
+    </value>
+  </property>
+
+
+</configuration>  

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-solr-xml.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-solr-xml.xml b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-solr-xml.xml
new file mode 100644
index 0000000..d31d0b3
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-solr-xml.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * 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.
+ */
+-->
+<configuration supports_adding_forbidden="true">
+
+  <property>
+    <name>content</name>
+    <description>This is the jinja template for logsearch solr.xml file</description>
+    <value>
+      &lt;solr&gt;
+        &lt;solrcloud&gt;
+          &lt;str name="host"&gt;${host:}&lt;/str&gt;
+          &lt;int name="hostPort"&gt;${jetty.port:}&lt;/int&gt;
+          &lt;str name="hostContext"&gt;${hostContext:solr}&lt;/str&gt;
+          &lt;int name="zkClientTimeout"&gt;${zkClientTimeout:15000}&lt;/int&gt;
+          &lt;bool name="genericCoreNodeNames"&gt;${genericCoreNodeNames:true}&lt;/bool&gt;
+        &lt;/solrcloud&gt;
+      &lt;/solr&gt;
+    </value>
+  </property>
+
+
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/kerberos.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/kerberos.json b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/kerberos.json
new file mode 100644
index 0000000..6dd4aa7
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/kerberos.json
@@ -0,0 +1,17 @@
+{
+  "services": [
+    {
+      "name": "LOGSEARCH",
+      "identities": [
+        {
+          "name": "/smokeuser"
+        }
+      ],
+      "components": [
+        {
+          "name": "LOGSEARCH_SERVER"
+        }
+      ]
+    }
+  ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/metainfo.xml b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/metainfo.xml
new file mode 100644
index 0000000..018398f
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/metainfo.xml
@@ -0,0 +1,123 @@
+<?xml version="1.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.
+-->
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>LOGSEARCH</name>
+      <displayName>Log Search</displayName>
+      <comment>Log aggregation, analysis, and visualization for Ambari managed services</comment>
+      <version>0.5.0</version>
+
+      <components>
+
+        <component>
+          <name>LOGSEARCH_SERVER</name>
+          <timelineAppid>logsearch</timelineAppid>
+          <displayName>Log Search Server</displayName>
+          <category>MASTER</category>
+          <cardinality>1</cardinality>
+          <versionAdvertised>false</versionAdvertised>
+          <commandScript>
+            <script>scripts/logsearch.py</script>
+            <scriptType>PYTHON</scriptType>
+          </commandScript>
+          <logs>
+            <log>
+              <logId>logsearch_app</logId>
+            </log>
+            <log>
+              <logId>logsearch_perf</logId>
+            </log>
+          </logs>
+        </component>
+
+        <component>
+          <name>LOGSEARCH_SOLR</name>
+          <displayName>Solr Instance</displayName>
+          <category>MASTER</category>
+          <cardinality>1+</cardinality>
+          <versionAdvertised>false</versionAdvertised>
+          <commandScript>
+            <script>scripts/solr.py</script>
+            <scriptType>PYTHON</scriptType>
+          </commandScript>
+        </component>
+
+        <component>
+          <name>LOGSEARCH_LOGFEEDER</name>
+          <timelineAppid>logfeeder</timelineAppid>
+          <displayName>Log Feeder</displayName>
+          <category>SLAVE</category>
+          <cardinality>ALL</cardinality>
+          <versionAdvertised>false</versionAdvertised>
+          <commandScript>
+            <script>scripts/logfeeder.py</script>
+            <scriptType>PYTHON</scriptType>
+          </commandScript>
+          <logs>
+            <log>
+              <logId>logsearch_feeder</logId>
+            </log>
+          </logs>
+        </component>
+
+      </components>
+
+      <osSpecifics>
+        <osSpecific>
+          <osFamily>redhat6</osFamily>
+          <packages>
+            <package>
+              <name>ambari-logsearch-logfeeder</name>
+              <skipUpgrade>true</skipUpgrade>
+            </package>
+            <package>
+              <name>ambari-logsearch-portal</name>
+              <skipUpgrade>true</skipUpgrade>
+              <condition>should_install_logsearch_portal</condition>
+            </package>
+            <package>
+              <name>ambari-logsearch-solr</name>
+              <skipUpgrade>true</skipUpgrade>
+              <condition>should_install_logsearch_solr</condition>
+            </package>
+          </packages>
+        </osSpecific>
+      </osSpecifics>
+
+      <requiredServices>
+        <service>ZOOKEEPER</service>
+      </requiredServices>
+
+      <configuration-dependencies>
+        <config-type>logsearch-site</config-type>
+        <config-type>solr-site</config-type>
+        <config-type>logfeeder-site</config-type>
+      </configuration-dependencies>
+      <restartRequiredAfterChange>false</restartRequiredAfterChange>
+
+      <quickLinksConfigurations>
+        <quickLinksConfiguration>
+          <fileName>quicklinks.json</fileName>
+          <default>true</default>
+        </quickLinksConfiguration>
+      </quickLinksConfigurations>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/logfeeder.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/logfeeder.py b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/logfeeder.py
new file mode 100644
index 0000000..c0689f3
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/logfeeder.py
@@ -0,0 +1,65 @@
+"""
+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.
+
+"""
+
+from resource_management.core.resources.system import Execute, File
+from resource_management.libraries.functions.format import format
+from resource_management.libraries.functions.check_process_status import check_process_status
+from resource_management.libraries.script.script import Script
+from setup_logfeeder import setup_logfeeder
+from logsearch_common import kill_process
+
+
+class LogFeeder(Script):
+  def install(self, env):
+    import params
+    env.set_params(params)
+
+    self.install_packages(env)
+
+  def configure(self, env, upgrade_type=None):
+    import params
+    env.set_params(params)
+
+    setup_logfeeder()
+
+  def start(self, env, upgrade_type=None):
+    import params
+    env.set_params(params)
+    self.configure(env)
+
+    Execute(format("{logfeeder_dir}/run.sh"),
+            environment={'LOGFEEDER_INCLUDE': format('{logsearch_logfeeder_conf}/logfeeder-env.sh')},
+            user=params.logfeeder_user
+            )
+
+  def stop(self, env, upgrade_type=None):
+    import params
+    env.set_params(params)
+
+    kill_process(params.logfeeder_pid_file, params.logfeeder_user, params.logfeeder_log_dir)
+
+  def status(self, env):
+    import status_params
+    env.set_params(status_params)
+
+    check_process_status(status_params.logfeeder_pid_file)
+
+
+if __name__ == "__main__":
+  LogFeeder().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/logsearch.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/logsearch.py b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/logsearch.py
new file mode 100644
index 0000000..b3817da
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/logsearch.py
@@ -0,0 +1,64 @@
+"""
+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.
+
+"""
+
+from resource_management.core.resources.system import Execute, File
+from resource_management.libraries.functions.check_process_status import check_process_status
+from resource_management.libraries.functions.format import format
+from resource_management.libraries.script.script import Script
+from setup_logsearch import setup_logsearch
+from logsearch_common import kill_process
+
+
+class LogSearch(Script):
+  def install(self, env):
+    import params
+    env.set_params(params)
+    self.install_packages(env)
+
+  def configure(self, env, upgrade_type=None):
+    import params
+    env.set_params(params)
+
+    setup_logsearch()
+
+  def start(self, env, upgrade_type=None):
+    import params
+    env.set_params(params)
+    self.configure(env)
+
+    Execute(format("{logsearch_dir}/run.sh {logsearch_ui_port}"),
+            environment={'LOGSEARCH_INCLUDE': format('{logsearch_server_conf}/logsearch-env.sh')},
+            user=params.logsearch_user
+            )
+
+  def stop(self, env, upgrade_type=None):
+    import params
+    env.set_params(params)
+
+    kill_process(params.logsearch_pid_file, params.logsearch_user, params.logsearch_log_dir)
+
+  def status(self, env):
+    import status_params
+    env.set_params(status_params)
+
+    check_process_status(status_params.logsearch_pid_file)
+
+
+if __name__ == "__main__":
+  LogSearch().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/logsearch_common.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/logsearch_common.py b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/logsearch_common.py
new file mode 100644
index 0000000..56f7792
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/logsearch_common.py
@@ -0,0 +1,53 @@
+"""
+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.
+
+"""
+
+from resource_management.core.resources.system import Execute, File
+from resource_management.libraries.functions.format import format
+from resource_management.libraries.functions.get_user_call_output import get_user_call_output
+from resource_management.libraries.functions.show_logs import show_logs
+
+def kill_process(pid_file, user, log_dir):
+  import params
+  """
+  Kill the process by pid file, then check the process is running or not. If the process is still running after the kill
+  command, it will try to kill with -9 option (hard kill)
+  """
+  pid = get_user_call_output(format("cat {pid_file}"), user=user, is_checked_call=False)[1]
+  process_id_exists_command = format("ls {pid_file} >/dev/null 2>&1 && ps -p {pid} >/dev/null 2>&1")
+
+  kill_cmd = format("{sudo} kill {pid}")
+  Execute(kill_cmd,
+          not_if=format("! ({process_id_exists_command})"))
+  wait_time = 5
+
+  hard_kill_cmd = format("{sudo} kill -9 {pid}")
+  Execute(hard_kill_cmd,
+          not_if=format("! ({process_id_exists_command}) || ( sleep {wait_time} && ! ({process_id_exists_command}) )"))
+  try:
+    Execute(format("! ({process_id_exists_command})"),
+            tries=20,
+            try_sleep=3,
+            )
+  except:
+    show_logs(log_dir, user)
+    raise
+
+  File(pid_file,
+       action="delete"
+       )

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/params.py
new file mode 100644
index 0000000..8352d7c
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/params.py
@@ -0,0 +1,241 @@
+#!/usr/bin/env python
+
+"""
+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.
+
+"""
+from ambari_commons.constants import AMBARI_SUDO_BINARY
+from resource_management.libraries.functions.default import default
+from resource_management.libraries.functions.format import format
+from resource_management.libraries.functions.is_empty import is_empty
+from resource_management.libraries.script.script import Script
+import os
+import status_params
+
+
+def get_port_from_url(address):
+  if not is_empty(address):
+    return address.split(':')[-1]
+  else:
+    return address
+
+
+# config object that holds the configurations declared in the -site.xml file
+config = Script.get_config()
+tmp_dir = Script.get_tmp_dir()
+
+stack_version = default("/commandParams/version", None)
+sudo = AMBARI_SUDO_BINARY
+
+logsearch_solr_conf = "/etc/ambari-logsearch-solr/conf"
+logsearch_server_conf = "/etc/ambari-logsearch-portal/conf"
+logsearch_logfeeder_conf = "/etc/ambari-logsearch-logfeeder/conf"
+
+logsearch_solr_port = status_params.logsearch_solr_port
+logsearch_solr_piddir = status_params.logsearch_solr_piddir
+logsearch_solr_pidfile = status_params.logsearch_solr_pidfile
+
+# logsearch pid file
+logsearch_pid_dir = status_params.logsearch_pid_dir
+logsearch_pid_file = status_params.logsearch_pid_file
+
+# logfeeder pid file
+logfeeder_pid_dir = status_params.logfeeder_pid_dir
+logfeeder_pid_file = status_params.logfeeder_pid_file
+
+# shared configs
+java64_home = config['hostLevelParams']['java_home']
+zookeeper_hosts_list = config['clusterHostInfo']['zookeeper_hosts']
+zookeeper_hosts_list.sort()
+# get comma separated list of zookeeper hosts from clusterHostInfo
+zookeeper_hosts = ",".join(zookeeper_hosts_list)
+cluster_name = str(config['clusterName'])
+
+# for now just pick first collector
+if 'metrics_collector_hosts' in config['clusterHostInfo']:
+  metrics_collector_hosts_list = ",".join(config['clusterHostInfo']['metrics_collector_hosts'])
+  metrics_collector_port = str(
+    get_port_from_url(config['configurations']['ams-site']['timeline.metrics.service.webapp.address']))
+  metrics_collector_hosts = format('http://{metrics_collector_hosts_list}:{metrics_collector_port}/ws/v1/timeline/metrics')
+else:
+  metrics_collector_hosts = ''
+
+#####################################
+# Solr configs
+#####################################
+
+# Only supporting SolrCloud mode - so hardcode those options
+solr_cloudmode = 'true'
+solr_dir = '/usr/lib/ambari-logsearch-solr'
+solr_bindir = solr_dir + '/bin'
+cloud_scripts = solr_dir + '/server/scripts/cloud-scripts'
+
+logsearch_solr_znode = config['configurations']['logsearch-solr-env']['logsearch_solr_znode']
+logsearch_solr_min_mem = format(config['configurations']['logsearch-solr-env']['logsearch_solr_minmem'])
+logsearch_solr_max_mem = format(config['configurations']['logsearch-solr-env']['logsearch_solr_maxmem'])
+logsearch_solr_instance_count = len(config['clusterHostInfo']['logsearch_solr_hosts'])
+logsearch_solr_datadir = format(config['configurations']['logsearch-solr-env']['logsearch_solr_datadir'])
+logsearch_solr_data_resources_dir = os.path.join(logsearch_solr_datadir, 'resources')
+logsearch_service_logs_max_retention = config['configurations']['logsearch-service_logs-solrconfig']['logsearch_service_logs_max_retention']
+logsearch_audit_logs_max_retention = config['configurations']['logsearch-audit_logs-solrconfig']['logsearch_audit_logs_max_retention']
+
+logsearch_service_logs_fields = config['configurations']['logsearch-site']['logsearch.service.logs.fields']
+
+logsearch_ui_port = config['configurations']['logsearch-site']["logsearch.ui.port"]
+logsearch_debug_enabled = str(config['configurations']['logsearch-env']["logsearch_debug_enabled"]).lower()
+logsearch_debug_port = config['configurations']['logsearch-env']["logsearch_debug_port"]
+logsearch_app_max_memory = config['configurations']['logsearch-env']['logsearch_app_max_memory']
+
+audit_logs_collection_splits_interval_mins = config['configurations']['logsearch-site']['logsearch.audit.logs.split.interval.mins']
+service_logs_collection_splits_interval_mins = config['configurations']['logsearch-site']['logsearch.service.logs.split.interval.mins']
+
+zookeeper_port = default('/configurations/zoo.cfg/clientPort', None)
+# get comma separated list of zookeeper hosts from clusterHostInfo
+index = 0
+zookeeper_quorum = ""
+for host in config['clusterHostInfo']['zookeeper_hosts']:
+  zookeeper_quorum += host + ":" + str(zookeeper_port)
+  index += 1
+  if index < len(config['clusterHostInfo']['zookeeper_hosts']):
+    zookeeper_quorum += ","
+
+if 'zoo.cfg' in config['configurations']:
+  zoo_cfg_properties_map = config['configurations']['zoo.cfg']
+else:
+  zoo_cfg_properties_map = {}
+
+logsearch_solr_user = config['configurations']['logsearch-solr-env']['logsearch_solr_user']
+logsearch_solr_group = config['configurations']['logsearch-solr-env']['logsearch_solr_group']
+logsearch_solr_log_dir = config['configurations']['logsearch-solr-env']['logsearch_solr_log_dir']
+logsearch_solr_log = format("{logsearch_solr_log_dir}/solr-install.log")
+
+solr_env_content = config['configurations']['logsearch-solr-env']['content']
+
+solr_xml_content = config['configurations']['logsearch-solr-xml']['content']
+
+solr_log4j_content = config['configurations']['logsearch-solr-log4j']['content']
+
+#####################################
+# Logsearch configs
+#####################################
+logsearch_dir = '/usr/lib/ambari-logsearch-portal'
+logsearch_numshards_config = config['configurations']['logsearch-site']['logsearch.collection.numshards']
+
+if logsearch_numshards_config > 0:
+  logsearch_numshards = str(logsearch_numshards_config)
+else:
+  logsearch_numshards = format(str(logsearch_solr_instance_count))
+
+logsearch_repfactor = str(config['configurations']['logsearch-site']['logsearch.collection.replication.factor'])
+
+logsearch_solr_collection_service_logs = default('/configurations/logsearch-site/logsearch.solr.collection.service.logs', 'hadoop_logs')
+logsearch_solr_collection_audit_logs = default('/configurations/logsearch-site/logsearch.solr.collection.audit.logs','audit_logs')
+
+solr_audit_logs_use_ranger = default('/configurations/logsearch-env/logsearch_solr_audit_logs_use_ranger', False)
+solr_audit_logs_url = ''
+
+if solr_audit_logs_use_ranger:
+  # In Ranger, this contain the /zkNode also
+  ranger_audit_solr_zookeepers = default('/configurations/ranger-admin-site/ranger.audit.solr.zookeepers', None)
+  # TODO: ranger property already has zk node appended. We need to remove it.
+  # For now, let's assume it is going to be URL
+  solr_audit_logs_url = default('/configurations/ranger-admin-site/ranger.audit.solr.urls', solr_audit_logs_url)
+else:
+  solr_audit_logs_zk_node = default('/configurations/logsearch-env/logsearch_solr_audit_logs_zk_node', None)
+  solr_audit_logs_zk_quorum = default('/configurations/logsearch-env/logsearch_solr_audit_logs_zk_quorum', None)
+
+  if not (solr_audit_logs_zk_quorum):
+    solr_audit_logs_zk_quorum = zookeeper_quorum
+  if not (solr_audit_logs_zk_node):
+    solr_audit_logs_zk_node = logsearch_solr_znode
+
+  solr_audit_logs_zk_node = format(solr_audit_logs_zk_node)
+  solr_audit_logs_zk_quorum = format(solr_audit_logs_zk_quorum)
+
+# logsearch-env configs
+logsearch_user = config['configurations']['logsearch-env']['logsearch_user']
+logsearch_group = config['configurations']['logsearch-env']['logsearch_group']
+logsearch_log_dir = config['configurations']['logsearch-env']['logsearch_log_dir']
+logsearch_log = logsearch_log_dir + '/logsearch.out'
+
+# store the log file for the service from the 'solr.log' property of the 'logsearch-env.xml' file
+logsearch_env_content = config['configurations']['logsearch-env']['content']
+logsearch_service_logs_solrconfig_content = config['configurations']['logsearch-service_logs-solrconfig']['content']
+logsearch_audit_logs_solrconfig_content = config['configurations']['logsearch-audit_logs-solrconfig']['content']
+logsearch_app_log4j_content = config['configurations']['logsearch-log4j']['content']
+
+# Log dirs
+ambari_server_log_dir = '/var/log/ambari-server'
+ambari_agent_log_dir = '/var/log/ambari-agent'
+knox_log_dir = '/var/log/knox'
+
+metrics_collector_log_dir = default('/configurations/ams-env/metrics_collector_log_dir', '/var/log')
+metrics_monitor_log_dir = default('/configurations/ams-env/metrics_monitor_log_dir', '/var/log')
+
+atlas_log_dir = default('/configurations/atlas-env/metadata_log_dir', '/var/log/atlas')
+accumulo_log_dir = default('/configurations/accumulo-env/accumulo_log_dir', '/var/log/accumulo')
+falcon_log_dir = default('/configurations/falcon-env/falcon_log_dir', '/var/log/falcon')
+hbase_log_dir = default('/configurations/hbase-env/hbase_log_dir', '/var/log/hbase')
+hdfs_log_dir_prefix = default('/configurations/hadoop-env/hdfs_log_dir_prefix', '/var/log/hadoop')
+hive_log_dir = default('/configurations/hive-env/hive_log_dir', '/var/log/hive')
+kafka_log_dir = default('/configurations/kafka-env/kafka_log_dir', '/var/log/kafka')
+oozie_log_dir = default('/configurations/oozie-env/oozie_log_dir', '/var/log/oozie')
+ranger_usersync_log_dir = default('/configurations/ranger-env/ranger_usersync_log_dir', '/var/log/ranger/usersync')
+ranger_admin_log_dir = default('/configurations/ranger-env/ranger_admin_log_dir', '/var/log/ranger/admin')
+ranger_kms_log_dir = default('/configurations/kms-env/kms_log_dir', '/var/log/ranger/kms')
+storm_log_dir = default('/configurations/storm-env/storm_log_dir', '/var/log/storm')
+yarn_log_dir_prefix = default('/configurations/yarn-env/yarn_log_dir_prefix', '/var/log/hadoop')
+mapred_log_dir_prefix = default('/configurations/mapred-env/mapred_log_dir_prefix', '/var/log/hadoop')
+zk_log_dir = default('/configurations/zookeeper-env/zk_log_dir', '/var/log/zookeeper')
+
+#####################################
+# Logfeeder configs
+#####################################
+
+logfeeder_dir = "/usr/lib/ambari-logsearch-logfeeder"
+
+# logfeeder-site configs
+solr_service_logs_enable = default('/configurations/logfeeder-site/logfeeder.solr.service.logs.enable', True)
+solr_audit_logs_enable = default('/configurations/logfeeder-site/logfeeder.solr.audit.logs_enable', True)
+
+kafka_broker_list = default('/configurations/logfeeder-site/logfeeder.kafka.broker.list', '')
+kafka_security_protocol = default('/configurations/logfeeder-site/logfeeder.kafka.security.protocol', '')
+kafka_kerberos_service_name = default('/configurations/logfeeder-site/logfeeder.kafka.kerberos.service.name', '')
+
+kafka_service_logs_enable = default('/configurations/logfeeder-site/logfeeder.kafka.service.logs.enable', False)
+kafka_audit_logs_enable = default('/configurations/logfeeder-site/logfeeder.kafka.audit.logs.enable', False)
+kafka_topic_service_logs = default('/configurations/logfeeder-site/logfeeder.kafka.topic.service.logs', 'service_logs')
+kafka_topic_audit_logs = default('/configurations/logfeeder-site/logfeeder.kafka.topic.audit.logs', 'audit_logs')
+
+# logfeeder-env configs
+logfeeder_user = config['configurations']['logfeeder-env']['logfeeder_user']
+logfeeder_group = config['configurations']['logfeeder-env']['logfeeder_group']
+logfeeder_log_dir = config['configurations']['logfeeder-env']['logfeeder_log_dir']
+logfeeder_log = logfeeder_log_dir + '/logfeeder.out'
+logfeeder_max_mem = config['configurations']['logfeeder-env']['logfeeder_max_mem']
+logfeeder_env_content = config['configurations']['logfeeder-env']['content']
+logfeeder_log4j_content = config['configurations']['logfeeder-log4j']['content']
+
+logfeeder_checkpoint_folder = default('/configurations/logfeeder-env/logfeeder.checkpoint.folder',
+                                      '/etc/ambari-logsearch-logfeeder/conf/checkpoints')
+logfeeder_supported_services = ['accumulo', 'ambari', 'ams', 'atlas', 'falcon', 'hbase', 'hdfs', 'hive', 'kafka',
+                                'knox', 'logsearch', 'oozie', 'ranger', 'storm', 'yarn', 'zookeeper']
+
+logfeeder_config_file_names = ['global.config.json', 'output.config.json'] + ['input.config-%s.json' % (tag) for tag in
+                                                                              logfeeder_supported_services]
+
+logfeeder_config_files = ','.join(logfeeder_config_file_names)

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_logfeeder.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_logfeeder.py b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_logfeeder.py
new file mode 100644
index 0000000..aec8fc0
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_logfeeder.py
@@ -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.
+
+"""
+
+from resource_management.core.resources.system import Directory, File
+from resource_management.libraries.functions.format import format
+from resource_management.core.source import InlineTemplate, Template
+
+
+def setup_logfeeder():
+  import params
+
+  Directory([params.logfeeder_log_dir, params.logfeeder_pid_dir, params.logfeeder_dir,
+             params.logsearch_logfeeder_conf, params.logfeeder_checkpoint_folder],
+            mode=0755,
+            cd_access='a',
+            owner=params.logfeeder_user,
+            group=params.logfeeder_group,
+            create_parents=True
+            )
+
+  File(params.logfeeder_log,
+       mode=0644,
+       owner=params.logfeeder_user,
+       group=params.logfeeder_group,
+       content=''
+       )
+
+  File(format("{logsearch_logfeeder_conf}/logfeeder.properties"),
+       content=Template("logfeeder.properties.j2"),
+       owner=params.logfeeder_user
+       )
+
+  File(format("{logsearch_logfeeder_conf}/logfeeder-env.sh"),
+       content=InlineTemplate(params.logfeeder_env_content),
+       owner=params.logfeeder_user
+       )
+
+  File(format("{logsearch_logfeeder_conf}/log4j.xml"),
+       content=InlineTemplate(params.logfeeder_log4j_content),
+       owner=params.logfeeder_user
+       )
+
+  File(format("{logsearch_logfeeder_conf}/grok-patterns"),
+       content=Template("grok-patterns.j2"),
+       owner=params.logfeeder_user,
+       encoding="utf-8"
+       )
+
+  for file_name in params.logfeeder_config_file_names:
+    File(format("{logsearch_logfeeder_conf}/" + file_name),
+         content=Template(file_name + ".j2"),
+         owner=params.logfeeder_user
+         )

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_logsearch.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_logsearch.py b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_logsearch.py
new file mode 100644
index 0000000..9289ceb
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_logsearch.py
@@ -0,0 +1,97 @@
+"""
+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.
+
+"""
+
+import random
+from resource_management.core.resources.system import Directory, Execute, File
+from resource_management.libraries.functions.format import format
+from resource_management.core.source import InlineTemplate, Template
+
+
+def setup_logsearch():
+  import params
+
+  Directory([params.logsearch_log_dir, params.logsearch_pid_dir, params.logsearch_dir, params.logsearch_server_conf],
+            mode=0755,
+            cd_access='a',
+            owner=params.logsearch_user,
+            group=params.logsearch_group,
+            create_parents=True
+            )
+
+  File(params.logsearch_log,
+       mode=0644,
+       owner=params.logsearch_user,
+       group=params.logsearch_group,
+       content=''
+       )
+
+  File(format("{logsearch_server_conf}/logsearch.properties"),
+       content=Template("logsearch.properties.j2"),
+       owner=params.logsearch_user
+       )
+
+  File(format("{logsearch_server_conf}/log4j.xml"),
+       content=InlineTemplate(params.logsearch_app_log4j_content),
+       owner=params.logsearch_user
+       )
+
+  File(format("{logsearch_server_conf}/logsearch-env.sh"),
+       content=InlineTemplate(params.logsearch_env_content),
+       mode=0755,
+       owner=params.logsearch_user
+       )
+
+  File(format("{logsearch_server_conf}/solr_configsets/hadoop_logs/conf/solrconfig.xml"),
+       content=InlineTemplate(params.logsearch_service_logs_solrconfig_content),
+       owner=params.logsearch_user
+       )
+
+  File(format("{logsearch_server_conf}/solr_configsets/audit_logs/conf/solrconfig.xml"),
+       content=InlineTemplate(params.logsearch_audit_logs_solrconfig_content),
+       owner=params.logsearch_user
+       )
+
+  random_num = random.random()
+
+  upload_configuration_dir_to_zk('hadoop_logs', random_num)
+
+  upload_configuration_dir_to_zk('history', random_num)
+
+  upload_configuration_dir_to_zk('audit_logs', random_num)
+
+  Execute(("chmod", "-R", "ugo+r", format("{logsearch_server_conf}/solr_configsets")),
+          sudo=True
+          )
+
+
+def upload_configuration_dir_to_zk(config_set, random_num):
+  import params
+
+  tmp_config_set_folder = format('{tmp_dir}/solr_config_{config_set}_{random_num}')
+  zk_cli_prefix = format(
+    'export JAVA_HOME={java64_home} ; {cloud_scripts}/zkcli.sh -zkhost {zookeeper_quorum}{logsearch_solr_znode}')
+
+  Execute(format('{zk_cli_prefix} -cmd downconfig -confdir {tmp_config_set_folder} -confname {config_set}'),
+          only_if=format("{zk_cli_prefix} -cmd get /configs/{config_set}"),
+          )
+
+  Execute(format(
+    '{zk_cli_prefix} -cmd upconfig -confdir {logsearch_server_conf}/solr_configsets/{config_set}/conf -confname {config_set}'),
+    not_if=format("test -d {tmp_config_set_folder}"),
+  )

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_solr.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_solr.py b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_solr.py
new file mode 100644
index 0000000..0171e36
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_solr.py
@@ -0,0 +1,70 @@
+"""
+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.
+
+"""
+
+from resource_management.core.resources.system import Directory, Execute, File
+from resource_management.libraries.functions.format import format
+from resource_management.core.source import InlineTemplate, Template
+
+
+def setup_solr():
+  import params
+
+  Directory([params.solr_dir, params.logsearch_solr_log_dir, params.logsearch_solr_piddir, params.logsearch_solr_conf,
+             params.logsearch_solr_datadir, params.logsearch_solr_data_resources_dir],
+            mode=0755,
+            cd_access='a',
+            owner=params.logsearch_solr_user,
+            group=params.logsearch_solr_group,
+            create_parents=True
+            )
+
+  File(params.logsearch_solr_log,
+       mode=0644,
+       owner=params.logsearch_solr_user,
+       group=params.logsearch_solr_group,
+       content=''
+       )
+
+  File(format("{logsearch_solr_conf}/logsearch-solr-env.sh"),
+       content=InlineTemplate(params.solr_env_content),
+       mode=0755,
+       owner=params.logsearch_solr_user
+       )
+
+  File(format("{logsearch_solr_datadir}/solr.xml"),
+       content=InlineTemplate(params.solr_xml_content),
+       owner=params.logsearch_solr_user
+       )
+
+  File(format("{logsearch_solr_conf}/log4j.properties"),
+       content=InlineTemplate(params.solr_log4j_content),
+       owner=params.logsearch_solr_user
+       )
+
+  File(format("{logsearch_solr_datadir}/zoo.cfg"),
+       content=Template("zoo.cfg.j2"),
+       owner=params.logsearch_solr_user
+       )
+
+  zk_cli_prefix = format('export JAVA_HOME={java64_home}; {cloud_scripts}/zkcli.sh -zkhost {zookeeper_hosts}')
+  Execute(format('{zk_cli_prefix} -cmd makepath {logsearch_solr_znode}'),
+          not_if=format("{zk_cli_prefix} -cmd get {logsearch_solr_znode}"),
+          ignore_failures=True,
+          user=params.logsearch_solr_user
+          )

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/solr.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/solr.py b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/solr.py
new file mode 100644
index 0000000..ecb48c8
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/solr.py
@@ -0,0 +1,71 @@
+"""
+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.
+
+"""
+
+from resource_management.core.resources.system import Execute, File
+from resource_management.libraries.functions.format import format
+from resource_management.libraries.functions.check_process_status import check_process_status
+from resource_management.libraries.script.script import Script
+from setup_solr import setup_solr
+
+
+class Solr(Script):
+  def install(self, env):
+    import params
+    env.set_params(params)
+    self.install_packages(env)
+
+  def configure(self, env, upgrade_type=None):
+    import params
+    env.set_params(params)
+
+    setup_solr()
+
+  def start(self, env, upgrade_type=None):
+    import params
+    env.set_params(params)
+    self.configure(env)
+
+    Execute(
+      format('{solr_bindir}/solr start -cloud -noprompt -s {logsearch_solr_datadir} >> {logsearch_solr_log} 2>&1'),
+      environment={'SOLR_INCLUDE': format('{logsearch_solr_conf}/logsearch-solr-env.sh')},
+      user=params.logsearch_solr_user
+    )
+
+  def stop(self, env, upgrade_type=None):
+    import params
+    env.set_params(params)
+
+    Execute(format('{solr_bindir}/solr stop -all >> {logsearch_solr_log}'),
+            environment={'SOLR_INCLUDE': format('{logsearch_solr_conf}/logsearch-solr-env.sh')},
+            user=params.logsearch_solr_user,
+            only_if=format("test -f {logsearch_solr_pidfile}")
+            )
+    File(params.logsearch_solr_pidfile,
+         action="delete"
+         )
+
+  def status(self, env):
+    import status_params
+    env.set_params(status_params)
+
+    check_process_status(status_params.logsearch_solr_pidfile)
+
+
+if __name__ == "__main__":
+  Solr().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/status_params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/status_params.py b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/status_params.py
new file mode 100644
index 0000000..1efe605
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/status_params.py
@@ -0,0 +1,37 @@
+#!/usr/bin/env python
+
+"""
+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.
+
+"""
+
+from resource_management.libraries.functions.format import format
+from resource_management.libraries.script.script import Script
+
+config = Script.get_config()
+
+logsearch_solr_port = config['configurations']['logsearch-solr-env']['logsearch_solr_port']
+logsearch_solr_piddir = config['configurations']['logsearch-solr-env']['logsearch_solr_pid_dir']
+logsearch_solr_pidfile = format("{logsearch_solr_piddir}/solr-{logsearch_solr_port}.pid")
+
+# logsearch pid file
+logsearch_pid_dir = config['configurations']['logsearch-env']['logsearch_pid_dir']
+logsearch_pid_file = format("{logsearch_pid_dir}/logsearch.pid")
+
+# logfeeder pid file
+logfeeder_pid_dir = config['configurations']['logfeeder-env']['logfeeder_pid_dir']
+logfeeder_pid_file = format("{logfeeder_pid_dir}/logfeeder.pid")

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/global.config.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/global.config.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/global.config.json.j2
new file mode 100644
index 0000000..f337527
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/global.config.json.j2
@@ -0,0 +1,28 @@
+{#
+ # 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.
+ #}
+{
+  "global":{
+    "add_fields":{
+      "cluster":"{{cluster_name}}"
+    },
+    "source":"file",
+    "tail":"true",
+    "gen_event_md5":"true",
+    "start_position":"beginning"
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/grok-patterns.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/grok-patterns.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/grok-patterns.j2
new file mode 100644
index 0000000..c85a06a
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/grok-patterns.j2
@@ -0,0 +1,144 @@
+# 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.
+
+#Updated JAVACLASS to be same as JAVAFILE. Because if class doesn't have package, then it doesn't work.
+JAVACLASS (?:[A-Za-z$0-9_. -]+)
+#JAVACLASS (?:[a-zA-Z$_][a-zA-Z$_0-9]*\.)*[a-zA-Z$_][a-zA-Z$_0-9]*
+#JAVACLASS (?:[a-zA-Z0-9-]+\.)+[A-Za-z0-9$]+
+
+#Space is an allowed character to match special cases like 'Native Method' or 'Unknown Source'
+JAVAFILE (?:[A-Za-z0-9_. -]+)
+#Allow special <init> or <clinit> method
+JAVAMETHOD (?:(<init>)|(<clinit>)|[a-zA-Z$_][a-zA-Z$_0-9]*)
+#Line number is optional in special cases 'Native method' or 'Unknown source'
+JAVASTACKTRACEPART %{SPACE}at %{JAVACLASS:class}\.%{JAVAMETHOD:method}\(%{JAVAFILE:file}(?::%{NUMBER:line})?\)
+# Java Logs
+JAVATHREAD (?:[A-Z]{2}-Processor[\d]+)
+
+JAVASTACKTRACEPART at %{JAVACLASS:class}\.%{WORD:method}\(%{JAVAFILE:file}:%{NUMBER:line}\)
+JAVALOGMESSAGE (.*)
+# MMM dd, yyyy HH:mm:ss eg: Jan 9, 2014 7:13:13 AM
+CATALINA_DATESTAMP %{MONTH} %{MONTHDAY}, 20%{YEAR} %{HOUR}:?%{MINUTE}(?::?%{SECOND}) (?:AM|PM)
+# yyyy-MM-dd HH:mm:ss,SSS ZZZ eg: 2014-01-09 17:32:25,527 -0800
+TOMCAT_DATESTAMP 20%{YEAR}-%{MONTHNUM}-%{MONTHDAY} %{HOUR}:?%{MINUTE}(?::?%{SECOND}) %{ISO8601_TIMEZONE}
+CATALINALOG %{CATALINA_DATESTAMP:timestamp} %{JAVACLASS:class} %{JAVALOGMESSAGE:logmessage}
+# 2014-01-09 20:03:28,269 -0800 | ERROR | com.example.service.ExampleService - something compeletely unexpected happened...
+TOMCATLOG %{TOMCAT_DATESTAMP:timestamp} \| %{LOGLEVEL:level} \| %{JAVACLASS:class} - %{JAVALOGMESSAGE:logmessage}
+
+USERNAME [a-zA-Z0-9._-]+
+USER %{USERNAME}
+EMAILLOCALPART [a-zA-Z][a-zA-Z0-9_.+-=:]+
+EMAILADDRESS %{EMAILLOCALPART}@%{HOSTNAME}
+HTTPDUSER %{EMAILADDRESS}|%{USER}
+INT (?:[+-]?(?:[0-9]+))
+BASE10NUM (?<![0-9.+-])(?>[+-]?(?:(?:[0-9]+(?:\.[0-9]+)?)|(?:\.[0-9]+)))
+NUMBER (?:%{BASE10NUM})
+BASE16NUM (?<![0-9A-Fa-f])(?:[+-]?(?:0x)?(?:[0-9A-Fa-f]+))
+BASE16FLOAT \b(?<![0-9A-Fa-f.])(?:[+-]?(?:0x)?(?:(?:[0-9A-Fa-f]+(?:\.[0-9A-Fa-f]*)?)|(?:\.[0-9A-Fa-f]+)))\b
+
+POSINT \b(?:[1-9][0-9]*)\b
+NONNEGINT \b(?:[0-9]+)\b
+WORD \b\w+\b
+NOTSPACE \S+
+SPACE \s*
+DATA .*?
+GREEDYDATA .*
+QUOTEDSTRING (?>(?<!\\)(?>"(?>\\.|[^\\"]+)+"|""|(?>'(?>\\.|[^\\']+)+')|''|(?>`(?>\\.|[^\\`]+)+`)|``))
+UUID [A-Fa-f0-9]{8}-(?:[A-Fa-f0-9]{4}-){3}[A-Fa-f0-9]{12}
+
+# Networking
+MAC (?:%{CISCOMAC}|%{WINDOWSMAC}|%{COMMONMAC})
+CISCOMAC (?:(?:[A-Fa-f0-9]{4}\.){2}[A-Fa-f0-9]{4})
+WINDOWSMAC (?:(?:[A-Fa-f0-9]{2}-){5}[A-Fa-f0-9]{2})
+COMMONMAC (?:(?:[A-Fa-f0-9]{2}:){5}[A-Fa-f0-9]{2})
+IPV6 ((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5
 ]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?
+IPV4 (?<![0-9])(?:(?:[0-1]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])[.](?:[0-1]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])[.](?:[0-1]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])[.](?:[0-1]?[0-9]{1,2}|2[0-4][0-9]|25[0-5]))(?![0-9])
+IP (?:%{IPV6}|%{IPV4})
+HOSTNAME \b(?:[0-9A-Za-z][0-9A-Za-z-]{0,62})(?:\.(?:[0-9A-Za-z][0-9A-Za-z-]{0,62}))*(\.?|\b)
+IPORHOST (?:%{IP}|%{HOSTNAME})
+HOSTPORT %{IPORHOST}:%{POSINT}
+
+# paths
+PATH (?:%{UNIXPATH}|%{WINPATH})
+UNIXPATH (/([\w_%!$@:.,~-]+|\\.)*)+
+TTY (?:/dev/(pts|tty([pq])?)(\w+)?/?(?:[0-9]+))
+WINPATH (?>[A-Za-z]+:|\\)(?:\\[^\\?*]*)+
+URIPROTO [A-Za-z]+(\+[A-Za-z+]+)?
+URIHOST %{IPORHOST}(?::%{POSINT:port})?
+# uripath comes loosely from RFC1738, but mostly from what Firefox
+# doesn't turn into %XX
+URIPATH (?:/[A-Za-z0-9$.+!*'(){},~:;=@#%_\-]*)+
+#URIPARAM \?(?:[A-Za-z0-9]+(?:=(?:[^&]*))?(?:&(?:[A-Za-z0-9]+(?:=(?:[^&]*))?)?)*)?
+URIPARAM \?[A-Za-z0-9$.+!*'|(){},~@#%&/=:;_?\-\[\]<>]*
+URIPATHPARAM %{URIPATH}(?:%{URIPARAM})?
+URI %{URIPROTO}://(?:%{USER}(?::[^@]*)?@)?(?:%{URIHOST})?(?:%{URIPATHPARAM})?
+
+# Months: January, Feb, 3, 03, 12, December
+MONTH \b(?:Jan(?:uary|uar)?|Feb(?:ruary|ruar)?|M(?:a|ä)?r(?:ch|z)?|Apr(?:il)?|Ma(?:y|i)?|Jun(?:e|i)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|O(?:c|k)?t(?:ober)?|Nov(?:ember)?|De(?:c|z)(?:ember)?)\b
+MONTHNUM (?:0?[1-9]|1[0-2])
+MONTHNUM2 (?:0[1-9]|1[0-2])
+MONTHDAY (?:(?:0[1-9])|(?:[12][0-9])|(?:3[01])|[1-9])
+
+# Days: Monday, Tue, Thu, etc...
+DAY (?:Mon(?:day)?|Tue(?:sday)?|Wed(?:nesday)?|Thu(?:rsday)?|Fri(?:day)?|Sat(?:urday)?|Sun(?:day)?)
+
+# Years?
+YEAR (?>\d\d){1,2}
+HOUR (?:2[0123]|[01]?[0-9])
+MINUTE (?:[0-5][0-9])
+# '60' is a leap second in most time standards and thus is valid.
+SECOND (?:(?:[0-5]?[0-9]|60)(?:[:.,][0-9]+)?)
+TIME (?!<[0-9])%{HOUR}:%{MINUTE}(?::%{SECOND})(?![0-9])
+# datestamp is YYYY/MM/DD-HH:MM:SS.UUUU (or something like it)
+DATE_US %{MONTHNUM}[/-]%{MONTHDAY}[/-]%{YEAR}
+DATE_EU %{MONTHDAY}[./-]%{MONTHNUM}[./-]%{YEAR}
+ISO8601_TIMEZONE (?:Z|[+-]%{HOUR}(?::?%{MINUTE}))
+ISO8601_SECOND (?:%{SECOND}|60)
+TIMESTAMP_ISO8601 %{YEAR}-%{MONTHNUM}-%{MONTHDAY}[T ]%{HOUR}:?%{MINUTE}(?::?%{SECOND})?%{ISO8601_TIMEZONE}?
+DATE %{DATE_US}|%{DATE_EU}
+DATESTAMP %{DATE}[- ]%{TIME}
+TZ (?:[PMCE][SD]T|UTC)
+DATESTAMP_RFC822 %{DAY} %{MONTH} %{MONTHDAY} %{YEAR} %{TIME} %{TZ}
+DATESTAMP_RFC2822 %{DAY}, %{MONTHDAY} %{MONTH} %{YEAR} %{TIME} %{ISO8601_TIMEZONE}
+DATESTAMP_OTHER %{DAY} %{MONTH} %{MONTHDAY} %{TIME} %{TZ} %{YEAR}
+DATESTAMP_EVENTLOG %{YEAR}%{MONTHNUM2}%{MONTHDAY}%{HOUR}%{MINUTE}%{SECOND}
+HTTPDERROR_DATE %{DAY} %{MONTH} %{MONTHDAY} %{TIME} %{YEAR}
+
+# Syslog Dates: Month Day HH:MM:SS
+SYSLOGTIMESTAMP %{MONTH} +%{MONTHDAY} %{TIME}
+PROG [\x21-\x5a\x5c\x5e-\x7e]+
+SYSLOGPROG %{PROG:program}(?:\[%{POSINT:pid}\])?
+SYSLOGHOST %{IPORHOST}
+SYSLOGFACILITY <%{NONNEGINT:facility}.%{NONNEGINT:priority}>
+HTTPDATE %{MONTHDAY}/%{MONTH}/%{YEAR}:%{TIME} %{INT}
+
+# Shortcuts
+QS %{QUOTEDSTRING}
+
+# Log formats
+SYSLOGBASE %{SYSLOGTIMESTAMP:timestamp} (?:%{SYSLOGFACILITY} )?%{SYSLOGHOST:logsource} %{SYSLOGPROG}:
+COMMONAPACHELOG %{IPORHOST:clientip} %{HTTPDUSER:ident} %{USER:auth} \[%{HTTPDATE:timestamp}\] "(?:%{WORD:verb} %{NOTSPACE:request}(?: HTTP/%{NUMBER:httpversion})?|%{DATA:rawrequest})" %{NUMBER:response} (?:%{NUMBER:bytes}|-)
+COMBINEDAPACHELOG %{COMMONAPACHELOG} %{QS:referrer} %{QS:agent}
+HTTPD20_ERRORLOG \[%{HTTPDERROR_DATE:timestamp}\] \[%{LOGLEVEL:loglevel}\] (?:\[client %{IPORHOST:clientip}\] ){0,1}%{GREEDYDATA:errormsg}
+HTTPD24_ERRORLOG \[%{HTTPDERROR_DATE:timestamp}\] \[%{WORD:module}:%{LOGLEVEL:loglevel}\] \[pid %{POSINT:pid}:tid %{NUMBER:tid}\]( \(%{POSINT:proxy_errorcode}\)%{DATA:proxy_errormessage}:)?( \[client %{IPORHOST:client}:%{POSINT:clientport}\])? %{DATA:errorcode}: %{GREEDYDATA:message}
+HTTPD_ERRORLOG %{HTTPD20_ERRORLOG}|%{HTTPD24_ERRORLOG}
+
+
+# Log Levels
+LOGLEVEL ([Aa]lert|ALERT|[Tt]race|TRACE|[Dd]ebug|DEBUG|[Nn]otice|NOTICE|[Ii]nfo|INFO|[Ww]arn?(?:ing)?|WARN?(?:ING)?|[Ee]rr?(?:or)?|ERR?(?:OR)?|[Cc]rit?(?:ical)?|CRIT?(?:ICAL)?|[Ff]atal|FATAL|[Ss]evere|SEVERE|EMERG(?:ENCY)?|[Ee]merg(?:ency)?)
+
+
+# Custom
+USER_SYNC_DATE %{MONTHDAY} %{MONTH} %{YEAR} %{TIME}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-accumulo.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-accumulo.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-accumulo.json.j2
new file mode 100644
index 0000000..eb56b1c
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-accumulo.json.j2
@@ -0,0 +1,105 @@
+{#
+ # 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.
+ #}
+{
+  "input":[
+    {
+      "type":"accumulo_gc",
+      "rowtype":"service",
+      "path":"{{accumulo_log_dir}}/gc_*.log"
+    },
+    {
+      "type":"accumulo_master",
+      "rowtype":"service",
+      "path":"{{accumulo_log_dir}}/master_*.log"
+    },
+    {
+      "type":"accumulo_monitor",
+      "rowtype":"service",
+      "path":"{{accumulo_log_dir}}/monitor_*.log"
+    },
+    {
+      "type":"accumulo_tracer",
+      "rowtype":"service",
+      "path":"{{accumulo_log_dir}}/tracer_*.log"
+    },
+    {
+      "type":"accumulo_tserver",
+      "rowtype":"service",
+      "path":"{{accumulo_log_dir}}/tserver_*.log"
+    }
+
+  ],
+  "filter":[
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "accumulo_master"
+          ]
+
+        }
+
+      },
+      "log4j_format":"%d{ISO8601} [%-8c{2}] %-5p: %m%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}\\[%{JAVACLASS:logger_name}\\]%{SPACE}%{LOGLEVEL:level}:%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+
+        }
+
+      }
+
+    },
+    {
+      "filter":"grok",
+      "comment":"This one has one extra space after LEVEL",
+      "conditions":{
+        "fields":{
+          "type":[
+            "accumulo_gc",
+            "accumulo_monitor",
+            "accumulo_tracer",
+            "accumulo_tserver"
+          ]
+
+        }
+
+      },
+      "log4j_format":"%d{ISO8601} [%-8c{2}] %-5p: %X{application} %m%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}\\[%{JAVACLASS:logger_name}\\]%{SPACE}%{LOGLEVEL:level}%{SPACE}:%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+          
+        }
+
+      }
+
+    }
+
+  ]
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-ambari.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-ambari.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-ambari.json.j2
new file mode 100644
index 0000000..ed997ab
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-ambari.json.j2
@@ -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.
+ #}
+{
+  "input":[
+    {
+      "type":"ambari_agent",
+      "rowtype":"service",
+      "path":"{{ambari_agent_log_dir}}/ambari-agent.log"
+    },
+    {
+      "type":"ambari_server",
+      "rowtype":"service",
+      "path":"{{ambari_server_log_dir}}/ambari-server.log"
+    }
+
+  ],
+  "filter":[
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "ambari_agent"
+          ]
+
+        }
+
+      },
+      "log4j_format":"",
+      "multiline_pattern":"^(%{LOGLEVEL:level} %{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{LOGLEVEL:level} %{TIMESTAMP_ISO8601:logtime} %{JAVAFILE:file}:%{INT:line_number} - %{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+
+        },
+        "level":{
+          "map_fieldvalue":{
+            "pre_value":"WARNING",
+            "post_value":"WARN"
+          }
+
+        }
+
+      }
+
+    },
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "ambari_server"
+          ]
+          
+        }
+        
+      },
+      "log4j_format":"%d{DATE} %5p [%t] %c{1}:%L - %m%n",
+      "multiline_pattern":"^(%{USER_SYNC_DATE:logtime})",
+      "message_pattern":"(?m)^%{USER_SYNC_DATE:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}\\[%{DATA:thread_name}\\]%{SPACE}%{JAVACLASS:logger_name}:%{INT:line_number}%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"dd MMM yyyy HH:mm:ss"
+          }
+
+        }
+
+      }
+
+    }
+
+  ]
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-ams.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-ams.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-ams.json.j2
new file mode 100644
index 0000000..34c1ed4
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-ams.json.j2
@@ -0,0 +1,92 @@
+{#
+ # 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.
+ #}
+{
+  "input":[
+    {
+      "type":"ams_hbase_master",
+      "rowtype":"service",
+      "path":"{{metrics_collector_log_dir}}/hbase-ams-master-*.log"
+    },
+    {
+      "type":"ams_hbase_regionserver",
+      "rowtype":"service",
+      "path":"{{metrics_collector_log_dir}}/hbase-ams-regionserver-*.log"
+    },
+    {
+      "type":"ams_collector",
+      "rowtype":"service",
+      "path":"{{metrics_collector_log_dir}}/ambari-metrics-collector.log"
+    }
+
+  ],
+  "filter":[
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "ams_collector"
+          ]
+
+        }
+
+      },
+      "log4j_format":"%d{ISO8601} %p %c: %m%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{JAVACLASS:logger_name}:%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+
+        }
+
+      }
+
+    },
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "ams_hbase_master",
+            "ams_hbase_regionserver"
+          ]
+
+        }
+
+      },
+      "log4j_format":"%d{ISO8601} %-5p [%t] %c{2}: %m%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}\\[%{DATA:thread_name}\\]%{SPACE}%{JAVACLASS:logger_name}:%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+
+        }
+
+      }
+
+    }
+
+  ]
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-atlas.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-atlas.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-atlas.json.j2
new file mode 100644
index 0000000..ae799b3
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-atlas.json.j2
@@ -0,0 +1,55 @@
+{#
+ # 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.
+ #}
+{
+  "input":[
+    {
+      "type":"atlas_app",
+      "rowtype":"service",
+      "path":"{{atlas_log_dir}}/application.log"
+    }
+  ],
+  "filter":[
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "atlas_app"
+          ]
+
+        }
+
+      },
+      "log4j_format":"%d %-5p - [%t:%x] ~ %m (%c{1}:%L)%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{SPACE}-%{SPACE}\\[%{DATA:thread_name}\\]%{SPACE}~%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+
+        }
+
+      }
+
+    }
+
+  ]
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-falcon.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-falcon.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-falcon.json.j2
new file mode 100644
index 0000000..c0d27a8
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-falcon.json.j2
@@ -0,0 +1,55 @@
+{#
+ # 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.
+ #}
+{
+  "input":[
+    {
+      "type":"falcon_app",
+      "rowtype":"service",
+      "path":"{{falcon_log_dir}}/falcon.application.log"
+    }
+  ],
+  "filter":[
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "falcon_app"
+          ]
+
+        }
+
+      },
+      "log4j_format":"%d %-5p - [%t:%x] ~ %m (%c{1}:%L)%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{SPACE}-%{SPACE}\\[%{DATA:thread_name}\\]%{SPACE}~%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+
+        }
+
+      }
+
+    }
+
+  ]
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-hbase.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-hbase.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-hbase.json.j2
new file mode 100644
index 0000000..fb47e77
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-hbase.json.j2
@@ -0,0 +1,62 @@
+{#
+ # 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.
+ #}
+{
+  "input":[
+    {
+      "type":"hbase_master",
+      "rowtype":"service",
+      "path":"{{hbase_log_dir}}/hbase-hbase-master-*.log"
+    },
+    {
+      "type":"hbase_regionserver",
+      "rowtype":"service",
+      "path":"{{hbase_log_dir}}/hbase-hbase-regionserver-*.log"
+    }
+
+  ],
+  "filter":[
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "hbase_master",
+            "hbase_regionserver"
+          ]
+
+        }
+
+      },
+      "log4j_format":"%d{ISO8601} %-5p [%t] %c{2}: %m%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}\\[%{DATA:thread_name}\\]%{SPACE}%{JAVACLASS:logger_name}:%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+
+        }
+
+      }
+
+    }
+
+  ]
+
+}
\ No newline at end of file


[5/8] ambari git commit: AMBARI-15806. Initial commit for Logsearch service stack definition (oleewere)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-service_logs-solrconfig.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-service_logs-solrconfig.xml b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-service_logs-solrconfig.xml
new file mode 100644
index 0000000..60363c8
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-service_logs-solrconfig.xml
@@ -0,0 +1,1928 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * 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.
+ */
+-->
+<!-- This is a special config file for properties used to monitor status of the service -->
+<configuration supports_adding_forbidden="true">
+
+  <property>
+    <name>logsearch_service_logs_max_retention</name>
+    <value>7</value>
+    <display-name>Max retention</display-name>
+    <description>Days to retain the service logs in Solr</description>
+  </property>
+
+  <!-- solrconfig.xml -->
+
+  <property>
+    <name>content</name>
+    <description>This is the jinja template for solrconfig.xml file for service logs</description>
+    <value>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
+&lt;!--
+ 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.
+--&gt;
+
+&lt;!-- 
+     For more details about configurations options that may appear in
+     this file, see http://wiki.apache.org/solr/SolrConfigXml. 
+--&gt;
+&lt;config&gt;
+  &lt;!-- In all configuration below, a prefix of "solr." for class names
+       is an alias that causes solr to search appropriate packages,
+       including org.apache.solr.(search|update|request|core|analysis)
+
+       You may also specify a fully qualified Java classname if you
+       have your own custom plugins.
+    --&gt;
+
+  &lt;!-- Controls what version of Lucene various components of Solr
+       adhere to.  Generally, you want to use the latest version to
+       get all bug fixes and improvements. It is highly recommended
+       that you fully re-index after changing this setting as it can
+       affect both how text is indexed and queried.
+  --&gt;
+  &lt;luceneMatchVersion&gt;5.0.0&lt;/luceneMatchVersion&gt;
+
+  &lt;!-- &lt;lib/&gt; directives can be used to instruct Solr to load any Jars
+       identified and use them to resolve any "plugins" specified in
+       your solrconfig.xml or schema.xml (ie: Analyzers, Request
+       Handlers, etc...).
+
+       All directories and paths are resolved relative to the
+       instanceDir.
+
+       Please note that &lt;lib/&gt; directives are processed in the order
+       that they appear in your solrconfig.xml file, and are "stacked" 
+       on top of each other when building a ClassLoader - so if you have 
+       plugin jars with dependencies on other jars, the "lower level" 
+       dependency jars should be loaded first.
+
+       If a "./lib" directory exists in your instanceDir, all files
+       found in it are included as if you had used the following
+       syntax...
+       
+              &lt;lib dir="./lib" /&gt;
+    --&gt;
+
+  &lt;!-- A 'dir' option by itself adds any files found in the directory 
+       to the classpath, this is useful for including all jars in a
+       directory.
+
+       When a 'regex' is specified in addition to a 'dir', only the
+       files in that directory which completely match the regex
+       (anchored on both ends) will be included.
+
+       If a 'dir' option (with or without a regex) is used and nothing
+       is found that matches, a warning will be logged.
+
+       The examples below can be used to load some solr-contribs along 
+       with their external dependencies.
+    --&gt;
+  &lt;lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-dataimporthandler-.*\.jar" /&gt;
+
+  &lt;lib dir="${solr.install.dir:../../../..}/contrib/extraction/lib" regex=".*\.jar" /&gt;
+  &lt;lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-cell-\d.*\.jar" /&gt;
+
+  &lt;lib dir="${solr.install.dir:../../../..}/contrib/clustering/lib/" regex=".*\.jar" /&gt;
+  &lt;lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-clustering-\d.*\.jar" /&gt;
+
+  &lt;lib dir="${solr.install.dir:../../../..}/contrib/langid/lib/" regex=".*\.jar" /&gt;
+  &lt;lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-langid-\d.*\.jar" /&gt;
+
+  &lt;lib dir="${solr.install.dir:../../../..}/contrib/velocity/lib" regex=".*\.jar" /&gt;
+  &lt;lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-velocity-\d.*\.jar" /&gt;
+
+  &lt;!-- an exact 'path' can be used instead of a 'dir' to specify a 
+       specific jar file.  This will cause a serious error to be logged 
+       if it can't be loaded.
+    --&gt;
+  &lt;!--
+     &lt;lib path="../a-jar-that-does-not-exist.jar" /&gt; 
+  --&gt;
+  
+  &lt;!-- Data Directory
+
+       Used to specify an alternate directory to hold all index data
+       other than the default ./data under the Solr home.  If
+       replication is in use, this should match the replication
+       configuration.
+    --&gt;
+  &lt;dataDir&gt;${solr.data.dir:}&lt;/dataDir&gt;
+
+
+  &lt;!-- The DirectoryFactory to use for indexes.
+       
+       solr.StandardDirectoryFactory is filesystem
+       based and tries to pick the best implementation for the current
+       JVM and platform.  solr.NRTCachingDirectoryFactory, the default,
+       wraps solr.StandardDirectoryFactory and caches small files in memory
+       for better NRT performance.
+
+       One can force a particular implementation via solr.MMapDirectoryFactory,
+       solr.NIOFSDirectoryFactory, or solr.SimpleFSDirectoryFactory.
+
+       solr.RAMDirectoryFactory is memory based, not
+       persistent, and doesn't work with replication.
+    --&gt;
+  &lt;directoryFactory name="DirectoryFactory" 
+                    class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"&gt;
+    
+         
+    &lt;!-- These will be used if you are using the solr.HdfsDirectoryFactory,
+         otherwise they will be ignored. If you don't plan on using hdfs,
+         you can safely remove this section. --&gt;      
+    &lt;!-- The root directory that collection data should be written to. --&gt;     
+    &lt;str name="solr.hdfs.home"&gt;${solr.hdfs.home:}&lt;/str&gt;
+    &lt;!-- The hadoop configuration files to use for the hdfs client. --&gt;    
+    &lt;str name="solr.hdfs.confdir"&gt;${solr.hdfs.confdir:}&lt;/str&gt;
+    &lt;!-- Enable/Disable the hdfs cache. --&gt;    
+    &lt;str name="solr.hdfs.blockcache.enabled"&gt;${solr.hdfs.blockcache.enabled:true}&lt;/str&gt;
+    &lt;!-- Enable/Disable using one global cache for all SolrCores. 
+         The settings used will be from the first HdfsDirectoryFactory created. --&gt;    
+    &lt;str name="solr.hdfs.blockcache.global"&gt;${solr.hdfs.blockcache.global:true}&lt;/str&gt;
+    
+  &lt;/directoryFactory&gt; 
+
+  &lt;!-- The CodecFactory for defining the format of the inverted index.
+       The default implementation is SchemaCodecFactory, which is the official Lucene
+       index format, but hooks into the schema to provide per-field customization of
+       the postings lists and per-document values in the fieldType element
+       (postingsFormat/docValuesFormat). Note that most of the alternative implementations
+       are experimental, so if you choose to customize the index format, it's a good
+       idea to convert back to the official format e.g. via IndexWriter.addIndexes(IndexReader)
+       before upgrading to a newer version to avoid unnecessary reindexing.
+  --&gt;
+  &lt;codecFactory class="solr.SchemaCodecFactory"/&gt;
+
+  &lt;!-- To enable dynamic schema REST APIs, use the following for &lt;schemaFactory&gt;: --&gt;
+  
+       &lt;schemaFactory class="ManagedIndexSchemaFactory"&gt;
+         &lt;bool name="mutable"&gt;true&lt;/bool&gt;
+         &lt;str name="managedSchemaResourceName"&gt;managed-schema&lt;/str&gt;
+       &lt;/schemaFactory&gt;
+&lt;!--       
+       When ManagedIndexSchemaFactory is specified, Solr will load the schema from
+       the resource named in 'managedSchemaResourceName', rather than from schema.xml.
+       Note that the managed schema resource CANNOT be named schema.xml.  If the managed
+       schema does not exist, Solr will create it after reading schema.xml, then rename
+       'schema.xml' to 'schema.xml.bak'. 
+       
+       Do NOT hand edit the managed schema - external modifications will be ignored and
+       overwritten as a result of schema modification REST API calls.
+
+       When ManagedIndexSchemaFactory is specified with mutable = true, schema
+       modification REST API calls will be allowed; otherwise, error responses will be
+       sent back for these requests. 
+
+  &lt;schemaFactory class="ClassicIndexSchemaFactory"/&gt;
+  --&gt;
+
+  &lt;!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+       Index Config - These settings control low-level behavior of indexing
+       Most example settings here show the default value, but are commented
+       out, to more easily see where customizations have been made.
+       
+       Note: This replaces &lt;indexDefaults&gt; and &lt;mainIndex&gt; from older versions
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --&gt;
+  &lt;indexConfig&gt;
+    &lt;!-- maxFieldLength was removed in 4.0. To get similar behavior, include a 
+         LimitTokenCountFilterFactory in your fieldType definition. E.g. 
+     &lt;filter class="solr.LimitTokenCountFilterFactory" maxTokenCount="10000"/&gt;
+    --&gt;
+    &lt;!-- Maximum time to wait for a write lock (ms) for an IndexWriter. Default: 1000 --&gt;
+    &lt;!-- &lt;writeLockTimeout&gt;1000&lt;/writeLockTimeout&gt;  --&gt;
+    &lt;!-- LogSearch customization to avoid timeouts --&gt;
+    &lt;writeLockTimeout&gt;10000&lt;/writeLockTimeout&gt;
+
+    &lt;!-- The maximum number of simultaneous threads that may be
+         indexing documents at once in IndexWriter; if more than this
+         many threads arrive they will wait for others to finish.
+         Default in Solr/Lucene is 8. --&gt;
+    &lt;!-- &lt;maxIndexingThreads&gt;8&lt;/maxIndexingThreads&gt;  --&gt;
+    &lt;!-- LogSearch customization of increase performance --&gt;
+    &lt;maxIndexingThreads&gt;50&lt;/maxIndexingThreads&gt;
+
+    &lt;!-- Expert: Enabling compound file will use less files for the index, 
+         using fewer file descriptors on the expense of performance decrease. 
+         Default in Lucene is "true". Default in Solr is "false" (since 3.6) --&gt;
+    &lt;!-- &lt;useCompoundFile&gt;false&lt;/useCompoundFile&gt; --&gt;
+
+    &lt;!-- ramBufferSizeMB sets the amount of RAM that may be used by Lucene
+         indexing for buffering added documents and deletions before they are
+         flushed to the Directory.
+         maxBufferedDocs sets a limit on the number of documents buffered
+         before flushing.
+         If both ramBufferSizeMB and maxBufferedDocs is set, then
+         Lucene will flush based on whichever limit is hit first.
+         The default is 100 MB.  --&gt;
+    &lt;!-- &lt;ramBufferSizeMB&gt;100&lt;/ramBufferSizeMB&gt; --&gt;
+    &lt;!-- &lt;maxBufferedDocs&gt;1000&lt;/maxBufferedDocs&gt; --&gt;
+
+    &lt;!-- Expert: Merge Policy 
+         The Merge Policy in Lucene controls how merging of segments is done.
+         The default since Solr/Lucene 3.3 is TieredMergePolicy.
+         The default since Lucene 2.3 was the LogByteSizeMergePolicy,
+         Even older versions of Lucene used LogDocMergePolicy.
+      --&gt;
+    &lt;!--
+        &lt;mergePolicy class="org.apache.lucene.index.TieredMergePolicy"&gt;
+          &lt;int name="maxMergeAtOnce"&gt;10&lt;/int&gt;
+          &lt;int name="segmentsPerTier"&gt;10&lt;/int&gt;
+        &lt;/mergePolicy&gt;
+      --&gt;
+       
+    &lt;!-- Merge Factor
+         The merge factor controls how many segments will get merged at a time.
+         For TieredMergePolicy, mergeFactor is a convenience parameter which
+         will set both MaxMergeAtOnce and SegmentsPerTier at once.
+         For LogByteSizeMergePolicy, mergeFactor decides how many new segments
+         will be allowed before they are merged into one.
+         Default is 10 for both merge policies.
+      --&gt;
+    &lt;!-- 
+    &lt;mergeFactor&gt;10&lt;/mergeFactor&gt;
+      --&gt;
+    &lt;!-- LogSearch customization. Increased to 25 to maximize indexing speed --&gt;
+    &lt;mergeFactor&gt;25&lt;/mergeFactor&gt;
+
+    &lt;!-- Expert: Merge Scheduler
+         The Merge Scheduler in Lucene controls how merges are
+         performed.  The ConcurrentMergeScheduler (Lucene 2.3 default)
+         can perform merges in the background using separate threads.
+         The SerialMergeScheduler (Lucene 2.2 default) does not.
+     --&gt;
+    &lt;!-- 
+       &lt;mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/&gt;
+       --&gt;
+
+    &lt;!-- LockFactory 
+
+         This option specifies which Lucene LockFactory implementation
+         to use.
+      
+         single = SingleInstanceLockFactory - suggested for a
+                  read-only index or when there is no possibility of
+                  another process trying to modify the index.
+         native = NativeFSLockFactory - uses OS native file locking.
+                  Do not use when multiple solr webapps in the same
+                  JVM are attempting to share a single index.
+         simple = SimpleFSLockFactory  - uses a plain file for locking
+
+         Defaults: 'native' is default for Solr3.6 and later, otherwise
+                   'simple' is the default
+
+         More details on the nuances of each LockFactory...
+         http://wiki.apache.org/lucene-java/AvailableLockFactories
+    --&gt;
+    &lt;lockType&gt;${solr.lock.type:native}&lt;/lockType&gt;
+
+    &lt;!-- Unlock On Startup
+
+         If true, unlock any held write or commit locks on startup.
+         This defeats the locking mechanism that allows multiple
+         processes to safely access a lucene index, and should be used
+         with care. Default is "false".
+
+         This is not needed if lock type is 'single'
+     --&gt;
+    &lt;!--
+    &lt;unlockOnStartup&gt;false&lt;/unlockOnStartup&gt;
+      --&gt;
+
+    &lt;!-- Commit Deletion Policy
+         Custom deletion policies can be specified here. The class must
+         implement org.apache.lucene.index.IndexDeletionPolicy.
+
+         The default Solr IndexDeletionPolicy implementation supports
+         deleting index commit points on number of commits, age of
+         commit point and optimized status.
+         
+         The latest commit point should always be preserved regardless
+         of the criteria.
+    --&gt;
+    &lt;!-- 
+    &lt;deletionPolicy class="solr.SolrDeletionPolicy"&gt;
+    --&gt;
+      &lt;!-- The number of commit points to be kept --&gt;
+      &lt;!-- &lt;str name="maxCommitsToKeep"&gt;1&lt;/str&gt; --&gt;
+      &lt;!-- The number of optimized commit points to be kept --&gt;
+      &lt;!-- &lt;str name="maxOptimizedCommitsToKeep"&gt;0&lt;/str&gt; --&gt;
+      &lt;!--
+          Delete all commit points once they have reached the given age.
+          Supports DateMathParser syntax e.g.
+        --&gt;
+      &lt;!--
+         &lt;str name="maxCommitAge"&gt;30MINUTES&lt;/str&gt;
+         &lt;str name="maxCommitAge"&gt;1DAY&lt;/str&gt;
+      --&gt;
+    &lt;!-- 
+    &lt;/deletionPolicy&gt;
+    --&gt;
+
+    &lt;!-- Lucene Infostream
+       
+         To aid in advanced debugging, Lucene provides an "InfoStream"
+         of detailed information when indexing.
+
+         Setting the value to true will instruct the underlying Lucene
+         IndexWriter to write its info stream to solr's log. By default,
+         this is enabled here, and controlled through log4j.properties.
+      --&gt;
+     &lt;infoStream&gt;true&lt;/infoStream&gt;
+  &lt;/indexConfig&gt;
+
+
+  &lt;!-- JMX
+       
+       This example enables JMX if and only if an existing MBeanServer
+       is found, use this if you want to configure JMX through JVM
+       parameters. Remove this to disable exposing Solr configuration
+       and statistics to JMX.
+
+       For more details see http://wiki.apache.org/solr/SolrJmx
+    --&gt;
+  &lt;jmx /&gt;
+  &lt;!-- If you want to connect to a particular server, specify the
+       agentId 
+    --&gt;
+  &lt;!-- &lt;jmx agentId="myAgent" /&gt; --&gt;
+  &lt;!-- If you want to start a new MBeanServer, specify the serviceUrl --&gt;
+  &lt;!-- &lt;jmx serviceUrl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr"/&gt;
+    --&gt;
+
+  &lt;!-- The default high-performance update handler --&gt;
+  &lt;updateHandler class="solr.DirectUpdateHandler2"&gt;
+
+    &lt;!-- Enables a transaction log, used for real-time get, durability, and
+         and solr cloud replica recovery.  The log can grow as big as
+         uncommitted changes to the index, so use of a hard autoCommit
+         is recommended (see below).
+         "dir" - the target directory for transaction logs, defaults to the
+                solr data directory.  --&gt; 
+    &lt;updateLog&gt;
+      &lt;str name="dir"&gt;${solr.ulog.dir:}&lt;/str&gt;
+    &lt;/updateLog&gt;
+ 
+    &lt;!-- AutoCommit
+
+         Perform a hard commit automatically under certain conditions.
+         Instead of enabling autoCommit, consider using "commitWithin"
+         when adding documents. 
+
+         http://wiki.apache.org/solr/UpdateXmlMessages
+
+         maxDocs - Maximum number of documents to add since the last
+                   commit before automatically triggering a new commit.
+
+         maxTime - Maximum amount of time in ms that is allowed to pass
+                   since a document was added before automatically
+                   triggering a new commit. 
+         openSearcher - if false, the commit causes recent index changes
+           to be flushed to stable storage, but does not cause a new
+           searcher to be opened to make those changes visible.
+
+         If the updateLog is enabled, then it's highly recommended to
+         have some sort of hard autoCommit to limit the log size.
+      --&gt;
+     &lt;autoCommit&gt; 
+       &lt;maxTime&gt;${solr.autoCommit.maxTime:15000}&lt;/maxTime&gt; 
+       &lt;openSearcher&gt;false&lt;/openSearcher&gt; 
+     &lt;/autoCommit&gt;
+
+    &lt;!-- softAutoCommit is like autoCommit except it causes a
+         'soft' commit which only ensures that changes are visible
+         but does not ensure that data is synced to disk.  This is
+         faster and more near-realtime friendly than a hard commit.
+      --&gt;
+
+     &lt;autoSoftCommit&gt; 
+       &lt;maxTime&gt;${solr.autoSoftCommit.maxTime:5000}&lt;/maxTime&gt; 
+     &lt;/autoSoftCommit&gt;
+
+    &lt;!-- Update Related Event Listeners
+         
+         Various IndexWriter related events can trigger Listeners to
+         take actions.
+
+         postCommit - fired after every commit or optimize command
+         postOptimize - fired after every optimize command
+      --&gt;
+    &lt;!-- The RunExecutableListener executes an external command from a
+         hook such as postCommit or postOptimize.
+         
+         exe - the name of the executable to run
+         dir - dir to use as the current working directory. (default=".")
+         wait - the calling thread waits until the executable returns. 
+                (default="true")
+         args - the arguments to pass to the program.  (default is none)
+         env - environment variables to set.  (default is none)
+      --&gt;
+    &lt;!-- This example shows how RunExecutableListener could be used
+         with the script based replication...
+         http://wiki.apache.org/solr/CollectionDistribution
+      --&gt;
+    &lt;!--
+       &lt;listener event="postCommit" class="solr.RunExecutableListener"&gt;
+         &lt;str name="exe"&gt;solr/bin/snapshooter&lt;/str&gt;
+         &lt;str name="dir"&gt;.&lt;/str&gt;
+         &lt;bool name="wait"&gt;true&lt;/bool&gt;
+         &lt;arr name="args"&gt; &lt;str&gt;arg1&lt;/str&gt; &lt;str&gt;arg2&lt;/str&gt; &lt;/arr&gt;
+         &lt;arr name="env"&gt; &lt;str&gt;MYVAR=val1&lt;/str&gt; &lt;/arr&gt;
+       &lt;/listener&gt;
+      --&gt;
+
+  &lt;/updateHandler&gt;
+  
+  &lt;!-- IndexReaderFactory
+
+       Use the following format to specify a custom IndexReaderFactory,
+       which allows for alternate IndexReader implementations.
+
+       ** Experimental Feature **
+
+       Please note - Using a custom IndexReaderFactory may prevent
+       certain other features from working. The API to
+       IndexReaderFactory may change without warning or may even be
+       removed from future releases if the problems cannot be
+       resolved.
+
+
+       ** Features that may not work with custom IndexReaderFactory **
+
+       The ReplicationHandler assumes a disk-resident index. Using a
+       custom IndexReader implementation may cause incompatibility
+       with ReplicationHandler and may cause replication to not work
+       correctly. See SOLR-1366 for details.
+
+    --&gt;
+  &lt;!--
+  &lt;indexReaderFactory name="IndexReaderFactory" class="package.class"&gt;
+    &lt;str name="someArg"&gt;Some Value&lt;/str&gt;
+  &lt;/indexReaderFactory &gt;
+  --&gt;
+
+  &lt;!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+       Query section - these settings control query time things like caches
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --&gt;
+  &lt;query&gt;
+    &lt;!-- Max Boolean Clauses
+
+         Maximum number of clauses in each BooleanQuery,  an exception
+         is thrown if exceeded.
+
+         ** WARNING **
+         
+         This option actually modifies a global Lucene property that
+         will affect all SolrCores.  If multiple solrconfig.xml files
+         disagree on this property, the value at any given moment will
+         be based on the last SolrCore to be initialized.
+         
+      --&gt;
+    &lt;maxBooleanClauses&gt;1024&lt;/maxBooleanClauses&gt;
+
+
+    &lt;!-- Solr Internal Query Caches
+
+         There are two implementations of cache available for Solr,
+         LRUCache, based on a synchronized LinkedHashMap, and
+         FastLRUCache, based on a ConcurrentHashMap.  
+
+         FastLRUCache has faster gets and slower puts in single
+         threaded operation and thus is generally faster than LRUCache
+         when the hit ratio of the cache is high (&gt; 75%), and may be
+         faster under other scenarios on multi-cpu systems.
+    --&gt;
+
+    &lt;!-- Filter Cache
+
+         Cache used by SolrIndexSearcher for filters (DocSets),
+         unordered sets of *all* documents that match a query.  When a
+         new searcher is opened, its caches may be prepopulated or
+         "autowarmed" using data from caches in the old searcher.
+         autowarmCount is the number of items to prepopulate.  For
+         LRUCache, the autowarmed items will be the most recently
+         accessed items.
+
+         Parameters:
+           class - the SolrCache implementation LRUCache or
+               (LRUCache or FastLRUCache)
+           size - the maximum number of entries in the cache
+           initialSize - the initial capacity (number of entries) of
+               the cache.  (see java.util.HashMap)
+           autowarmCount - the number of entries to prepopulate from
+               and old cache.  
+      --&gt;
+    &lt;filterCache class="solr.FastLRUCache"
+                 size="512"
+                 initialSize="512"
+                 autowarmCount="0"/&gt;
+
+    &lt;!-- Query Result Cache
+         
+         Caches results of searches - ordered lists of document ids
+         (DocList) based on a query, a sort, and the range of documents requested.  
+      --&gt;
+    &lt;queryResultCache class="solr.LRUCache"
+                     size="512"
+                     initialSize="512"
+                     autowarmCount="0"/&gt;
+   
+    &lt;!-- Document Cache
+
+         Caches Lucene Document objects (the stored fields for each
+         document).  Since Lucene internal document ids are transient,
+         this cache will not be autowarmed.  
+      --&gt;
+    &lt;documentCache class="solr.LRUCache"
+                   size="512"
+                   initialSize="512"
+                   autowarmCount="0"/&gt;
+    
+    &lt;!-- custom cache currently used by block join --&gt; 
+    &lt;cache name="perSegFilter"
+      class="solr.search.LRUCache"
+      size="10"
+      initialSize="0"
+      autowarmCount="10"
+      regenerator="solr.NoOpRegenerator" /&gt;
+
+    &lt;!-- Field Value Cache
+         
+         Cache used to hold field values that are quickly accessible
+         by document id.  The fieldValueCache is created by default
+         even if not configured here.
+      --&gt;
+    &lt;!--
+       &lt;fieldValueCache class="solr.FastLRUCache"
+                        size="512"
+                        autowarmCount="128"
+                        showItems="32" /&gt;
+      --&gt;
+
+    &lt;!-- Custom Cache
+
+         Example of a generic cache.  These caches may be accessed by
+         name through SolrIndexSearcher.getCache(),cacheLookup(), and
+         cacheInsert().  The purpose is to enable easy caching of
+         user/application level data.  The regenerator argument should
+         be specified as an implementation of solr.CacheRegenerator 
+         if autowarming is desired.  
+      --&gt;
+    &lt;!--
+       &lt;cache name="myUserCache"
+              class="solr.LRUCache"
+              size="4096"
+              initialSize="1024"
+              autowarmCount="1024"
+              regenerator="com.mycompany.MyRegenerator"
+              /&gt;
+      --&gt;
+
+
+    &lt;!-- Lazy Field Loading
+
+         If true, stored fields that are not requested will be loaded
+         lazily.  This can result in a significant speed improvement
+         if the usual case is to not load all stored fields,
+         especially if the skipped fields are large compressed text
+         fields.
+    --&gt;
+    &lt;enableLazyFieldLoading&gt;true&lt;/enableLazyFieldLoading&gt;
+
+   &lt;!-- Use Filter For Sorted Query
+
+        A possible optimization that attempts to use a filter to
+        satisfy a search.  If the requested sort does not include
+        score, then the filterCache will be checked for a filter
+        matching the query. If found, the filter will be used as the
+        source of document ids, and then the sort will be applied to
+        that.
+
+        For most situations, this will not be useful unless you
+        frequently get the same search repeatedly with different sort
+        options, and none of them ever use "score"
+     --&gt;
+   &lt;!--
+      &lt;useFilterForSortedQuery&gt;true&lt;/useFilterForSortedQuery&gt;
+     --&gt;
+
+   &lt;!-- Result Window Size
+
+        An optimization for use with the queryResultCache.  When a search
+        is requested, a superset of the requested number of document ids
+        are collected.  For example, if a search for a particular query
+        requests matching documents 10 through 19, and queryWindowSize is 50,
+        then documents 0 through 49 will be collected and cached.  Any further
+        requests in that range can be satisfied via the cache.  
+     --&gt;
+   &lt;queryResultWindowSize&gt;20&lt;/queryResultWindowSize&gt;
+
+   &lt;!-- Maximum number of documents to cache for any entry in the
+        queryResultCache. 
+     --&gt;
+   &lt;queryResultMaxDocsCached&gt;200&lt;/queryResultMaxDocsCached&gt;
+
+   &lt;!-- Query Related Event Listeners
+
+        Various IndexSearcher related events can trigger Listeners to
+        take actions.
+
+        newSearcher - fired whenever a new searcher is being prepared
+        and there is a current searcher handling requests (aka
+        registered).  It can be used to prime certain caches to
+        prevent long request times for certain requests.
+
+        firstSearcher - fired whenever a new searcher is being
+        prepared but there is no current registered searcher to handle
+        requests or to gain autowarming data from.
+
+        
+     --&gt;
+    &lt;!-- QuerySenderListener takes an array of NamedList and executes a
+         local query request for each NamedList in sequence. 
+      --&gt;
+    &lt;listener event="newSearcher" class="solr.QuerySenderListener"&gt;
+      &lt;arr name="queries"&gt;
+        &lt;!--
+           &lt;lst&gt;&lt;str name="q"&gt;solr&lt;/str&gt;&lt;str name="sort"&gt;price asc&lt;/str&gt;&lt;/lst&gt;
+           &lt;lst&gt;&lt;str name="q"&gt;rocks&lt;/str&gt;&lt;str name="sort"&gt;weight asc&lt;/str&gt;&lt;/lst&gt;
+          --&gt;
+      &lt;/arr&gt;
+    &lt;/listener&gt;
+    &lt;listener event="firstSearcher" class="solr.QuerySenderListener"&gt;
+      &lt;arr name="queries"&gt;
+        &lt;lst&gt;
+          &lt;str name="q"&gt;static firstSearcher warming in solrconfig.xml&lt;/str&gt;
+        &lt;/lst&gt;
+      &lt;/arr&gt;
+    &lt;/listener&gt;
+
+    &lt;!-- Use Cold Searcher
+
+         If a search request comes in and there is no current
+         registered searcher, then immediately register the still
+         warming searcher and use it.  If "false" then all requests
+         will block until the first searcher is done warming.
+      --&gt;
+    &lt;useColdSearcher&gt;false&lt;/useColdSearcher&gt;
+
+    &lt;!-- Max Warming Searchers
+         
+         Maximum number of searchers that may be warming in the
+         background concurrently.  An error is returned if this limit
+         is exceeded.
+
+         Recommend values of 1-2 for read-only slaves, higher for
+         masters w/o cache warming.
+      --&gt;
+    &lt;maxWarmingSearchers&gt;2&lt;/maxWarmingSearchers&gt;
+
+  &lt;/query&gt;
+
+
+  &lt;!-- Request Dispatcher
+
+       This section contains instructions for how the SolrDispatchFilter
+       should behave when processing requests for this SolrCore.
+
+       handleSelect is a legacy option that affects the behavior of requests
+       such as /select?qt=XXX
+
+       handleSelect="true" will cause the SolrDispatchFilter to process
+       the request and dispatch the query to a handler specified by the 
+       "qt" param, assuming "/select" isn't already registered.
+
+       handleSelect="false" will cause the SolrDispatchFilter to
+       ignore "/select" requests, resulting in a 404 unless a handler
+       is explicitly registered with the name "/select"
+
+       handleSelect="true" is not recommended for new users, but is the default
+       for backwards compatibility
+    --&gt;
+  &lt;requestDispatcher handleSelect="false" &gt;
+    &lt;!-- Request Parsing
+
+         These settings indicate how Solr Requests may be parsed, and
+         what restrictions may be placed on the ContentStreams from
+         those requests
+
+         enableRemoteStreaming - enables use of the stream.file
+         and stream.url parameters for specifying remote streams.
+
+         multipartUploadLimitInKB - specifies the max size (in KiB) of
+         Multipart File Uploads that Solr will allow in a Request.
+         
+         formdataUploadLimitInKB - specifies the max size (in KiB) of
+         form data (application/x-www-form-urlencoded) sent via
+         POST. You can use POST to pass request parameters not
+         fitting into the URL.
+         
+         addHttpRequestToContext - if set to true, it will instruct
+         the requestParsers to include the original HttpServletRequest
+         object in the context map of the SolrQueryRequest under the 
+         key "httpRequest". It will not be used by any of the existing
+         Solr components, but may be useful when developing custom 
+         plugins.
+         
+         *** WARNING ***
+         The settings below authorize Solr to fetch remote files, You
+         should make sure your system has some authentication before
+         using enableRemoteStreaming="true"
+
+      --&gt; 
+    &lt;requestParsers enableRemoteStreaming="true" 
+                    multipartUploadLimitInKB="2048000"
+                    formdataUploadLimitInKB="2048"
+                    addHttpRequestToContext="false"/&gt;
+
+    &lt;!-- HTTP Caching
+
+         Set HTTP caching related parameters (for proxy caches and clients).
+
+         The options below instruct Solr not to output any HTTP Caching
+         related headers
+      --&gt;
+    &lt;httpCaching never304="true" /&gt;
+    &lt;!-- If you include a &lt;cacheControl&gt; directive, it will be used to
+         generate a Cache-Control header (as well as an Expires header
+         if the value contains "max-age=")
+         
+         By default, no Cache-Control header is generated.
+         
+         You can use the &lt;cacheControl&gt; option even if you have set
+         never304="true"
+      --&gt;
+    &lt;!--
+       &lt;httpCaching never304="true" &gt;
+         &lt;cacheControl&gt;max-age=30, public&lt;/cacheControl&gt; 
+       &lt;/httpCaching&gt;
+      --&gt;
+    &lt;!-- To enable Solr to respond with automatically generated HTTP
+         Caching headers, and to response to Cache Validation requests
+         correctly, set the value of never304="false"
+         
+         This will cause Solr to generate Last-Modified and ETag
+         headers based on the properties of the Index.
+
+         The following options can also be specified to affect the
+         values of these headers...
+
+         lastModFrom - the default value is "openTime" which means the
+         Last-Modified value (and validation against If-Modified-Since
+         requests) will all be relative to when the current Searcher
+         was opened.  You can change it to lastModFrom="dirLastMod" if
+         you want the value to exactly correspond to when the physical
+         index was last modified.
+
+         etagSeed="..." is an option you can change to force the ETag
+         header (and validation against If-None-Match requests) to be
+         different even if the index has not changed (ie: when making
+         significant changes to your config file)
+
+         (lastModifiedFrom and etagSeed are both ignored if you use
+         the never304="true" option)
+      --&gt;
+    &lt;!--
+       &lt;httpCaching lastModifiedFrom="openTime"
+                    etagSeed="Solr"&gt;
+         &lt;cacheControl&gt;max-age=30, public&lt;/cacheControl&gt; 
+       &lt;/httpCaching&gt;
+      --&gt;
+  &lt;/requestDispatcher&gt;
+
+  &lt;!-- Request Handlers 
+
+       http://wiki.apache.org/solr/SolrRequestHandler
+
+       Incoming queries will be dispatched to a specific handler by name
+       based on the path specified in the request.
+
+       Legacy behavior: If the request path uses "/select" but no Request
+       Handler has that name, and if handleSelect="true" has been specified in
+       the requestDispatcher, then the Request Handler is dispatched based on
+       the qt parameter.  Handlers without a leading '/' are accessed this way
+       like so: http://host/app/[core/]select?qt=name  If no qt is
+       given, then the requestHandler that declares default="true" will be
+       used or the one named "standard".
+
+       If a Request Handler is declared with startup="lazy", then it will
+       not be initialized until the first request that uses it.
+
+    --&gt;
+
+  &lt;requestHandler name="/dataimport" class="solr.DataImportHandler"&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="config"&gt;solr-data-config.xml&lt;/str&gt;
+    &lt;/lst&gt;
+  &lt;/requestHandler&gt;
+
+  &lt;!-- SearchHandler
+
+       http://wiki.apache.org/solr/SearchHandler
+
+       For processing Search Queries, the primary Request Handler
+       provided with Solr is "SearchHandler" It delegates to a sequent
+       of SearchComponents (see below) and supports distributed
+       queries across multiple shards
+    --&gt;
+  &lt;requestHandler name="/select" class="solr.SearchHandler"&gt;
+    &lt;!-- default values for query parameters can be specified, these
+         will be overridden by parameters in the request
+      --&gt;
+     &lt;lst name="defaults"&gt;
+       &lt;str name="echoParams"&gt;explicit&lt;/str&gt;
+       &lt;int name="rows"&gt;10&lt;/int&gt;
+       &lt;str name="df"&gt;text&lt;/str&gt;
+     &lt;/lst&gt;
+    &lt;!-- In addition to defaults, "appends" params can be specified
+         to identify values which should be appended to the list of
+         multi-val params from the query (or the existing "defaults").
+      --&gt;
+    &lt;!-- In this example, the param "fq=instock:true" would be appended to
+         any query time fq params the user may specify, as a mechanism for
+         partitioning the index, independent of any user selected filtering
+         that may also be desired (perhaps as a result of faceted searching).
+
+         NOTE: there is *absolutely* nothing a client can do to prevent these
+         "appends" values from being used, so don't use this mechanism
+         unless you are sure you always want it.
+      --&gt;
+    &lt;!--
+       &lt;lst name="appends"&gt;
+         &lt;str name="fq"&gt;inStock:true&lt;/str&gt;
+       &lt;/lst&gt;
+      --&gt;
+    &lt;!-- "invariants" are a way of letting the Solr maintainer lock down
+         the options available to Solr clients.  Any params values
+         specified here are used regardless of what values may be specified
+         in either the query, the "defaults", or the "appends" params.
+
+         In this example, the facet.field and facet.query params would
+         be fixed, limiting the facets clients can use.  Faceting is
+         not turned on by default - but if the client does specify
+         facet=true in the request, these are the only facets they
+         will be able to see counts for; regardless of what other
+         facet.field or facet.query params they may specify.
+
+         NOTE: there is *absolutely* nothing a client can do to prevent these
+         "invariants" values from being used, so don't use this mechanism
+         unless you are sure you always want it.
+      --&gt;
+    &lt;!--
+       &lt;lst name="invariants"&gt;
+         &lt;str name="facet.field"&gt;cat&lt;/str&gt;
+         &lt;str name="facet.field"&gt;manu_exact&lt;/str&gt;
+         &lt;str name="facet.query"&gt;price:[* TO 500]&lt;/str&gt;
+         &lt;str name="facet.query"&gt;price:[500 TO *]&lt;/str&gt;
+       &lt;/lst&gt;
+      --&gt;
+    &lt;!-- If the default list of SearchComponents is not desired, that
+         list can either be overridden completely, or components can be
+         prepended or appended to the default list.  (see below)
+      --&gt;
+    &lt;!--
+       &lt;arr name="components"&gt;
+         &lt;str&gt;nameOfCustomComponent1&lt;/str&gt;
+         &lt;str&gt;nameOfCustomComponent2&lt;/str&gt;
+       &lt;/arr&gt;
+      --&gt;
+    &lt;/requestHandler&gt;
+
+  &lt;!-- A request handler that returns indented JSON by default --&gt;
+  &lt;requestHandler name="/query" class="solr.SearchHandler"&gt;
+     &lt;lst name="defaults"&gt;
+       &lt;str name="echoParams"&gt;explicit&lt;/str&gt;
+       &lt;str name="wt"&gt;json&lt;/str&gt;
+       &lt;str name="indent"&gt;true&lt;/str&gt;
+       &lt;str name="df"&gt;text&lt;/str&gt;
+     &lt;/lst&gt;
+  &lt;/requestHandler&gt;
+
+
+  &lt;!-- realtime get handler, guaranteed to return the latest stored fields of
+       any document, without the need to commit or open a new searcher.  The
+       current implementation relies on the updateLog feature being enabled.
+
+       ** WARNING **
+       Do NOT disable the realtime get handler at /get if you are using
+       SolrCloud otherwise any leader election will cause a full sync in ALL
+       replicas for the shard in question. Similarly, a replica recovery will
+       also always fetch the complete index from the leader because a partial
+       sync will not be possible in the absence of this handler.
+  --&gt;
+  &lt;requestHandler name="/get" class="solr.RealTimeGetHandler"&gt;
+     &lt;lst name="defaults"&gt;
+       &lt;str name="omitHeader"&gt;true&lt;/str&gt;
+       &lt;str name="wt"&gt;json&lt;/str&gt;
+       &lt;str name="indent"&gt;true&lt;/str&gt;
+     &lt;/lst&gt;
+  &lt;/requestHandler&gt;
+
+
+  &lt;!-- A Robust Example
+
+       This example SearchHandler declaration shows off usage of the
+       SearchHandler with many defaults declared
+
+       Note that multiple instances of the same Request Handler
+       (SearchHandler) can be registered multiple times with different
+       names (and different init parameters)
+    --&gt;
+  &lt;requestHandler name="/browse" class="solr.SearchHandler"&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="echoParams"&gt;explicit&lt;/str&gt;
+
+      &lt;!-- VelocityResponseWriter settings --&gt;
+      &lt;str name="wt"&gt;velocity&lt;/str&gt;
+      &lt;str name="v.template"&gt;browse&lt;/str&gt;
+      &lt;str name="v.layout"&gt;layout&lt;/str&gt;
+
+      &lt;!-- Query settings --&gt;
+      &lt;str name="defType"&gt;edismax&lt;/str&gt;
+      &lt;str name="q.alt"&gt;*:*&lt;/str&gt;
+      &lt;str name="rows"&gt;10&lt;/str&gt;
+      &lt;str name="fl"&gt;*,score&lt;/str&gt;
+
+      &lt;!-- Faceting defaults --&gt;
+      &lt;str name="facet"&gt;on&lt;/str&gt;
+      &lt;str name="facet.mincount"&gt;1&lt;/str&gt;
+    &lt;/lst&gt;
+  &lt;/requestHandler&gt;
+
+
+  &lt;initParams path="/update/**,/query,/select,/tvrh,/elevate,/spell,/browse"&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="df"&gt;text&lt;/str&gt;
+      &lt;str name="update.chain"&gt;add-unknown-fields-to-the-schema&lt;/str&gt;
+    &lt;/lst&gt;
+  &lt;/initParams&gt;
+
+  &lt;!-- Update Request Handler.
+       
+       http://wiki.apache.org/solr/UpdateXmlMessages
+
+       The canonical Request Handler for Modifying the Index through
+       commands specified using XML, JSON, CSV, or JAVABIN
+
+       Note: Since solr1.1 requestHandlers requires a valid content
+       type header if posted in the body. For example, curl now
+       requires: -H 'Content-type:text/xml; charset=utf-8'
+       
+       To override the request content type and force a specific 
+       Content-type, use the request parameter: 
+         ?update.contentType=text/csv
+       
+       This handler will pick a response format to match the input
+       if the 'wt' parameter is not explicit
+    --&gt;
+  &lt;requestHandler name="/update" class="solr.UpdateRequestHandler"&gt;
+    &lt;!-- See below for information on defining 
+         updateRequestProcessorChains that can be used by name 
+         on each Update Request
+      --&gt;
+    &lt;!--
+       &lt;lst name="defaults"&gt;
+         &lt;str name="update.chain"&gt;dedupe&lt;/str&gt;
+       &lt;/lst&gt;
+       --&gt;
+  &lt;/requestHandler&gt;
+
+  &lt;!-- Solr Cell Update Request Handler
+
+       http://wiki.apache.org/solr/ExtractingRequestHandler 
+
+    --&gt;
+  &lt;requestHandler name="/update/extract" 
+                  startup="lazy"
+                  class="solr.extraction.ExtractingRequestHandler" &gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="lowernames"&gt;true&lt;/str&gt;
+      &lt;str name="uprefix"&gt;ignored_&lt;/str&gt;
+
+      &lt;!-- capture link hrefs but ignore div attributes --&gt;
+      &lt;str name="captureAttr"&gt;true&lt;/str&gt;
+      &lt;str name="fmap.a"&gt;links&lt;/str&gt;
+      &lt;str name="fmap.div"&gt;ignored_&lt;/str&gt;
+    &lt;/lst&gt;
+  &lt;/requestHandler&gt;
+
+
+  &lt;!-- Field Analysis Request Handler
+
+       RequestHandler that provides much the same functionality as
+       analysis.jsp. Provides the ability to specify multiple field
+       types and field names in the same request and outputs
+       index-time and query-time analysis for each of them.
+
+       Request parameters are:
+       analysis.fieldname - field name whose analyzers are to be used
+
+       analysis.fieldtype - field type whose analyzers are to be used
+       analysis.fieldvalue - text for index-time analysis
+       q (or analysis.q) - text for query time analysis
+       analysis.showmatch (true|false) - When set to true and when
+           query analysis is performed, the produced tokens of the
+           field value analysis will be marked as "matched" for every
+           token that is produces by the query analysis
+   --&gt;
+  &lt;requestHandler name="/analysis/field" 
+                  startup="lazy"
+                  class="solr.FieldAnalysisRequestHandler" /&gt;
+
+
+  &lt;!-- Document Analysis Handler
+
+       http://wiki.apache.org/solr/AnalysisRequestHandler
+
+       An analysis handler that provides a breakdown of the analysis
+       process of provided documents. This handler expects a (single)
+       content stream with the following format:
+
+       &lt;docs&gt;
+         &lt;doc&gt;
+           &lt;field name="id"&gt;1&lt;/field&gt;
+           &lt;field name="name"&gt;The Name&lt;/field&gt;
+           &lt;field name="text"&gt;The Text Value&lt;/field&gt;
+         &lt;/doc&gt;
+         &lt;doc&gt;...&lt;/doc&gt;
+         &lt;doc&gt;...&lt;/doc&gt;
+         ...
+       &lt;/docs&gt;
+
+    Note: Each document must contain a field which serves as the
+    unique key. This key is used in the returned response to associate
+    an analysis breakdown to the analyzed document.
+
+    Like the FieldAnalysisRequestHandler, this handler also supports
+    query analysis by sending either an "analysis.query" or "q"
+    request parameter that holds the query text to be analyzed. It
+    also supports the "analysis.showmatch" parameter which when set to
+    true, all field tokens that match the query tokens will be marked
+    as a "match". 
+  --&gt;
+  &lt;requestHandler name="/analysis/document" 
+                  class="solr.DocumentAnalysisRequestHandler" 
+                  startup="lazy" /&gt;
+
+  &lt;!-- Admin Handlers
+
+       Admin Handlers - This will register all the standard admin
+       RequestHandlers.  
+    --&gt;
+  &lt;requestHandler name="/admin/" 
+                  class="solr.admin.AdminHandlers" /&gt;
+  &lt;!-- This single handler is equivalent to the following... --&gt;
+  &lt;!--
+     &lt;requestHandler name="/admin/luke"       class="solr.admin.LukeRequestHandler" /&gt;
+     &lt;requestHandler name="/admin/system"     class="solr.admin.SystemInfoHandler" /&gt;
+     &lt;requestHandler name="/admin/plugins"    class="solr.admin.PluginInfoHandler" /&gt;
+     &lt;requestHandler name="/admin/threads"    class="solr.admin.ThreadDumpHandler" /&gt;
+     &lt;requestHandler name="/admin/properties" class="solr.admin.PropertiesRequestHandler" /&gt;
+     &lt;requestHandler name="/admin/file"       class="solr.admin.ShowFileRequestHandler" &gt;
+    --&gt;
+  &lt;!-- If you wish to hide files under ${solr.home}/conf, explicitly
+       register the ShowFileRequestHandler using the definition below. 
+       NOTE: The glob pattern ('*') is the only pattern supported at present, *.xml will
+             not exclude all files ending in '.xml'. Use it to exclude _all_ updates
+    --&gt;
+  &lt;!--
+     &lt;requestHandler name="/admin/file" 
+                     class="solr.admin.ShowFileRequestHandler" &gt;
+       &lt;lst name="invariants"&gt;
+         &lt;str name="hidden"&gt;synonyms.txt&lt;/str&gt; 
+         &lt;str name="hidden"&gt;anotherfile.txt&lt;/str&gt; 
+         &lt;str name="hidden"&gt;*&lt;/str&gt; 
+       &lt;/lst&gt;
+     &lt;/requestHandler&gt;
+    --&gt;
+
+  &lt;!--
+    Enabling this request handler (which is NOT a default part of the admin handler) will allow the Solr UI to edit
+    all the config files. This is intended for secure/development use ONLY! Leaving available and publically
+    accessible is a security vulnerability and should be done with extreme caution!
+  --&gt;
+  &lt;!--
+  &lt;requestHandler name="/admin/fileedit" class="solr.admin.EditFileRequestHandler" &gt;
+    &lt;lst name="invariants"&gt;
+         &lt;str name="hidden"&gt;synonyms.txt&lt;/str&gt;
+         &lt;str name="hidden"&gt;anotherfile.txt&lt;/str&gt;
+    &lt;/lst&gt;
+  &lt;/requestHandler&gt;
+  --&gt;
+  &lt;!-- ping/healthcheck --&gt;
+  &lt;requestHandler name="/admin/ping" class="solr.PingRequestHandler"&gt;
+    &lt;lst name="invariants"&gt;
+      &lt;str name="q"&gt;solrpingquery&lt;/str&gt;
+    &lt;/lst&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="echoParams"&gt;all&lt;/str&gt;
+    &lt;/lst&gt;
+    &lt;!-- An optional feature of the PingRequestHandler is to configure the 
+         handler with a "healthcheckFile" which can be used to enable/disable 
+         the PingRequestHandler.
+         relative paths are resolved against the data dir 
+      --&gt;
+    &lt;!-- &lt;str name="healthcheckFile"&gt;server-enabled.txt&lt;/str&gt; --&gt;
+  &lt;/requestHandler&gt;
+
+  &lt;!-- Echo the request contents back to the client --&gt;
+  &lt;requestHandler name="/debug/dump" class="solr.DumpRequestHandler" &gt;
+    &lt;lst name="defaults"&gt;
+     &lt;str name="echoParams"&gt;explicit&lt;/str&gt; 
+     &lt;str name="echoHandler"&gt;true&lt;/str&gt;
+    &lt;/lst&gt;
+  &lt;/requestHandler&gt;
+  
+  &lt;!-- Solr Replication
+
+       The SolrReplicationHandler supports replicating indexes from a
+       "master" used for indexing and "slaves" used for queries.
+
+       http://wiki.apache.org/solr/SolrReplication 
+
+       It is also necessary for SolrCloud to function (in Cloud mode, the
+       replication handler is used to bulk transfer segments when nodes 
+       are added or need to recover).
+
+       https://wiki.apache.org/solr/SolrCloud/
+    --&gt;
+  &lt;requestHandler name="/replication" class="solr.ReplicationHandler" &gt; 
+    &lt;!--
+       To enable simple master/slave replication, uncomment one of the 
+       sections below, depending on whether this solr instance should be
+       the "master" or a "slave".  If this instance is a "slave" you will 
+       also need to fill in the masterUrl to point to a real machine.
+    --&gt;
+    &lt;!--
+       &lt;lst name="master"&gt;
+         &lt;str name="replicateAfter"&gt;commit&lt;/str&gt;
+         &lt;str name="replicateAfter"&gt;startup&lt;/str&gt;
+         &lt;str name="confFiles"&gt;schema.xml,stopwords.txt&lt;/str&gt;
+       &lt;/lst&gt;
+    --&gt;
+    &lt;!--
+       &lt;lst name="slave"&gt;
+         &lt;str name="masterUrl"&gt;http://your-master-hostname:8983/solr&lt;/str&gt;
+         &lt;str name="pollInterval"&gt;00:00:60&lt;/str&gt;
+       &lt;/lst&gt;
+    --&gt;
+  &lt;/requestHandler&gt;
+
+  &lt;!-- Search Components
+
+       Search components are registered to SolrCore and used by 
+       instances of SearchHandler (which can access them by name)
+       
+       By default, the following components are available:
+       
+       &lt;searchComponent name="query"     class="solr.QueryComponent" /&gt;
+       &lt;searchComponent name="facet"     class="solr.FacetComponent" /&gt;
+       &lt;searchComponent name="mlt"       class="solr.MoreLikeThisComponent" /&gt;
+       &lt;searchComponent name="highlight" class="solr.HighlightComponent" /&gt;
+       &lt;searchComponent name="stats"     class="solr.StatsComponent" /&gt;
+       &lt;searchComponent name="debug"     class="solr.DebugComponent" /&gt;
+   
+       Default configuration in a requestHandler would look like:
+
+       &lt;arr name="components"&gt;
+         &lt;str&gt;query&lt;/str&gt;
+         &lt;str&gt;facet&lt;/str&gt;
+         &lt;str&gt;mlt&lt;/str&gt;
+         &lt;str&gt;highlight&lt;/str&gt;
+         &lt;str&gt;stats&lt;/str&gt;
+         &lt;str&gt;debug&lt;/str&gt;
+       &lt;/arr&gt;
+
+       If you register a searchComponent to one of the standard names, 
+       that will be used instead of the default.
+
+       To insert components before or after the 'standard' components, use:
+    
+       &lt;arr name="first-components"&gt;
+         &lt;str&gt;myFirstComponentName&lt;/str&gt;
+       &lt;/arr&gt;
+    
+       &lt;arr name="last-components"&gt;
+         &lt;str&gt;myLastComponentName&lt;/str&gt;
+       &lt;/arr&gt;
+
+       NOTE: The component registered with the name "debug" will
+       always be executed after the "last-components" 
+       
+     --&gt;
+  
+   &lt;!-- Spell Check
+
+        The spell check component can return a list of alternative spelling
+        suggestions.  
+
+        http://wiki.apache.org/solr/SpellCheckComponent
+     --&gt;
+  &lt;searchComponent name="spellcheck" class="solr.SpellCheckComponent"&gt;
+
+    &lt;str name="queryAnalyzerFieldType"&gt;key_lower_case&lt;/str&gt;
+
+    &lt;!-- Multiple "Spell Checkers" can be declared and used by this
+         component
+      --&gt;
+
+    &lt;!-- a spellchecker built from a field of the main index --&gt;
+    &lt;lst name="spellchecker"&gt;
+      &lt;str name="name"&gt;default&lt;/str&gt;
+      &lt;str name="field"&gt;text&lt;/str&gt;
+      &lt;str name="classname"&gt;solr.DirectSolrSpellChecker&lt;/str&gt;
+      &lt;!-- the spellcheck distance measure used, the default is the internal levenshtein --&gt;
+      &lt;str name="distanceMeasure"&gt;internal&lt;/str&gt;
+      &lt;!-- minimum accuracy needed to be considered a valid spellcheck suggestion --&gt;
+      &lt;float name="accuracy"&gt;0.5&lt;/float&gt;
+      &lt;!-- the maximum #edits we consider when enumerating terms: can be 1 or 2 --&gt;
+      &lt;int name="maxEdits"&gt;2&lt;/int&gt;
+      &lt;!-- the minimum shared prefix when enumerating terms --&gt;
+      &lt;int name="minPrefix"&gt;1&lt;/int&gt;
+      &lt;!-- maximum number of inspections per result. --&gt;
+      &lt;int name="maxInspections"&gt;5&lt;/int&gt;
+      &lt;!-- minimum length of a query term to be considered for correction --&gt;
+      &lt;int name="minQueryLength"&gt;4&lt;/int&gt;
+      &lt;!-- maximum threshold of documents a query term can appear to be considered for correction --&gt;
+      &lt;float name="maxQueryFrequency"&gt;0.01&lt;/float&gt;
+      &lt;!-- uncomment this to require suggestions to occur in 1% of the documents
+      	&lt;float name="thresholdTokenFrequency"&gt;.01&lt;/float&gt;
+      --&gt;
+    &lt;/lst&gt;
+    
+    &lt;!-- a spellchecker that can break or combine words.  See "/spell" handler below for usage --&gt;
+    &lt;lst name="spellchecker"&gt;
+      &lt;str name="name"&gt;wordbreak&lt;/str&gt;
+      &lt;str name="classname"&gt;solr.WordBreakSolrSpellChecker&lt;/str&gt;      
+      &lt;str name="field"&gt;name&lt;/str&gt;
+      &lt;str name="combineWords"&gt;true&lt;/str&gt;
+      &lt;str name="breakWords"&gt;true&lt;/str&gt;
+      &lt;int name="maxChanges"&gt;10&lt;/int&gt;
+    &lt;/lst&gt;
+
+    &lt;!-- a spellchecker that uses a different distance measure --&gt;
+    &lt;!--
+       &lt;lst name="spellchecker"&gt;
+         &lt;str name="name"&gt;jarowinkler&lt;/str&gt;
+         &lt;str name="field"&gt;spell&lt;/str&gt;
+         &lt;str name="classname"&gt;solr.DirectSolrSpellChecker&lt;/str&gt;
+         &lt;str name="distanceMeasure"&gt;
+           org.apache.lucene.search.spell.JaroWinklerDistance
+         &lt;/str&gt;
+       &lt;/lst&gt;
+     --&gt;
+
+    &lt;!-- a spellchecker that use an alternate comparator 
+
+         comparatorClass be one of:
+          1. score (default)
+          2. freq (Frequency first, then score)
+          3. A fully qualified class name
+      --&gt;
+    &lt;!--
+       &lt;lst name="spellchecker"&gt;
+         &lt;str name="name"&gt;freq&lt;/str&gt;
+         &lt;str name="field"&gt;lowerfilt&lt;/str&gt;
+         &lt;str name="classname"&gt;solr.DirectSolrSpellChecker&lt;/str&gt;
+         &lt;str name="comparatorClass"&gt;freq&lt;/str&gt;
+      --&gt;
+
+    &lt;!-- A spellchecker that reads the list of words from a file --&gt;
+    &lt;!--
+       &lt;lst name="spellchecker"&gt;
+         &lt;str name="classname"&gt;solr.FileBasedSpellChecker&lt;/str&gt;
+         &lt;str name="name"&gt;file&lt;/str&gt;
+         &lt;str name="sourceLocation"&gt;spellings.txt&lt;/str&gt;
+         &lt;str name="characterEncoding"&gt;UTF-8&lt;/str&gt;
+         &lt;str name="spellcheckIndexDir"&gt;spellcheckerFile&lt;/str&gt;
+       &lt;/lst&gt;
+      --&gt;
+  &lt;/searchComponent&gt;
+  
+  &lt;!-- A request handler for demonstrating the spellcheck component.  
+
+       NOTE: This is purely as an example.  The whole purpose of the
+       SpellCheckComponent is to hook it into the request handler that
+       handles your normal user queries so that a separate request is
+       not needed to get suggestions.
+
+       IN OTHER WORDS, THERE IS REALLY GOOD CHANCE THE SETUP BELOW IS
+       NOT WHAT YOU WANT FOR YOUR PRODUCTION SYSTEM!
+       
+       See http://wiki.apache.org/solr/SpellCheckComponent for details
+       on the request parameters.
+    --&gt;
+  &lt;requestHandler name="/spell" class="solr.SearchHandler" startup="lazy"&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="df"&gt;text&lt;/str&gt;
+      &lt;!-- Solr will use suggestions from both the 'default' spellchecker
+           and from the 'wordbreak' spellchecker and combine them.
+           collations (re-written queries) can include a combination of
+           corrections from both spellcheckers --&gt;
+      &lt;str name="spellcheck.dictionary"&gt;default&lt;/str&gt;
+      &lt;str name="spellcheck.dictionary"&gt;wordbreak&lt;/str&gt;
+      &lt;str name="spellcheck"&gt;on&lt;/str&gt;
+      &lt;str name="spellcheck.extendedResults"&gt;true&lt;/str&gt;       
+      &lt;str name="spellcheck.count"&gt;10&lt;/str&gt;
+      &lt;str name="spellcheck.alternativeTermCount"&gt;5&lt;/str&gt;
+      &lt;str name="spellcheck.maxResultsForSuggest"&gt;5&lt;/str&gt;       
+      &lt;str name="spellcheck.collate"&gt;true&lt;/str&gt;
+      &lt;str name="spellcheck.collateExtendedResults"&gt;true&lt;/str&gt;  
+      &lt;str name="spellcheck.maxCollationTries"&gt;10&lt;/str&gt;
+      &lt;str name="spellcheck.maxCollations"&gt;5&lt;/str&gt;         
+    &lt;/lst&gt;
+    &lt;arr name="last-components"&gt;
+      &lt;str&gt;spellcheck&lt;/str&gt;
+    &lt;/arr&gt;
+  &lt;/requestHandler&gt;
+
+  &lt;searchComponent name="suggest" class="solr.SuggestComponent"&gt;
+  	&lt;lst name="suggester"&gt;
+      &lt;str name="name"&gt;mySuggester&lt;/str&gt;
+      &lt;str name="lookupImpl"&gt;FuzzyLookupFactory&lt;/str&gt;      &lt;!-- org.apache.solr.spelling.suggest.fst --&gt;
+      &lt;str name="dictionaryImpl"&gt;DocumentDictionaryFactory&lt;/str&gt;     &lt;!-- org.apache.solr.spelling.suggest.HighFrequencyDictionaryFactory --&gt; 
+      &lt;str name="field"&gt;cat&lt;/str&gt;
+      &lt;str name="weightField"&gt;price&lt;/str&gt;
+      &lt;str name="suggestAnalyzerFieldType"&gt;string&lt;/str&gt;
+    &lt;/lst&gt;
+  &lt;/searchComponent&gt;
+
+  &lt;requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy"&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="suggest"&gt;true&lt;/str&gt;
+      &lt;str name="suggest.count"&gt;10&lt;/str&gt;
+    &lt;/lst&gt;
+    &lt;arr name="components"&gt;
+      &lt;str&gt;suggest&lt;/str&gt;
+    &lt;/arr&gt;
+  &lt;/requestHandler&gt;
+  &lt;!-- Term Vector Component
+
+       http://wiki.apache.org/solr/TermVectorComponent
+    --&gt;
+  &lt;searchComponent name="tvComponent" class="solr.TermVectorComponent"/&gt;
+
+  &lt;!-- A request handler for demonstrating the term vector component
+
+       This is purely as an example.
+
+       In reality you will likely want to add the component to your 
+       already specified request handlers. 
+    --&gt;
+  &lt;requestHandler name="/tvrh" class="solr.SearchHandler" startup="lazy"&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="df"&gt;text&lt;/str&gt;
+      &lt;bool name="tv"&gt;true&lt;/bool&gt;
+    &lt;/lst&gt;
+    &lt;arr name="last-components"&gt;
+      &lt;str&gt;tvComponent&lt;/str&gt;
+    &lt;/arr&gt;
+  &lt;/requestHandler&gt;
+
+  &lt;!-- Clustering Component
+
+       You'll need to set the solr.clustering.enabled system property
+       when running solr to run with clustering enabled:
+
+            java -Dsolr.clustering.enabled=true -jar start.jar
+
+       http://wiki.apache.org/solr/ClusteringComponent
+       http://carrot2.github.io/solr-integration-strategies/
+    --&gt;
+  &lt;searchComponent name="clustering"
+                   enable="${solr.clustering.enabled:false}"
+                   class="solr.clustering.ClusteringComponent" &gt;
+    &lt;lst name="engine"&gt;
+      &lt;str name="name"&gt;lingo&lt;/str&gt;
+
+      &lt;!-- Class name of a clustering algorithm compatible with the Carrot2 framework.
+
+           Currently available open source algorithms are:
+           * org.carrot2.clustering.lingo.LingoClusteringAlgorithm
+           * org.carrot2.clustering.stc.STCClusteringAlgorithm
+           * org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm
+
+           See http://project.carrot2.org/algorithms.html for more information.
+
+           A commercial algorithm Lingo3G (needs to be installed separately) is defined as:
+           * com.carrotsearch.lingo3g.Lingo3GClusteringAlgorithm
+        --&gt;
+      &lt;str name="carrot.algorithm"&gt;org.carrot2.clustering.lingo.LingoClusteringAlgorithm&lt;/str&gt;
+
+      &lt;!-- Override location of the clustering algorithm's resources 
+           (attribute definitions and lexical resources).
+
+           A directory from which to load algorithm-specific stop words,
+           stop labels and attribute definition XMLs. 
+
+           For an overview of Carrot2 lexical resources, see:
+           http://download.carrot2.org/head/manual/#chapter.lexical-resources
+
+           For an overview of Lingo3G lexical resources, see:
+           http://download.carrotsearch.com/lingo3g/manual/#chapter.lexical-resources
+       --&gt;
+      &lt;str name="carrot.resourcesDir"&gt;clustering/carrot2&lt;/str&gt;
+    &lt;/lst&gt;
+
+    &lt;!-- An example definition for the STC clustering algorithm. --&gt;
+    &lt;lst name="engine"&gt;
+      &lt;str name="name"&gt;stc&lt;/str&gt;
+      &lt;str name="carrot.algorithm"&gt;org.carrot2.clustering.stc.STCClusteringAlgorithm&lt;/str&gt;
+    &lt;/lst&gt;
+
+    &lt;!-- An example definition for the bisecting kmeans clustering algorithm. --&gt;
+    &lt;lst name="engine"&gt;
+      &lt;str name="name"&gt;kmeans&lt;/str&gt;
+      &lt;str name="carrot.algorithm"&gt;org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm&lt;/str&gt;
+    &lt;/lst&gt;
+  &lt;/searchComponent&gt;
+
+  &lt;!-- A request handler for demonstrating the clustering component
+
+       This is purely as an example.
+
+       In reality you will likely want to add the component to your 
+       already specified request handlers. 
+    --&gt;
+  &lt;requestHandler name="/clustering"
+                  startup="lazy"
+                  enable="${solr.clustering.enabled:false}"
+                  class="solr.SearchHandler"&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;bool name="clustering"&gt;true&lt;/bool&gt;
+      &lt;bool name="clustering.results"&gt;true&lt;/bool&gt;
+      &lt;!-- Field name with the logical "title" of a each document (optional) --&gt;
+      &lt;str name="carrot.title"&gt;name&lt;/str&gt;
+      &lt;!-- Field name with the logical "URL" of a each document (optional) --&gt;
+      &lt;str name="carrot.url"&gt;id&lt;/str&gt;
+      &lt;!-- Field name with the logical "content" of a each document (optional) --&gt;
+      &lt;str name="carrot.snippet"&gt;features&lt;/str&gt;
+      &lt;!-- Apply highlighter to the title/ content and use this for clustering. --&gt;
+      &lt;bool name="carrot.produceSummary"&gt;true&lt;/bool&gt;
+      &lt;!-- the maximum number of labels per cluster --&gt;
+      &lt;!--&lt;int name="carrot.numDescriptions"&gt;5&lt;/int&gt;--&gt;
+      &lt;!-- produce sub clusters --&gt;
+      &lt;bool name="carrot.outputSubClusters"&gt;false&lt;/bool&gt;
+
+      &lt;!-- Configure the remaining request handler parameters. --&gt;
+      &lt;str name="defType"&gt;edismax&lt;/str&gt;
+      &lt;str name="qf"&gt;
+        text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
+      &lt;/str&gt;
+      &lt;str name="q.alt"&gt;*:*&lt;/str&gt;
+      &lt;str name="rows"&gt;10&lt;/str&gt;
+      &lt;str name="fl"&gt;*,score&lt;/str&gt;
+    &lt;/lst&gt;
+    &lt;arr name="last-components"&gt;
+      &lt;str&gt;clustering&lt;/str&gt;
+    &lt;/arr&gt;
+  &lt;/requestHandler&gt;
+  
+  &lt;!-- Terms Component
+
+       http://wiki.apache.org/solr/TermsComponent
+
+       A component to return terms and document frequency of those
+       terms
+    --&gt;
+  &lt;searchComponent name="terms" class="solr.TermsComponent"/&gt;
+
+  &lt;!-- A request handler for demonstrating the terms component --&gt;
+  &lt;requestHandler name="/terms" class="solr.SearchHandler" startup="lazy"&gt;
+     &lt;lst name="defaults"&gt;
+      &lt;bool name="terms"&gt;true&lt;/bool&gt;
+      &lt;bool name="distrib"&gt;false&lt;/bool&gt;
+    &lt;/lst&gt;     
+    &lt;arr name="components"&gt;
+      &lt;str&gt;terms&lt;/str&gt;
+    &lt;/arr&gt;
+  &lt;/requestHandler&gt;
+
+
+  &lt;!-- Query Elevation Component
+
+       http://wiki.apache.org/solr/QueryElevationComponent
+
+       a search component that enables you to configure the top
+       results for a given query regardless of the normal lucene
+       scoring.
+    --&gt;
+  &lt;searchComponent name="elevator" class="solr.QueryElevationComponent" &gt;
+    &lt;!-- pick a fieldType to analyze queries --&gt;
+    &lt;str name="queryFieldType"&gt;string&lt;/str&gt;
+    &lt;str name="config-file"&gt;elevate.xml&lt;/str&gt;
+  &lt;/searchComponent&gt;
+
+  &lt;!-- A request handler for demonstrating the elevator component --&gt;
+  &lt;requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy"&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="echoParams"&gt;explicit&lt;/str&gt;
+      &lt;str name="df"&gt;text&lt;/str&gt;
+    &lt;/lst&gt;
+    &lt;arr name="last-components"&gt;
+      &lt;str&gt;elevator&lt;/str&gt;
+    &lt;/arr&gt;
+  &lt;/requestHandler&gt;
+
+  &lt;!-- Highlighting Component
+
+       http://wiki.apache.org/solr/HighlightingParameters
+    --&gt;
+  &lt;searchComponent class="solr.HighlightComponent" name="highlight"&gt;
+    &lt;highlighting&gt;
+      &lt;!-- Configure the standard fragmenter --&gt;
+      &lt;!-- This could most likely be commented out in the "default" case --&gt;
+      &lt;fragmenter name="gap" 
+                  default="true"
+                  class="solr.highlight.GapFragmenter"&gt;
+        &lt;lst name="defaults"&gt;
+          &lt;int name="hl.fragsize"&gt;100&lt;/int&gt;
+        &lt;/lst&gt;
+      &lt;/fragmenter&gt;
+
+      &lt;!-- A regular-expression-based fragmenter 
+           (for sentence extraction) 
+        --&gt;
+      &lt;fragmenter name="regex" 
+                  class="solr.highlight.RegexFragmenter"&gt;
+        &lt;lst name="defaults"&gt;
+          &lt;!-- slightly smaller fragsizes work better because of slop --&gt;
+          &lt;int name="hl.fragsize"&gt;70&lt;/int&gt;
+          &lt;!-- allow 50% slop on fragment sizes --&gt;
+          &lt;float name="hl.regex.slop"&gt;0.5&lt;/float&gt;
+          &lt;!-- a basic sentence pattern --&gt;
+          &lt;str name="hl.regex.pattern"&gt;[-\w ,/\n\&amp;quot;&amp;apos;]{20,200}&lt;/str&gt;
+        &lt;/lst&gt;
+      &lt;/fragmenter&gt;
+
+      &lt;!-- Configure the standard formatter --&gt;
+      &lt;formatter name="html" 
+                 default="true"
+                 class="solr.highlight.HtmlFormatter"&gt;
+        &lt;lst name="defaults"&gt;
+          &lt;str name="hl.simple.pre"&gt;&lt;![CDATA[&lt;em&gt;]]&gt;&lt;/str&gt;
+          &lt;str name="hl.simple.post"&gt;&lt;![CDATA[&lt;/em&gt;]]&gt;&lt;/str&gt;
+        &lt;/lst&gt;
+      &lt;/formatter&gt;
+
+      &lt;!-- Configure the standard encoder --&gt;
+      &lt;encoder name="html" 
+               class="solr.highlight.HtmlEncoder" /&gt;
+
+      &lt;!-- Configure the standard fragListBuilder --&gt;
+      &lt;fragListBuilder name="simple" 
+                       class="solr.highlight.SimpleFragListBuilder"/&gt;
+      
+      &lt;!-- Configure the single fragListBuilder --&gt;
+      &lt;fragListBuilder name="single" 
+                       class="solr.highlight.SingleFragListBuilder"/&gt;
+      
+      &lt;!-- Configure the weighted fragListBuilder --&gt;
+      &lt;fragListBuilder name="weighted" 
+                       default="true"
+                       class="solr.highlight.WeightedFragListBuilder"/&gt;
+      
+      &lt;!-- default tag FragmentsBuilder --&gt;
+      &lt;fragmentsBuilder name="default" 
+                        default="true"
+                        class="solr.highlight.ScoreOrderFragmentsBuilder"&gt;
+        &lt;!-- 
+        &lt;lst name="defaults"&gt;
+          &lt;str name="hl.multiValuedSeparatorChar"&gt;/&lt;/str&gt;
+        &lt;/lst&gt;
+        --&gt;
+      &lt;/fragmentsBuilder&gt;
+
+      &lt;!-- multi-colored tag FragmentsBuilder --&gt;
+      &lt;fragmentsBuilder name="colored" 
+                        class="solr.highlight.ScoreOrderFragmentsBuilder"&gt;
+        &lt;lst name="defaults"&gt;
+          &lt;str name="hl.tag.pre"&gt;&lt;![CDATA[
+               &lt;b style="background:yellow"&gt;,&lt;b style="background:lawgreen"&gt;,
+               &lt;b style="background:aquamarine"&gt;,&lt;b style="background:magenta"&gt;,
+               &lt;b style="background:palegreen"&gt;,&lt;b style="background:coral"&gt;,
+               &lt;b style="background:wheat"&gt;,&lt;b style="background:khaki"&gt;,
+               &lt;b style="background:lime"&gt;,&lt;b style="background:deepskyblue"&gt;]]&gt;&lt;/str&gt;
+          &lt;str name="hl.tag.post"&gt;&lt;![CDATA[&lt;/b&gt;]]&gt;&lt;/str&gt;
+        &lt;/lst&gt;
+      &lt;/fragmentsBuilder&gt;
+      
+      &lt;boundaryScanner name="default" 
+                       default="true"
+                       class="solr.highlight.SimpleBoundaryScanner"&gt;
+        &lt;lst name="defaults"&gt;
+          &lt;str name="hl.bs.maxScan"&gt;10&lt;/str&gt;
+          &lt;str name="hl.bs.chars"&gt;.,!? &amp;#9;&amp;#10;&amp;#13;&lt;/str&gt;
+        &lt;/lst&gt;
+      &lt;/boundaryScanner&gt;
+      
+      &lt;boundaryScanner name="breakIterator" 
+                       class="solr.highlight.BreakIteratorBoundaryScanner"&gt;
+        &lt;lst name="defaults"&gt;
+          &lt;!-- type should be one of CHARACTER, WORD(default), LINE and SENTENCE --&gt;
+          &lt;str name="hl.bs.type"&gt;WORD&lt;/str&gt;
+          &lt;!-- language and country are used when constructing Locale object.  --&gt;
+          &lt;!-- And the Locale object will be used when getting instance of BreakIterator --&gt;
+          &lt;str name="hl.bs.language"&gt;en&lt;/str&gt;
+          &lt;str name="hl.bs.country"&gt;US&lt;/str&gt;
+        &lt;/lst&gt;
+      &lt;/boundaryScanner&gt;
+    &lt;/highlighting&gt;
+  &lt;/searchComponent&gt;
+
+  &lt;!-- Update Processors
+
+       Chains of Update Processor Factories for dealing with Update
+       Requests can be declared, and then used by name in Update
+       Request Processors
+
+       http://wiki.apache.org/solr/UpdateRequestProcessor
+
+    --&gt; 
+
+  &lt;!-- Add unknown fields to the schema 
+  
+       An example field type guessing update processor that will
+       attempt to parse string-typed field values as Booleans, Longs,
+       Doubles, or Dates, and then add schema fields with the guessed
+       field types.  
+       
+       This requires that the schema is both managed and mutable, by
+       declaring schemaFactory as ManagedIndexSchemaFactory, with
+       mutable specified as true. 
+       
+       See http://wiki.apache.org/solr/GuessingFieldTypes
+    --&gt;
+  &lt;updateRequestProcessorChain name="add-unknown-fields-to-the-schema"&gt;
+
+    &lt;processor class="solr.DefaultValueUpdateProcessorFactory"&gt;
+        &lt;str name="fieldName"&gt;_ttl_&lt;/str&gt;
+        &lt;str name="value"&gt;+{{logsearch_service_logs_max_retention}}DAYS&lt;/str&gt;
+    &lt;/processor&gt;
+    &lt;processor class="solr.processor.DocExpirationUpdateProcessorFactory"&gt;
+        &lt;int name="autoDeletePeriodSeconds"&gt;30&lt;/int&gt;
+        &lt;str name="ttlFieldName"&gt;_ttl_&lt;/str&gt;
+        &lt;str name="expirationFieldName"&gt;_expire_at_&lt;/str&gt;
+    &lt;/processor&gt;
+    &lt;processor class="solr.FirstFieldValueUpdateProcessorFactory"&gt;
+      &lt;str name="fieldName"&gt;_expire_at_&lt;/str&gt;
+    &lt;/processor&gt;
+
+
+    &lt;processor class="solr.RemoveBlankFieldUpdateProcessorFactory"/&gt;
+    &lt;processor class="solr.ParseBooleanFieldUpdateProcessorFactory"/&gt;
+    &lt;processor class="solr.ParseLongFieldUpdateProcessorFactory"/&gt;
+    &lt;processor class="solr.ParseDoubleFieldUpdateProcessorFactory"/&gt;
+    &lt;processor class="solr.ParseDateFieldUpdateProcessorFactory"&gt;
+      &lt;arr name="format"&gt;
+        &lt;str&gt;yyyy-MM-dd'T'HH:mm:ss.SSSZ&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd'T'HH:mm:ss,SSSZ&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd'T'HH:mm:ss.SSS&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd'T'HH:mm:ss,SSS&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd'T'HH:mm:ssZ&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd'T'HH:mm:ss&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd'T'HH:mmZ&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd'T'HH:mm&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd HH:mm:ss.SSSZ&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd HH:mm:ss,SSSZ&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd HH:mm:ss.SSS&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd HH:mm:ss,SSS&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd HH:mm:ssZ&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd HH:mm:ss&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd HH:mmZ&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd HH:mm&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd&lt;/str&gt;
+      &lt;/arr&gt;
+    &lt;/processor&gt;
+    &lt;processor class="solr.AddSchemaFieldsUpdateProcessorFactory"&gt;
+      &lt;str name="defaultFieldType"&gt;key_lower_case&lt;/str&gt;
+      &lt;lst name="typeMapping"&gt;
+        &lt;str name="valueClass"&gt;java.lang.Boolean&lt;/str&gt;
+        &lt;str name="fieldType"&gt;booleans&lt;/str&gt;
+      &lt;/lst&gt;
+      &lt;lst name="typeMapping"&gt;
+        &lt;str name="valueClass"&gt;java.util.Date&lt;/str&gt;
+        &lt;str name="fieldType"&gt;tdates&lt;/str&gt;
+      &lt;/lst&gt;
+      &lt;lst name="typeMapping"&gt;
+        &lt;str name="valueClass"&gt;java.lang.Long&lt;/str&gt;
+        &lt;str name="valueClass"&gt;java.lang.Integer&lt;/str&gt;
+        &lt;str name="fieldType"&gt;tlongs&lt;/str&gt;
+      &lt;/lst&gt;
+      &lt;lst name="typeMapping"&gt;
+        &lt;str name="valueClass"&gt;java.lang.Number&lt;/str&gt;
+        &lt;str name="fieldType"&gt;tdoubles&lt;/str&gt;
+      &lt;/lst&gt;
+    &lt;/processor&gt;
+
+    &lt;processor class="solr.LogUpdateProcessorFactory"/&gt;
+    &lt;processor class="solr.RunUpdateProcessorFactory"/&gt;
+  &lt;/updateRequestProcessorChain&gt;
+
+
+  &lt;!-- Deduplication
+
+       An example dedup update processor that creates the "id" field
+       on the fly based on the hash code of some other fields.  This
+       example has overwriteDupes set to false since we are using the
+       id field as the signatureField and Solr will maintain
+       uniqueness based on that anyway.  
+       
+    --&gt;
+  &lt;!--
+     &lt;updateRequestProcessorChain name="dedupe"&gt;
+       &lt;processor class="solr.processor.SignatureUpdateProcessorFactory"&gt;
+         &lt;bool name="enabled"&gt;true&lt;/bool&gt;
+         &lt;str name="signatureField"&gt;id&lt;/str&gt;
+         &lt;bool name="overwriteDupes"&gt;false&lt;/bool&gt;
+         &lt;str name="fields"&gt;name,features,cat&lt;/str&gt;
+         &lt;str name="signatureClass"&gt;solr.processor.Lookup3Signature&lt;/str&gt;
+       &lt;/processor&gt;
+       &lt;processor class="solr.LogUpdateProcessorFactory" /&gt;
+       &lt;processor class="solr.RunUpdateProcessorFactory" /&gt;
+     &lt;/updateRequestProcessorChain&gt;
+    --&gt;
+  
+  &lt;!-- Language identification
+
+       This example update chain identifies the language of the incoming
+       documents using the langid contrib. The detected language is
+       written to field language_s. No field name mapping is done.
+       The fields used for detection are text, title, subject and description,
+       making this example suitable for detecting languages form full-text
+       rich documents injected via ExtractingRequestHandler.
+       See more about langId at http://wiki.apache.org/solr/LanguageDetection
+    --&gt;
+    &lt;!--
+     &lt;updateRequestProcessorChain name="langid"&gt;
+       &lt;processor class="org.apache.solr.update.processor.TikaLanguageIdentifierUpdateProcessorFactory"&gt;
+         &lt;str name="langid.fl"&gt;text,title,subject,description&lt;/str&gt;
+         &lt;str name="langid.langField"&gt;language_s&lt;/str&gt;
+         &lt;str name="langid.fallback"&gt;en&lt;/str&gt;
+       &lt;/processor&gt;
+       &lt;processor class="solr.LogUpdateProcessorFactory" /&gt;
+       &lt;processor class="solr.RunUpdateProcessorFactory" /&gt;
+     &lt;/updateRequestProcessorChain&gt;
+    --&gt;
+
+  &lt;!-- Script update processor
+
+    This example hooks in an update processor implemented using JavaScript.
+
+    See more about the script update processor at http://wiki.apache.org/solr/ScriptUpdateProcessor
+  --&gt;
+  &lt;!--
+    &lt;updateRequestProcessorChain name="script"&gt;
+      &lt;processor class="solr.StatelessScriptUpdateProcessorFactory"&gt;
+        &lt;str name="script"&gt;update-script.js&lt;/str&gt;
+        &lt;lst name="params"&gt;
+          &lt;str name="config_param"&gt;example config parameter&lt;/str&gt;
+        &lt;/lst&gt;
+      &lt;/processor&gt;
+      &lt;processor class="solr.RunUpdateProcessorFactory" /&gt;
+    &lt;/updateRequestProcessorChain&gt;
+  --&gt;
+ 
+  &lt;!-- Response Writers
+
+       http://wiki.apache.org/solr/QueryResponseWriter
+
+       Request responses will be written using the writer specified by
+       the 'wt' request parameter matching the name of a registered
+       writer.
+
+       The "default" writer is the default and will be used if 'wt' is
+       not specified in the request.
+    --&gt;
+  &lt;!-- The following response writers are implicitly configured unless
+       overridden...
+    --&gt;
+  &lt;!--
+     &lt;queryResponseWriter name="xml" 
+                          default="true"
+                          class="solr.XMLResponseWriter" /&gt;
+     &lt;queryResponseWriter name="json" class="solr.JSONResponseWriter"/&gt;
+     &lt;queryResponseWriter name="python" class="solr.PythonResponseWriter"/&gt;
+     &lt;queryResponseWriter name="ruby" class="solr.RubyResponseWriter"/&gt;
+     &lt;queryResponseWriter name="php" class="solr.PHPResponseWriter"/&gt;
+     &lt;queryResponseWriter name="phps" class="solr.PHPSerializedResponseWriter"/&gt;
+     &lt;queryResponseWriter name="csv" class="solr.CSVResponseWriter"/&gt;
+     &lt;queryResponseWriter name="schema.xml" class="solr.SchemaXmlResponseWriter"/&gt;
+    --&gt;
+
+  &lt;queryResponseWriter name="json" class="solr.JSONResponseWriter"&gt;
+     &lt;!-- For the purposes of the tutorial, JSON responses are written as
+      plain text so that they are easy to read in *any* browser.
+      If you expect a MIME type of "application/json" just remove this override.
+     --&gt;
+    &lt;str name="content-type"&gt;text/plain; charset=UTF-8&lt;/str&gt;
+  &lt;/queryResponseWriter&gt;
+  
+  &lt;!--
+     Custom response writers can be declared as needed...
+    --&gt;
+  &lt;queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" startup="lazy"&gt;
+    &lt;str name="template.base.dir"&gt;${velocity.template.base.dir:}&lt;/str&gt;
+  &lt;/queryResponseWriter&gt;
+
+  &lt;!-- XSLT response writer transforms the XML output by any xslt file found
+       in Solr's conf/xslt directory.  Changes to xslt files are checked for
+       every xsltCacheLifetimeSeconds.  
+    --&gt;
+  &lt;queryResponseWriter name="xslt" class="solr.XSLTResponseWriter"&gt;
+    &lt;int name="xsltCacheLifetimeSeconds"&gt;5&lt;/int&gt;
+  &lt;/queryResponseWriter&gt;
+
+  &lt;!-- Query Parsers
+
+       http://wiki.apache.org/solr/SolrQuerySyntax
+
+       Multiple QParserPlugins can be registered by name, and then
+       used in either the "defType" param for the QueryComponent (used
+       by SearchHandler) or in LocalParams
+    --&gt;
+  &lt;!-- example of registering a query parser --&gt;
+  &lt;!--
+     &lt;queryParser name="myparser" class="com.mycompany.MyQParserPlugin"/&gt;
+    --&gt;
+
+  &lt;!-- Function Parsers
+
+       http://wiki.apache.org/solr/FunctionQuery
+
+       Multiple ValueSourceParsers can be registered by name, and then
+       used as function names when using the "func" QParser.
+    --&gt;
+  &lt;!-- example of registering a custom function parser  --&gt;
+  &lt;!--
+     &lt;valueSourceParser name="myfunc" 
+                        class="com.mycompany.MyValueSourceParser" /&gt;
+    --&gt;
+    
+  
+  &lt;!-- Document Transformers
+       http://wiki.apache.org/solr/DocTransformers
+    --&gt;
+  &lt;!--
+     Could be something like:
+     &lt;transformer name="db" class="com.mycompany.LoadFromDatabaseTransformer" &gt;
+       &lt;int name="connection"&gt;jdbc://....&lt;/int&gt;
+     &lt;/transformer&gt;
+     
+     To add a constant value to all docs, use:
+     &lt;transformer name="mytrans2" class="org.apache.solr.response.transform.ValueAugmenterFactory" &gt;
+       &lt;int name="value"&gt;5&lt;/int&gt;
+     &lt;/transformer&gt;
+     
+     If you want the user to still be able to change it with _value:something_ use this:
+     &lt;transformer name="mytrans3" class="org.apache.solr.response.transform.ValueAugmenterFactory" &gt;
+       &lt;double name="defaultValue"&gt;5&lt;/double&gt;
+     &lt;/transformer&gt;
+
+      If you are using the QueryElevationComponent, you may wish to mark documents that get boosted.  The
+      EditorialMarkerFactory will do exactly that:
+     &lt;transformer name="qecBooster" class="org.apache.solr.response.transform.EditorialMarkerFactory" /&gt;
+    --&gt;
+    
+
+  &lt;!-- Legacy config for the admin interface --&gt;
+  &lt;admin&gt;
+    &lt;defaultQuery&gt;*:*&lt;/defaultQuery&gt;
+  &lt;/admin&gt;
+
+&lt;/config&gt;
+    </value>
+  </property>
+
+  
+</configuration>  

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-site.xml b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-site.xml
new file mode 100644
index 0000000..45aa69a
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-site.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * 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.
+ */
+-->
+<configuration>
+
+  <property>
+    <name>logsearch.ui.port</name>
+    <value>61888</value>
+    <description>Default port for LogSearch UI</description>
+    <display-name>Logsearch UI Port</display-name>
+  </property>
+
+  <property>
+    <name>logsearch.collection.numshards</name>
+    <value>5</value>
+    <display-name>Logsearch Solr Shards</display-name>
+    <description>Number of shards for Solr collections</description>
+  </property>
+
+  <property>
+    <name>logsearch.collection.replication.factor</name>
+    <value>1</value>
+    <display-name>Logsearch Solr Replication Factor</display-name>
+    <description>Replication factor for Solr collections</description>
+  </property>
+
+  <property>
+    <name>logsearch.solr.collection.service.logs</name>
+    <value>hadoop_logs</value>
+    <display-name>Logsearch Solr Service Logs Collection</display-name>
+    <description>Name for the service logs collection</description>
+  </property>
+
+  <property>
+    <name>logsearch.solr.collection.audit.logs</name>
+    <value>audit_logs</value>
+    <display-name>Logsearch Solr Audit Logs Collection</display-name>
+    <description>Name for the audit logs collection</description>
+  </property>
+
+  <property>
+    <name>logsearch.service.logs.fields</name>
+    <value>logtime,level,event_count,ip,type,seq_num,path,file,line_number,host,log_message,id</value>
+    <display-name>Logsearch Solr Service Logs Fields</display-name>
+    <description>Solr fields for service logs</description>
+  </property>
+
+  <property>
+    <name>logsearch.service.logs.split.interval.mins</name>
+    <value>15</value>
+    <display-name>Logsearch Service Logs split interval</display-name>
+    <description>Will create multiple collections and use alias. Valid values are single,hour_week</description>
+  </property>
+
+  <property>
+    <name>logsearch.audit.logs.split.interval.mins</name>
+    <value>15</value>
+    <display-name>Logsearch Audit Logs split interval</display-name>
+    <description>Will switch the shard after the interval specified. Valid values are none and greater than 1
+    </description>
+  </property>
+
+</configuration>


[8/8] ambari git commit: AMBARI-15806. Initial commit for Logsearch service stack definition (oleewere)

Posted by ol...@apache.org.
AMBARI-15806. Initial commit for Logsearch service stack definition (oleewere)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f903d17f
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f903d17f
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f903d17f

Branch: refs/heads/trunk
Commit: f903d17f8f8184275357f03586c924c376ad78a1
Parents: a7f0c09
Author: oleewere <ol...@gmail.com>
Authored: Wed Apr 13 14:08:30 2016 +0200
Committer: oleewere <ol...@gmail.com>
Committed: Wed Apr 13 15:01:05 2016 +0200

----------------------------------------------------------------------
 .../libraries/functions/package_conditions.py   |   10 +-
 .../java/org/apache/ambari/server/Role.java     |    3 +
 .../common-services/LOGSEARCH/0.5.0/alerts.json |   62 +
 .../0.5.0/configuration/logfeeder-env.xml       |  118 ++
 .../0.5.0/configuration/logfeeder-log4j.xml     |   79 +
 .../0.5.0/configuration/logfeeder-site.xml      |   87 +
 .../logsearch-audit_logs-solrconfig.xml         | 1928 ++++++++++++++++++
 .../0.5.0/configuration/logsearch-env.xml       |  144 ++
 .../0.5.0/configuration/logsearch-log4j.xml     |  110 +
 .../logsearch-service_logs-solrconfig.xml       | 1928 ++++++++++++++++++
 .../0.5.0/configuration/logsearch-site.xml      |   81 +
 .../0.5.0/configuration/logsearch-solr-env.xml  |  193 ++
 .../configuration/logsearch-solr-log4j.xml      |   57 +
 .../0.5.0/configuration/logsearch-solr-xml.xml  |   41 +
 .../LOGSEARCH/0.5.0/kerberos.json               |   17 +
 .../LOGSEARCH/0.5.0/metainfo.xml                |  123 ++
 .../0.5.0/package/scripts/logfeeder.py          |   65 +
 .../0.5.0/package/scripts/logsearch.py          |   64 +
 .../0.5.0/package/scripts/logsearch_common.py   |   53 +
 .../LOGSEARCH/0.5.0/package/scripts/params.py   |  241 +++
 .../0.5.0/package/scripts/setup_logfeeder.py    |   69 +
 .../0.5.0/package/scripts/setup_logsearch.py    |   97 +
 .../0.5.0/package/scripts/setup_solr.py         |   70 +
 .../LOGSEARCH/0.5.0/package/scripts/solr.py     |   71 +
 .../0.5.0/package/scripts/status_params.py      |   37 +
 .../package/templates/global.config.json.j2     |   28 +
 .../0.5.0/package/templates/grok-patterns.j2    |  144 ++
 .../templates/input.config-accumulo.json.j2     |  105 +
 .../templates/input.config-ambari.json.j2       |   93 +
 .../package/templates/input.config-ams.json.j2  |   92 +
 .../templates/input.config-atlas.json.j2        |   55 +
 .../templates/input.config-falcon.json.j2       |   55 +
 .../templates/input.config-hbase.json.j2        |   62 +
 .../package/templates/input.config-hdfs.json.j2 |  246 +++
 .../package/templates/input.config-hive.json.j2 |   62 +
 .../templates/input.config-kafka.json.j2        |  105 +
 .../package/templates/input.config-knox.json.j2 |   68 +
 .../templates/input.config-logsearch.json.j2    |   68 +
 .../templates/input.config-oozie.json.j2        |   56 +
 .../templates/input.config-ranger.json.j2       |  122 ++
 .../templates/input.config-storm.json.j2        |   86 +
 .../package/templates/input.config-yarn.json.j2 |   86 +
 .../templates/input.config-zookeeper.json.j2    |   56 +
 .../package/templates/logfeeder.properties.j2   |   18 +
 .../package/templates/logsearch.properties.j2   |   40 +
 .../package/templates/output.config.json.j2     |   97 +
 .../0.5.0/package/templates/zoo.cfg.j2          |   21 +
 .../LOGSEARCH/0.5.0/quicklinks/quicklinks.json  |   26 +
 .../stacks/HDP/2.2/upgrades/upgrade-2.3.xml     |    3 +
 .../stacks/HDP/2.2/upgrades/upgrade-2.4.xml     |    3 +
 .../HDP/2.3/services/LOGSEARCH/metainfo.xml     |   26 +
 .../services/LOGSEARCH/role_command_order.json  |    8 +
 .../stacks/HDP/2.3/upgrades/upgrade-2.3.xml     |    3 +
 .../stacks/HDP/2.3/upgrades/upgrade-2.4.xml     |    3 +
 .../stacks/HDP/2.3/upgrades/upgrade-2.5.xml     |    3 +
 .../stacks/HDP/2.4/upgrades/upgrade-2.4.xml     |    3 +
 .../stacks/HDP/2.4/upgrades/upgrade-2.5.xml     |    3 +
 .../stacks/HDP/2.5/upgrades/upgrade-2.5.xml     |    3 +
 .../ambari/server/stack/StackManagerTest.java   |   62 +
 .../stacks/2.4/LOGSEARCH/test_logfeeder.py      |  128 ++
 .../stacks/2.4/LOGSEARCH/test_logsearch.py      |  137 ++
 .../python/stacks/2.4/LOGSEARCH/test_solr.py    |  145 ++
 .../test/python/stacks/2.4/configs/default.json |  398 ++++
 .../src/test/python/stacks/utils/RMFTestCase.py |   14 +-
 .../HDP/2.2.0/upgrades/upgrade_test_checks.xml  |    1 +
 .../app/mappers/service_metrics_mapper.js       |    3 +-
 ambari-web/app/models/quick_links.js            |   13 +
 .../app/views/common/quick_view_link_view.js    |    6 +-
 .../test/views/common/quick_link_view_test.js   |    5 +
 69 files changed, 8505 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-common/src/main/python/resource_management/libraries/functions/package_conditions.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/package_conditions.py b/ambari-common/src/main/python/resource_management/libraries/functions/package_conditions.py
index df46ce0..4466671 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/package_conditions.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/package_conditions.py
@@ -46,11 +46,19 @@ def should_install_ams_grafana():
   config = Script.get_config()
   return 'role' in config and config['role'] == "METRICS_GRAFANA"
 
+def should_install_logsearch_solr():
+  config = Script.get_config()
+  return 'role' in config and config['role'] != "LOGSEARCH_LOGFEEDER"
+
+def should_install_logsearch_portal():
+  config = Script.get_config()
+  return 'role' in config and config['role'] == "LOGSEARCH_SERVER"
+
 def should_install_mysql():
   config = Script.get_config()
   hive_database = config['configurations']['hive-env']['hive_database']
   hive_use_existing_db = hive_database.startswith('Existing')
-  
+
   if hive_use_existing_db or 'role' in config and config['role'] != "MYSQL_SERVER":
     return False
   return True

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/java/org/apache/ambari/server/Role.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/Role.java b/ambari-server/src/main/java/org/apache/ambari/server/Role.java
index f72cc5b..a1a425c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/Role.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/Role.java
@@ -119,6 +119,9 @@ public class Role {
   public static final Role KAFKA_BROKER = valueOf("KAFKA_BROKER");
   public static final Role NIMBUS = valueOf("NIMBUS");
   public static final Role RANGER_KMS_SERVER = valueOf("RANGER_KMS_SERVER");
+  public static final Role LOGSEARCH_SERVER = valueOf("LOGSEARCH_SERVER");
+  public static final Role LOGSEARCH_SOLR = valueOf("LOGSEARCH_SOLR");
+  public static final Role LOGSEARCH_LOGFEEDER = valueOf("LOGSEARCH_LOGFEEDER");
   public static final Role INSTALL_PACKAGES = valueOf("install_packages");
   public static final Role UPDATE_REPO = valueOf("update_repo");
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/alerts.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/alerts.json b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/alerts.json
new file mode 100644
index 0000000..df20be6
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/alerts.json
@@ -0,0 +1,62 @@
+{
+  "LOGSEARCH": {
+    "LOGSEARCH_SERVER": [
+      {
+        "name": "logsearch_ui",
+        "label": "LogSearch Web UI",
+        "description": "This host-level alert is triggered if the LogSearch UI is unreachable.",
+        "interval": 1,
+        "scope": "ANY",
+        "source": {
+          "type": "WEB",
+          "uri": {
+            "http": "{{logsearch-site/logsearch.ui.port}}",
+            "https": "{{logsearch-site/logsearch.ui.port}}",
+            "connection_timeout": 5.0,
+            "default_port": 61888
+          },
+          "reporting": {
+            "ok": {
+              "text": "HTTP {0} response in {2:.3f}s"
+            },
+            "warning": {
+              "text": "HTTP {0} response from {1} in {2:.3f}s ({3})"
+            },
+            "critical": {
+              "text": "Connection failed to {1} ({3})"
+            }
+          }
+        }
+      }
+    ],
+    "LOGSEARCH_SOLR": [
+      {
+        "name": "logsearch_solr",
+        "label": "LogSearch Solr Web UI",
+        "description": "This host-level alert is triggered if the Solr Cloud Instance is unreachable.",
+        "interval": 1,
+        "scope": "ANY",
+        "source": {
+          "type": "WEB",
+          "uri": {
+            "http": "{{logsearch-solr-env/logsearch_solr_port}}",
+            "https": "{{logsearch-solr-env/logsearch_solr_port}}",
+            "connection_timeout": 5.0,
+            "default_port": 8886
+          },
+          "reporting": {
+            "ok": {
+              "text": "HTTP {0} response in {2:.3f}s"
+            },
+            "warning": {
+              "text": "HTTP {0} response from {1} in {2:.3f}s ({3})"
+            },
+            "critical": {
+              "text": "Connection failed to {1} ({3})"
+            }
+          }
+        }
+      }
+    ]
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logfeeder-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logfeeder-env.xml b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logfeeder-env.xml
new file mode 100644
index 0000000..94ed27d
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logfeeder-env.xml
@@ -0,0 +1,118 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * 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.
+ */
+-->
+
+
+<!-- This is a special config file for properties used to monitor status of the service -->
+<configuration supports_adding_forbidden="true">
+
+  <property>
+    <name>logfeeder_pid_dir</name>
+    <value>/var/run/ambari-logsearch-logfeeder</value>
+    <description>logfeeder Process ID Directory</description>
+    <display-name>Logfeeder pid dir</display-name>
+  </property>
+
+  <property>
+    <name>logfeeder_log_dir</name>
+    <value>/var/log/ambari-logsearch-logfeeder</value>
+    <description>Log dir for logfeeder</description>
+    <display-name>Logfeeder log dir</display-name>
+  </property>
+
+  <property>
+    <name>logfeeder_checkpoint_folder</name>
+    <value>/etc/ambari-logsearch-logfeeder/conf/checkpoints</value>
+    <description>Checkpoint folder for logfeeder</description>
+    <display-name>Logfeeder checkpoint dir</display-name>
+  </property>
+
+  <property>
+    <name>logfeeder_config_files</name>
+    <value>{{logfeeder_config_files}}</value>
+    <description>Comma separated config files in grok format</description>
+    <display-name>Logfeeder config files</display-name>
+  </property>
+
+  <property>
+    <name>logfeeder_user</name>
+    <value>logfeeder</value>
+    <property-type>USER</property-type>
+    <description>logfeeder user</description>
+    <display-name>Logsfeeder User</display-name>
+  </property>
+
+  <property>
+    <name>logfeeder_group</name>
+    <value>logfeeder</value>
+    <property-type>GROUP</property-type>
+    <description>logfeeder group</description>
+    <display-name>Logsfeeder Group</display-name>
+  </property>
+
+  <property>
+    <name>logfeeder_max_mem</name>
+    <value>512m</value>
+    <description>Max memory for LogFeeder</description>
+    <display-name>Logsfeeder max memory</display-name>
+  </property>
+
+  <property>
+    <name>content</name>
+    <description>This is the jinja template for config.json file</description>
+    <value>#!/bin/bash
+# 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.
+
+set -e
+
+export LOGFEEDER_PATH={{logfeeder_dir}}
+
+export LOGFEEDER_CONF_DIR={{logsearch_logfeeder_conf}}
+
+#Logfile e.g. /var/log/logfeeder.log
+export LOGFILE={{logfeeder_log}}
+
+#pid file e.g. /var/run/logfeeder.pid
+export PID_FILE={{logfeeder_pid_file}}
+
+export JAVA_HOME={{java64_home}}
+
+if [ "$LOGFEEDER_JAVA_MEM" = "" ]; then
+  export LOGFEEDER_JAVA_MEM=-Xmx{{logfeeder_max_mem}}
+fi
+    </value>
+  </property>
+
+
+</configuration>  

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logfeeder-log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logfeeder-log4j.xml b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logfeeder-log4j.xml
new file mode 100644
index 0000000..91fc0ce
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logfeeder-log4j.xml
@@ -0,0 +1,79 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * 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.
+ */
+-->
+<!-- This is a special config file for properties used to monitor status of the service -->
+<configuration supports_adding_forbidden="true">
+
+  <!-- solrconfig.xml -->
+
+  <property>
+    <name>content</name>
+    <description>This is the jinja template for solrconfig.xml file for service logs</description>
+    <value>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
+&lt;!--
+  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.
+--&gt;
+&lt;!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"&gt;
+&lt;log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"&gt;
+  &lt;appender name="console" class="org.apache.log4j.ConsoleAppender"&gt;
+    &lt;param name="Target" value="System.out" /&gt;
+    &lt;layout class="org.apache.log4j.PatternLayout"&gt;
+      &lt;param name="ConversionPattern" value="%d [%t] %-5p %C{6} (%F:%L) - %m%n" /&gt;
+    &lt;/layout&gt;
+  &lt;/appender&gt;
+
+  &lt;appender name="rolling_file" class="org.apache.log4j.RollingFileAppender"&gt; 
+    &lt;param name="file" value="{{logfeeder_log_dir}}/logfeeder.log" /&gt;
+    &lt;param name="append" value="true" /&gt; 
+    &lt;param name="maxFileSize" value="10MB" /&gt; 
+    &lt;param name="maxBackupIndex" value="10" /&gt; 
+    &lt;layout class="org.apache.log4j.PatternLayout"&gt; 
+      &lt;param name="ConversionPattern" value="%d [%t] %-5p %C{6} (%F:%L) - %m%n"/&gt; 
+    &lt;/layout&gt; 
+  &lt;/appender&gt; 
+
+  &lt;category name="org.apache.ambari.logfeeder" additivity="false"&gt;
+    &lt;priority value="info" /&gt;
+    &lt;appender-ref ref="rolling_file" /&gt;
+  &lt;/category&gt;
+
+  &lt;root&gt;
+    &lt;priority value="warn" /&gt;
+    &lt;appender-ref ref="rolling_file" /&gt;
+  &lt;/root&gt;
+&lt;/log4j:configuration&gt;
+    </value>
+  </property>
+
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logfeeder-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logfeeder-site.xml b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logfeeder-site.xml
new file mode 100644
index 0000000..40ee374
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logfeeder-site.xml
@@ -0,0 +1,87 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * 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.
+ */
+-->
+<configuration>
+
+  <property>
+    <name>logfeeder.solr.service.logs.enable</name>
+    <value>true</value>
+    <display-name>Service Logs enabled</display-name>
+    <description>Enable service logs to Solr</description>
+  </property>
+
+  <property>
+    <name>logfeeder.solr.audit.logs.enable</name>
+    <value>true</value>
+    <display-name>Audit Logs enabled</display-name>
+    <description>Enable audit logs to Solr</description>
+  </property>
+
+  <property>
+    <name>logfeeder.kafka.service.logs.enable</name>
+    <value>false</value>
+    <display-name>Kafka Service Logs enabled</display-name>
+    <description>Enable service logs to Kafka</description>
+  </property>
+
+  <property>
+    <name>logfeeder.kafka.topic.service.logs</name>
+    <value>service_logs</value>
+    <display-name>Kafka Service Logs topic</display-name>
+    <description>Kafka topic for service logs</description>
+  </property>
+
+  <property>
+    <name>logfeeder.kafka.audit.logs.enable</name>
+    <value>false</value>
+    <display-name>Audit Logs enabled</display-name>
+    <description>Enable audit logs to Kafka</description>
+  </property>
+
+  <property>
+    <name>logfeeder.kafka.topic.audit.logs</name>
+    <value>audit_logs</value>
+    <display-name>Kafka Audit Logs topic</display-name>
+    <description>Kafka topic for audit logs</description>
+  </property>
+
+  <property>
+    <name>logfeeder.kafka.broker.list</name>
+    <value>NONE</value>
+    <display-name>Kafka broker list</display-name>
+    <description>List of brokers. e.g. broker1_host:port,broker2_host:port</description>
+  </property>
+
+  <property>
+    <name>logfeeder.kafka.security.protocol</name>
+    <value>NONE</value>
+    <display-name>Kafka security protocol</display-name>
+    <description>If security is enabled, then set this value. E.g. SASL_PLAINTEXT</description>
+  </property>
+
+  <property>
+    <name>logfeeder.kafka.kerberos.service.name</name>
+    <value>NONE</value>
+    <display-name>Kafka Kerberos service name</display-name>
+    <description>If security is enabled, then set this value. E.g. kafka</description>
+  </property>
+
+</configuration>


[3/8] ambari git commit: AMBARI-15806. Initial commit for Logsearch service stack definition (oleewere)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-hdfs.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-hdfs.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-hdfs.json.j2
new file mode 100644
index 0000000..730ef99
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-hdfs.json.j2
@@ -0,0 +1,246 @@
+{#
+ # 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.
+ #}
+{
+  "input":[
+    {
+      "type":"hdfs_datanode",
+      "rowtype":"service",
+      "path":"{{hdfs_log_dir_prefix}}/hdfs/hadoop-hdfs-datanode-*.log"
+    },
+    {
+      "type":"hdfs_namenode",
+      "rowtype":"service",
+      "path":"{{hdfs_log_dir_prefix}}/hdfs/hadoop-hdfs-namenode-*.log"
+    },
+    {
+      "type":"hdfs_journalnode",
+      "rowtype":"service",
+      "path":"{{hdfs_log_dir_prefix}}/hdfs/hadoop-hdfs-journalnode-*.log"
+    },
+    {
+      "type":"hdfs_secondarynamenode",
+      "rowtype":"service",
+      "path":"{{hdfs_log_dir_prefix}}/hdfs/hadoop-hdfs-secondarynamenode-*.log"
+    },
+    {
+      "type":"hdfs_zkfc",
+      "rowtype":"service",
+      "path":"{{hdfs_log_dir_prefix}}/hdfs/hadoop-hdfs-zkfc-*.log"
+    },
+    {
+      "type":"hdfs_audit",
+      "rowtype":"audit",
+      "is_enabled":"true",
+      "add_fields":{
+        "logType":"HDFSAudit",
+        "enforcer":"hadoop-acl",
+        "repoType":"1",
+        "repo":"hdfs"
+      },
+      "path":"{{hdfs_log_dir_prefix}}/hdfs/hdfs-audit.log"
+    }
+
+  ],
+  "filter":[
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "hdfs_datanode",
+            "hdfs_journalnode",
+            "hdfs_secondarynamenode",
+            "hdfs_namenode",
+            "hdfs_zkfc"
+          ]
+
+        }
+
+      },
+      "log4j_format":"%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{JAVACLASS:logger_name}%{SPACE}\\(%{JAVAFILE:file}:%{JAVAMETHOD:method}\\(%{INT:line_number}\\)\\)%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+
+        }
+
+      }
+
+    },
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "hdfs_audit"
+          ]
+
+        }
+
+      },
+      "log4j_format":"%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:evtTime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:evtTime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{JAVACLASS:logger_name}:%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "evtTime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+
+        }
+
+      }
+
+    },
+    {
+      "filter":"keyvalue",
+      "sort_order":1,
+      "conditions":{
+        "fields":{
+          "type":[
+            "hdfs_audit"
+          ]
+
+        }
+
+      },
+      "source_field":"log_message",
+      "value_split":"=",
+      "field_split":"\t",
+      "post_map_values":{
+        "src":{
+          "map_fieldname":{
+            "new_fieldname":"resource"
+          }
+
+        },
+        "ip":{
+          "map_fieldname":{
+            "new_fieldname":"cliIP"
+          }
+
+        },
+        "allowed":[
+          {
+            "map_fieldvalue":{
+              "pre_value":"true",
+              "post_value":"1"
+            }
+
+          },
+          {
+            "map_fieldvalue":{
+              "pre_value":"false",
+              "post_value":"0"
+            }
+
+          },
+          {
+            "map_fieldname":{
+              "new_fieldname":"result"
+            }
+
+          }
+
+        ],
+        "cmd":{
+          "map_fieldname":{
+            "new_fieldname":"action"
+          }
+
+        },
+        "proto":{
+          "map_fieldname":{
+            "new_fieldname":"cliType"
+          }
+
+        },
+        "callerContext":{
+          "map_fieldname":{
+            "new_fieldname":"req_caller_id"
+          }
+
+        }
+
+      }
+
+    },
+    {
+      "filter":"grok",
+      "sort_order":2,
+      "source_field":"ugi",
+      "remove_source_field":"false",
+      "conditions":{
+        "fields":{
+          "type":[
+            "hdfs_audit"
+          ]
+
+        }
+
+      },
+      "message_pattern":"%{USERNAME:p_user}.+auth:%{USERNAME:p_authType}.+via %{USERNAME:k_user}.+auth:%{USERNAME:k_authType}|%{USERNAME:user}.+auth:%{USERNAME:authType}|%{USERNAME:x_user}",
+      "post_map_values":{
+        "user":{
+          "map_fieldname":{
+            "new_fieldname":"reqUser"
+          }
+
+        },
+        "x_user":{
+          "map_fieldname":{
+            "new_fieldname":"reqUser"
+          }
+
+        },
+        "p_user":{
+          "map_fieldname":{
+            "new_fieldname":"reqUser"
+          }
+
+        },
+        "k_user":{
+          "map_fieldname":{
+            "new_fieldname":"proxyUsers"
+          }
+
+        },
+        "p_authType":{
+          "map_fieldname":{
+            "new_fieldname":"authType"
+          }
+
+        },
+        "k_authType":{
+          "map_fieldname":{
+            "new_fieldname":"proxyAuthType"
+          }
+
+        }
+
+      }
+
+    }
+
+  ]
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-hive.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-hive.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-hive.json.j2
new file mode 100644
index 0000000..131ae86
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-hive.json.j2
@@ -0,0 +1,62 @@
+{#
+ # 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.
+ #}
+{
+  "input":[
+    {
+      "type":"hive_hiveserver2",
+      "rowtype":"service",
+      "path":"{{hive_log_dir}}/hiveserver2.log"
+    },
+    {
+      "type":"hive_metastore",
+      "rowtype":"service",
+      "path":"{{hive_log_dir}}/hivemetastore.log"
+    }
+
+  ],
+  "filter":[
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "hive_hiveserver2",
+            "hive_metastore"
+          ]
+
+        }
+
+      },
+      "log4j_format":"%d{ISO8601} %-5p [%t]: %c{2} (%F:%M(%L)) - %m%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}\\[%{DATA:thread_name}\\]:%{SPACE}%{JAVACLASS:logger_name}%{SPACE}\\(%{JAVAFILE:file}:%{JAVAMETHOD:method}\\(%{INT:line_number}\\)\\)%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+
+        }
+
+      }
+
+    }
+
+  ]
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-kafka.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-kafka.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-kafka.json.j2
new file mode 100644
index 0000000..73e501d
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-kafka.json.j2
@@ -0,0 +1,105 @@
+{#
+ # 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.
+ #}
+{
+  "input":[
+    {
+      "type":"kafka_controller",
+      "rowtype":"service",
+      "path":"{{kafka_log_dir}}/controller.log"
+    },
+    {
+      "type":"kafka_request",
+      "rowtype":"service",
+      "path":"{{kafka_log_dir}}/kafka-request.log"
+    },
+    {
+      "type":"kafka_logcleaner",
+      "rowtype":"service",
+      "path":"{{kafka_log_dir}}/log-cleaner.log"
+    },
+    {
+      "type":"kafka_server",
+      "rowtype":"service",
+      "path":"{{kafka_log_dir}}/server.log"
+    },
+    {
+      "type":"kafka_statechange",
+      "rowtype":"service",
+      "path":"{{kafka_log_dir}}/state-change.log"
+    }
+
+  ],
+  "filter":[
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "kafka_controller",
+            "kafka_request",
+            "kafka_logcleaner"
+          ]
+
+        }
+
+      },
+      "log4j_format":"[%d] %p %m (%c)%n",
+      "multiline_pattern":"^(\\[%{TIMESTAMP_ISO8601:logtime}\\])",
+      "message_pattern":"(?m)^\\[%{TIMESTAMP_ISO8601:logtime}\\]%{SPACE}%{LOGLEVEL:level}%{SPACE}\\[%{DATA:thread_name}\\]%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+
+        }
+
+      }
+
+    },
+    {
+      "filter":"grok",
+      "comment":"Suppose to be same log4j pattern as other kafka processes, but some reason thread is not printed",
+      "conditions":{
+        "fields":{
+          "type":[
+            "kafka_server",
+            "kafka_statechange"
+          ]
+
+        }
+
+      },
+      "log4j_format":"[%d] %p %m (%c)%n",
+      "multiline_pattern":"^(\\[%{TIMESTAMP_ISO8601:logtime}\\])",
+      "message_pattern":"(?m)^\\[%{TIMESTAMP_ISO8601:logtime}\\]%{SPACE}%{LOGLEVEL:level}%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+
+        }
+
+      }
+
+    }
+
+  ]
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-knox.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-knox.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-knox.json.j2
new file mode 100644
index 0000000..50c2c6d
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-knox.json.j2
@@ -0,0 +1,68 @@
+{#
+ # 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.
+ #}
+{
+  "input":[
+    {
+      "type":"knox_gateway",
+      "rowtype":"service",
+      "path":"{{knox_log_dir}}/gateway.log"
+    },
+    {
+      "type":"knox_cli",
+      "rowtype":"service",
+      "path":"{{knox_log_dir}}/knoxcli.log"
+    },
+    {
+      "type":"knox_ldap",
+      "rowtype":"service",
+      "path":"{{knox_log_dir}}/ldap.log"
+    }
+
+  ],
+  "filter":[
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "knox_gateway",
+            "knox_cli",
+            "knox_ldap"
+          ]
+          
+        }
+
+      },
+      "log4j_format":"%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{JAVACLASS:logger_name}%{SPACE}\\(%{JAVAFILE:file}:%{JAVAMETHOD:method}\\(%{INT:line_number}\\)\\)%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+
+        }
+
+      }
+
+    }
+
+  ]
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-logsearch.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-logsearch.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-logsearch.json.j2
new file mode 100644
index 0000000..d9ef66d
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-logsearch.json.j2
@@ -0,0 +1,68 @@
+{#
+ # 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.
+ #}
+{
+  "input":[
+    {
+      "type":"logsearch_app",
+      "rowtype":"service",
+      "path":"{{logsearch_log_dir}}/logsearch.log"
+    },
+    {
+      "type":"logsearch_feeder",
+      "rowtype":"service",
+      "path":"{{logfeeder_log_dir}}/logfeeder.log"
+    },
+    {
+      "type":"logsearch_perf",
+      "rowtype":"service",
+      "path":"{{logsearch_log_dir}}/logsearch-performance.log"
+    }
+
+  ],
+  "filter":[
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "logsearch_app",
+            "logsearch_feeder",
+            "logsearch_perf"
+          ]
+
+        }
+
+      },
+      "log4j_format":"%d [%t] %-5p %C{6} (%F:%L) - %m%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}\\[%{DATA:thread_name}\\]%{SPACE}%{LOGLEVEL:level}%{SPACE}%{JAVACLASS:logger_name}%{SPACE}\\(%{JAVAFILE:file}:%{INT:line_number}\\)%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+
+        }
+
+      }
+
+    }
+
+  ]
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-oozie.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-oozie.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-oozie.json.j2
new file mode 100644
index 0000000..fc125ec
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-oozie.json.j2
@@ -0,0 +1,56 @@
+{#
+ # 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.
+ #}
+{
+  "input":[
+    {
+      "type":"oozie_app",
+      "rowtype":"service",
+      "path":"{{oozie_log_dir}}/oozie.log"
+    }
+
+  ],
+  "filter":[
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "oozie_app"
+          ]
+
+        }
+
+      },
+      "log4j_format":"%d{ISO8601} %5p %c{1}:%L - SERVER[${oozie.instance.id}] %m%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{DATA:logger_name}:%{INT:line_number}%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+
+        }
+
+      }
+
+    }
+
+  ]
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-ranger.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-ranger.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-ranger.json.j2
new file mode 100644
index 0000000..8ec0153
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-ranger.json.j2
@@ -0,0 +1,122 @@
+{#
+ # 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.
+ #}
+{
+  "input":[
+    {
+      "type":"ranger_admin",
+      "rowtype":"service",
+      "path":"{{ranger_admin_log_dir}}/xa_portal.log"
+    },
+    {
+      "type":"ranger_dbpatch",
+      "is_enabled":"true",
+      "path":"{{ranger_admin_log_dir}}/ranger_db_patch.log"
+    },
+    {
+      "type":"ranger_kms",
+      "rowtype":"service",
+      "path":"{{ranger_kms_log_dir}}/kms.log"
+    },
+    {
+      "type":"ranger_usersync",
+      "rowtype":"service",
+      "path":"{{ranger_usersync_log_dir}}/usersync.log"
+    }
+
+  ],
+  "filter":[
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "ranger_admin",
+            "ranger_dbpatch"
+          ]
+
+        }
+
+      },
+      "log4j_format":"%d [%t] %-5p %C{6} (%F:%L) - %m%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}\\[%{DATA:thread_name}\\]%{SPACE}%{LOGLEVEL:level}%{SPACE}%{JAVACLASS:logger_name}%{SPACE}\\(%{JAVAFILE:file}:%{INT:line_number}\\)%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+
+        }
+
+      }
+
+    },
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "ranger_kms"
+          ]
+
+        }
+
+      },
+      "log4j_format":"%d{ISO8601} %-5p %c{1} - %m%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{JAVACLASS:logger_name}%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+
+        }
+
+      }
+
+    },
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "ranger_usersync"
+          ]
+          
+        }
+        
+      },
+      "log4j_format":"%d{dd MMM yyyy HH:mm:ss} %5p %c{1} [%t] - %m%n",
+      "multiline_pattern":"^(%{USER_SYNC_DATE:logtime})",
+      "message_pattern":"(?m)^%{USER_SYNC_DATE:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{JAVACLASS:logger_name}%{SPACE}\\[%{DATA:thread_name}\\]%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"dd MMM yyyy HH:mm:ss"
+          }
+
+        }
+
+      }
+
+    }
+
+  ]
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-storm.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-storm.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-storm.json.j2
new file mode 100644
index 0000000..e8e95c3
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-storm.json.j2
@@ -0,0 +1,86 @@
+{#
+ # 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.
+ #}
+{
+  "input":[
+    {
+      "type":"storm_drpc",
+      "rowtype":"service",
+      "path":"{{storm_log_dir}}/drpc.log"
+    },
+    {
+      "type":"storm_logviewer",
+      "rowtype":"service",
+      "path":"{{storm_log_dir}}/logviewer.log"
+    },
+    {
+      "type":"storm_nimbus",
+      "rowtype":"service",
+      "path":"{{storm_log_dir}}/nimbus.log"
+    },
+    {
+      "type":"storm_supervisor",
+      "rowtype":"service",
+      "path":"{{storm_log_dir}}/supervisor.log"
+    },
+    {
+      "type":"storm_ui",
+      "rowtype":"service",
+      "path":"{{storm_log_dir}}/ui.log"
+    },
+    {
+      "type":"storm_worker",
+      "rowtype":"service",
+      "path":"{{storm_log_dir}}/*worker*.log"
+    }
+
+  ],
+  "filter":[
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "storm_drpc",
+            "storm_logviewer",
+            "storm_nimbus",
+            "storm_supervisor",
+            "storm_ui",
+            "storm_worker"
+          ]
+
+        }
+
+      },
+      "log4j_format":"",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{JAVACLASS:logger_name}%{SPACE}\\[%{LOGLEVEL:level}\\]%{SPACE}%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss.SSS"
+          }
+
+        }
+
+      }
+
+    }
+
+  ]
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-yarn.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-yarn.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-yarn.json.j2
new file mode 100644
index 0000000..fb35620
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-yarn.json.j2
@@ -0,0 +1,86 @@
+{#
+ # 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.
+ #}
+{
+  "input":[
+    {
+      "type":"mapred_historyserver",
+      "rowtype":"service",
+      "path":"{{mapred_log_dir_prefix}}/mapred/mapred-mapred-historyserver*.log"
+    },
+    {
+      "type":"yarn_nodemanager",
+      "rowtype":"service",
+      "path":"{{yarn_log_dir_prefix}}/yarn/yarn-yarn-nodemanager-*.log"
+    },
+    {
+      "type":"yarn_resourcemanager",
+      "rowtype":"service",
+      "path":"{{yarn_log_dir_prefix}}/yarn/yarn-yarn-resourcemanager-*.log"
+    },
+    {
+      "type":"yarn_timelineserver",
+      "rowtype":"service",
+      "path":"{{yarn_log_dir_prefix}}/yarn/yarn-yarn-timelineserver-*.log"
+    },
+    {
+      "type":"yarn_historyserver",
+      "rowtype":"service",
+      "path":"{{yarn_log_dir_prefix}}/yarn/yarn-yarn-historyserver-*.log"
+    },
+    {
+      "type":"yarn_jobsummary",
+      "rowtype":"service",
+      "path":"{{yarn_log_dir_prefix}}/yarn/hadoop-mapreduce.jobsummary.log"
+    }
+
+  ],
+  "filter":[
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "mapred_historyserver",
+            "yarn_historyserver",
+            "yarn_jobsummary",
+            "yarn_nodemanager",
+            "yarn_resourcemanager",
+            "yarn_timelineserver"
+          ]
+
+        }
+
+      },
+      "log4j_format":"%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{JAVACLASS:logger_name}%{SPACE}\\(%{JAVAFILE:file}:%{JAVAMETHOD:method}\\(%{INT:line_number}\\)\\)%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+
+        }
+
+      }
+
+    }
+
+  ]
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-zookeeper.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-zookeeper.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-zookeeper.json.j2
new file mode 100644
index 0000000..083bd8a
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-zookeeper.json.j2
@@ -0,0 +1,56 @@
+{#
+ # 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.
+ #}
+{
+  "input":[
+    {
+      "type":"zookeeper",
+      "rowtype":"service",
+      "path":"{{zk_log_dir}}/zookeeper*.out"
+    }
+
+  ],
+  "filter":[
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "zookeeper"
+          ]
+
+        }
+
+      },
+      "log4j_format":"%d{ISO8601} - %-5p [%t:%C{1}@%L] - %m%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}-%{SPACE}%{LOGLEVEL:level}%{SPACE}\\[%{DATA:thread_name}\\@%{INT:line_number}\\]%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+
+        }
+
+      }
+
+    }
+
+  ]
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/logfeeder.properties.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/logfeeder.properties.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/logfeeder.properties.j2
new file mode 100644
index 0000000..1edf16a
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/logfeeder.properties.j2
@@ -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.
+
+logfeeder.checkpoint.folder={{logfeeder_checkpoint_folder}}
+metrics.collector.hosts={{metrics_collector_hosts}}
+config.files={{logfeeder_config_files}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/logsearch.properties.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/logsearch.properties.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/logsearch.properties.j2
new file mode 100644
index 0000000..1e183bd
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/logsearch.properties.j2
@@ -0,0 +1,40 @@
+# 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.
+
+#solr.url=http://solr_host:{{logsearch_solr_port}}/solr
+solr.zkhosts={{zookeeper_quorum}}{{logsearch_solr_znode}}
+
+# Service Logs
+solr.core.logs={{logsearch_solr_collection_service_logs}}
+
+solr.service_logs.split_interval_mins={{service_logs_collection_splits_interval_mins}}
+solr.service_logs.shards={{logsearch_numshards}}
+solr.service_logs.replication_factor={{logsearch_repfactor}}
+
+solr.servicelogs.fields={{logsearch_service_logs_fields}}
+
+# Audit logs
+auditlog.solr.zkhosts={{solr_audit_logs_zk_quorum}}{{solr_audit_logs_zk_node}}
+auditlog.solr.core.logs={{logsearch_solr_collection_audit_logs}}
+auditlog.solr.url={{solr_audit_logs_url}}
+
+solr.audit_logs.split_interval_mins={{audit_logs_collection_splits_interval_mins}}
+solr.audit_logs.shards={{logsearch_numshards}}
+solr.audit_logs.replication_factor={{logsearch_repfactor}}
+
+# History logs
+solr.core.history=history
+solr.history.config_name=history
+solr.history.replication_factor={{logsearch_repfactor}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/output.config.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/output.config.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/output.config.json.j2
new file mode 100644
index 0000000..8216587
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/output.config.json.j2
@@ -0,0 +1,97 @@
+{#
+ # 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.
+ #}
+{
+  "output":[
+    {
+      "is_enabled":"{{solr_service_logs_enable}}",
+      "comment":"Output to solr for service logs",
+      "destination":"solr",
+      "zk_hosts":"{{zookeeper_quorum}}{{logsearch_solr_znode}}",
+      "collection":"{{logsearch_solr_collection_service_logs}}",
+      "number_of_shards": "{{logsearch_numshards}}",
+      "splits_interval_mins": "{{service_logs_collection_splits_interval_mins}}",
+      "conditions":{
+        "fields":{
+          "rowtype":[
+            "service"
+          ]
+
+        }
+
+      }
+
+    },
+    {
+      "comment":"Output to solr for audit records",
+      "is_enabled":"{{solr_audit_logs_enable}}",
+      "destination":"solr",
+      "zk_hosts":"{{zookeeper_quorum}}{{logsearch_solr_znode}}",
+      "collection":"{{logsearch_solr_collection_audit_logs}}",
+      "number_of_shards": "{{logsearch_numshards}}",
+      "splits_interval_mins": "{{audit_logs_collection_splits_interval_mins}}",
+      "conditions":{
+        "fields":{
+          "rowtype":[
+            "audit"
+          ]
+
+        }
+
+      }
+
+    },
+    {
+      "is_enabled":"{{kafka_service_logs_enable}}",
+      "destination":"kafka",
+      "broker_list":"{{kafka_broker_list}}",
+      "topic":"{{kafka_topic_service_logs}}",
+      "kafka.security.protocol":"{{kafka_security_protocol}}",
+      "kafka.sasl.kerberos.service.name":"{{kafka_kerberos_service_name}}",
+      "conditions":{
+        "fields":{
+          "rowtype":[
+            "service"
+          ]
+
+        }
+
+      }
+
+    },
+    {
+      "is_enabled":"{{kafka_audit_logs_enable}}",
+      "destination":"kafka",
+      "broker_list":"{{kafka_broker_list}}",
+      "topic":"{{kafka_topic_audit_logs}}",
+      "kafka.security.protocol":"{{kafka_security_protocol}}",
+      "kafka.sasl.kerberos.service.name":"{{kafka_kerberos_service_name}}",
+      "conditions":{
+        "fields":{
+          "rowtype":[
+            "audit"
+          ]
+
+        }
+
+      }
+
+    }
+
+  ]
+  
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/zoo.cfg.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/zoo.cfg.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/zoo.cfg.j2
new file mode 100644
index 0000000..1f3808b
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/zoo.cfg.j2
@@ -0,0 +1,21 @@
+# 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.
+
+{% for key, value in zoo_cfg_properties_map.iteritems() -%}
+  {{key}}={{value}}
+{% endfor %}
+{% for host in zookeeper_hosts_list -%}
+server.{{loop.index}}={{host}}:2888:3888
+{% endfor %}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/quicklinks/quicklinks.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/quicklinks/quicklinks.json b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/quicklinks/quicklinks.json
new file mode 100644
index 0000000..48a3efe
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/quicklinks/quicklinks.json
@@ -0,0 +1,26 @@
+{
+  "name": "default",
+  "description": "default quick links configuration",
+  "configuration": {
+    "protocol": {
+      "type": "http"
+    },
+    "links": [
+      {
+        "name": "logsearch_ui",
+        "label": "Logsearch UI",
+        "url": "%@://%@:%@",
+        "requires_user_name": "false",
+        "port": {
+          "http_property": "logsearch.ui.port",
+          "http_default_port": "8888",
+          "https_property": "logsearch.ui.port",
+          "https_default_port": "8888",
+          "regex": "^(\\d+)$",
+          "site": "logsearch-site"
+        }
+      }
+    ]
+  }
+}
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml
index 77ff982..b0cff68 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml
@@ -174,6 +174,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 
@@ -210,6 +211,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 
@@ -322,6 +324,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.4.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.4.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.4.xml
index 0ef4674..bf041de 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.4.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.4.xml
@@ -180,6 +180,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 
@@ -216,6 +217,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 
@@ -328,6 +330,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/stacks/HDP/2.3/services/LOGSEARCH/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/LOGSEARCH/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/LOGSEARCH/metainfo.xml
new file mode 100644
index 0000000..df697dc
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/LOGSEARCH/metainfo.xml
@@ -0,0 +1,26 @@
+<?xml version="1.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.
+-->
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>LOGSEARCH</name>
+      <extends>common-services/LOGSEARCH/0.5.0</extends>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/stacks/HDP/2.3/services/LOGSEARCH/role_command_order.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/LOGSEARCH/role_command_order.json b/ambari-server/src/main/resources/stacks/HDP/2.3/services/LOGSEARCH/role_command_order.json
new file mode 100755
index 0000000..688186b
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/LOGSEARCH/role_command_order.json
@@ -0,0 +1,8 @@
+{
+  "general_deps" : {
+    "_comment" : "dependencies for all logsearch",
+    "LOGSEARCH_SOLR-START" : ["ZOOKEEPER_SERVER-START"],
+    "LOGSEARCH_SERVER-START": ["LOGSEARCH_SOLR-START"],
+    "LOGSEARCH_LOGFEEDER-START": ["LOGSEARCH_SOLR-START", "LOGSEARCH_SERVER-START"]
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.3.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.3.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.3.xml
index ed30846..6b74af0 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.3.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.3.xml
@@ -175,6 +175,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
     
@@ -213,6 +214,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 
@@ -339,6 +341,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.4.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.4.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.4.xml
index 4731631..9fb2bba 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.4.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.4.xml
@@ -166,6 +166,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 
@@ -203,6 +204,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 
@@ -320,6 +322,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml
index 4a6241d..4c77461 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml
@@ -172,6 +172,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 
@@ -209,6 +210,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 
@@ -326,6 +328,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.4.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.4.xml b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.4.xml
index b53a090..e3bc7a3 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.4.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.4.xml
@@ -173,6 +173,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
     
@@ -211,6 +212,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 
@@ -337,6 +339,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml
index c9ea512..1e93573 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml
@@ -166,6 +166,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 
@@ -203,6 +204,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 
@@ -320,6 +322,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.5.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.5.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.5.xml
index 5503c1a..2acffda 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.5.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.5.xml
@@ -173,6 +173,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
     
@@ -211,6 +212,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 
@@ -337,6 +339,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerTest.java
index d7a15e2..8e9f81a 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerTest.java
@@ -794,4 +794,66 @@ public class StackManagerTest {
     assertTrue(rangerUserSyncRoleCommand + " should be dependent of " + kmsRoleCommand, rangerUserSyncBlockers.contains(kmsRoleCommand));
   }
   //todo: component override assertions
+
+  @Test
+  public void testServicesWithLogsearchRoleCommandOrder() throws AmbariException {
+    URL rootDirectoryURL = StackManagerTest.class.getResource("/");
+    Assert.notNull(rootDirectoryURL);
+
+    File resourcesDirectory = new File(new File(rootDirectoryURL.getFile()).getParentFile().getParentFile(), "src/main/resources");
+
+    File stackRoot = new File(resourcesDirectory, "stacks");
+    File commonServices = new File(resourcesDirectory, "common-services");
+
+    MetainfoDAO metaInfoDao = createNiceMock(MetainfoDAO.class);
+    StackDAO stackDao = createNiceMock(StackDAO.class);
+    ActionMetadata actionMetadata = createNiceMock(ActionMetadata.class);
+    Configuration config = createNiceMock(Configuration.class);
+
+    expect(config.getSharedResourcesDirPath()).andReturn(
+      ClassLoader.getSystemClassLoader().getResource("").getPath()).anyTimes();
+
+    replay(config, metaInfoDao, stackDao, actionMetadata);
+
+    OsFamily osFamily = new OsFamily(config);
+
+    StackManager stackManager = new StackManager(stackRoot, commonServices, osFamily, metaInfoDao, actionMetadata, stackDao);
+
+    String zookeeperServerRoleCommand = Role.ZOOKEEPER_SERVER + "-" + RoleCommand.START;
+    String logsearchServerRoleCommand = Role.LOGSEARCH_SERVER + "-" + RoleCommand.START;
+    String logsearchSolrRoleCommand = Role.LOGSEARCH_SOLR + "-" + RoleCommand.START;
+    String logsearchLogfeederRoleCommand = Role.LOGSEARCH_LOGFEEDER + "-" + RoleCommand.START;
+
+    StackInfo hdp = stackManager.getStack("HDP", "2.3");
+    Map<String, Object> rco = hdp.getRoleCommandOrder().getContent();
+
+    Map<String, Object> generalDeps = (Map<String, Object>) rco.get("general_deps");
+    Map<String, Object> optionalNoGlusterfs = (Map<String, Object>) rco.get("optional_no_glusterfs");
+
+    // HDFS/YARN - verify that the stack level rco still works as expected
+    String nameNodeRoleCommand = Role.NAMENODE + "-" + RoleCommand.START;
+    String rangerUserSyncRoleCommand = Role.RANGER_USERSYNC + "-" + RoleCommand.START;
+    ArrayList<String> nameNodeBlockers = (ArrayList<String>) optionalNoGlusterfs.get(nameNodeRoleCommand);
+
+    assertTrue(nameNodeRoleCommand + " should be dependent of " + rangerUserSyncRoleCommand, nameNodeBlockers.contains(rangerUserSyncRoleCommand));
+
+    String resourceManagerCommandRoleCommand = Role.RESOURCEMANAGER +  "-" + RoleCommand.START;
+    ArrayList<String> resourceManagerBlockers = (ArrayList<String>)generalDeps.get(resourceManagerCommandRoleCommand);
+
+    assertTrue(resourceManagerCommandRoleCommand + " should be dependent of " + rangerUserSyncRoleCommand, resourceManagerBlockers.contains(rangerUserSyncRoleCommand));
+
+    // verify logsearch rco
+    // LogSearch Solr
+    ArrayList<String> logsearchSolrBlockers = (ArrayList<String>) generalDeps.get(logsearchSolrRoleCommand);
+    assertTrue(logsearchSolrRoleCommand + " should be dependent of " + zookeeperServerRoleCommand, logsearchSolrBlockers.contains(zookeeperServerRoleCommand));
+
+    // LogSearch Server
+    ArrayList<String> logsearchServerBlockers = (ArrayList<String>) generalDeps.get(logsearchServerRoleCommand);
+    assertTrue(logsearchServerRoleCommand + " should be dependent of " + logsearchSolrRoleCommand, logsearchServerBlockers.contains(logsearchSolrRoleCommand));
+
+    // LogSearch LogFeeder
+    ArrayList<String> logsearchLogfeederBlockers = (ArrayList<String>) generalDeps.get(logsearchLogfeederRoleCommand);
+    assertTrue(logsearchLogfeederRoleCommand + " should be dependent of " + logsearchSolrRoleCommand, logsearchLogfeederBlockers.contains(logsearchSolrRoleCommand));
+    assertTrue(logsearchLogfeederRoleCommand + " should be dependent of " + logsearchServerRoleCommand, logsearchLogfeederBlockers.contains(logsearchServerRoleCommand));
+  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_logfeeder.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_logfeeder.py b/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_logfeeder.py
new file mode 100644
index 0000000..f485d27
--- /dev/null
+++ b/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_logfeeder.py
@@ -0,0 +1,128 @@
+#!/usr/bin/env python
+
+'''
+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.
+'''
+
+from stacks.utils.RMFTestCase import RMFTestCase, Template, InlineTemplate, StaticFile
+from resource_management.core.exceptions import ComponentIsNotRunning
+
+
+class TestLogFeeder(RMFTestCase):
+  COMMON_SERVICES_PACKAGE_DIR = "LOGSEARCH/0.5.0/package"
+  STACK_VERSION = "2.4"
+
+  def configureResourcesCalled(self):
+    self.assertResourceCalled('Directory', '/var/log/ambari-logsearch-logfeeder',
+                              owner='logfeeder',
+                              group='logfeeder',
+                              create_parents=True,
+                              cd_access='a',
+                              mode=0755
+                              )
+    self.assertResourceCalled('Directory', '/var/run/ambari-logsearch-logfeeder',
+                              owner='logfeeder',
+                              group='logfeeder',
+                              create_parents=True,
+                              cd_access='a',
+                              mode=0755
+                              )
+    self.assertResourceCalled('Directory', '/usr/lib/ambari-logsearch-logfeeder',
+                              owner='logfeeder',
+                              group='logfeeder',
+                              create_parents=True,
+                              cd_access='a',
+                              mode=0755
+                              )
+    self.assertResourceCalled('Directory', '/etc/ambari-logsearch-logfeeder/conf',
+                              owner='logfeeder',
+                              group='logfeeder',
+                              create_parents=True,
+                              cd_access='a',
+                              mode=0755
+                              )
+    self.assertResourceCalled('Directory', '/etc/ambari-logsearch-logfeeder/conf/checkpoints',
+                              owner='logfeeder',
+                              group='logfeeder',
+                              create_parents=True,
+                              cd_access='a',
+                              mode=0755
+                              )
+
+    self.assertResourceCalled('File', '/var/log/ambari-logsearch-logfeeder/logfeeder.out',
+                              owner='logfeeder',
+                              group='logfeeder',
+                              mode=0644,
+                              content=''
+                              )
+    self.assertResourceCalled('File', '/etc/ambari-logsearch-logfeeder/conf/logfeeder.properties',
+                              owner='logfeeder',
+                              content=Template('logfeeder.properties.j2')
+                              )
+    self.assertResourceCalled('File', '/etc/ambari-logsearch-logfeeder/conf/logfeeder-env.sh',
+                              owner='logfeeder',
+                              content=InlineTemplate(self.getConfig()['configurations']['logfeeder-env']['content'])
+                              )
+    self.assertResourceCalled('File', '/etc/ambari-logsearch-logfeeder/conf/log4j.xml',
+                              owner='logfeeder',
+                              content=InlineTemplate(self.getConfig()['configurations']['logfeeder-log4j']['content'])
+                              )
+    self.assertResourceCalled('File', '/etc/ambari-logsearch-logfeeder/conf/grok-patterns',
+                              owner='logfeeder',
+                              content=Template('grok-patterns.j2'),
+                              encoding='utf-8'
+                              )
+
+    logfeeder_supported_services = ['accumulo', 'ambari', 'ams', 'atlas', 'falcon', 'hbase', 'hdfs', 'hive', 'kafka',
+                                    'knox', 'logsearch', 'oozie', 'ranger', 'storm', 'yarn', 'zookeeper']
+
+    logfeeder_config_file_names = ['global.config.json', 'output.config.json'] + ['input.config-%s.json' % (tag) for tag
+                                                                                  in logfeeder_supported_services]
+
+    for file_name in logfeeder_config_file_names:
+      self.assertResourceCalled('File', '/etc/ambari-logsearch-logfeeder/conf/' + file_name,
+                                owner='logfeeder',
+                                content=Template(file_name + ".j2")
+                                )
+
+  def test_configure_default(self):
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/logfeeder.py",
+                       classname="LogFeeder",
+                       command="configure",
+                       config_file="default.json",
+                       stack_version=self.STACK_VERSION,
+                       target=RMFTestCase.TARGET_COMMON_SERVICES
+                       )
+
+    self.configureResourcesCalled()
+    self.assertNoMoreResources()
+
+  def test_start_default(self):
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/logfeeder.py",
+                       classname="LogFeeder",
+                       command="start",
+                       config_file="default.json",
+                       stack_version=self.STACK_VERSION,
+                       target=RMFTestCase.TARGET_COMMON_SERVICES
+                       )
+
+    self.configureResourcesCalled()
+    self.assertResourceCalled('Execute', '/usr/lib/ambari-logsearch-logfeeder/run.sh',
+                              environment={
+                                'LOGFEEDER_INCLUDE': '/etc/ambari-logsearch-logfeeder/conf/logfeeder-env.sh'},
+                              user='logfeeder'
+                              )

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_logsearch.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_logsearch.py b/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_logsearch.py
new file mode 100644
index 0000000..46517f0
--- /dev/null
+++ b/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_logsearch.py
@@ -0,0 +1,137 @@
+#!/usr/bin/env python
+
+'''
+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.
+'''
+
+from stacks.utils.RMFTestCase import RMFTestCase, Template, InlineTemplate, StaticFile
+from resource_management.core.exceptions import ComponentIsNotRunning
+from mock.mock import MagicMock, patch
+from resource_management.libraries.script.config_dictionary import UnknownConfiguration
+
+class TestLogSearch(RMFTestCase):
+  COMMON_SERVICES_PACKAGE_DIR = "LOGSEARCH/0.5.0/package"
+  STACK_VERSION = "2.4"
+  
+  def configureResourcesCalled(self):
+    self.assertResourceCalled('Directory', '/var/log/ambari-logsearch-portal',
+                              owner = 'logsearch',
+                              group = 'logsearch',
+                              create_parents = True,
+                              cd_access = 'a',
+                              mode = 0755
+    )
+    self.assertResourceCalled('Directory', '/var/run/ambari-logsearch-portal',
+                              owner = 'logsearch',
+                              group = 'logsearch',
+                              create_parents = True,
+                              cd_access = 'a',
+                              mode = 0755
+    )
+    self.assertResourceCalled('Directory', '/usr/lib/ambari-logsearch-portal',
+                              owner = 'logsearch',
+                              group = 'logsearch',
+                              create_parents = True,
+                              cd_access = 'a',
+                              mode = 0755
+    )
+    self.assertResourceCalled('Directory', '/etc/ambari-logsearch-portal/conf',
+                              owner = 'logsearch',
+                              group = 'logsearch',
+                              create_parents = True,
+                              cd_access = 'a',
+                              mode = 0755
+    )
+    
+    self.assertResourceCalled('File', '/var/log/ambari-logsearch-portal/logsearch.out',
+                              owner = 'logsearch',
+                              group = 'logsearch',
+                              mode = 0644,
+                              content = ''
+    )
+    self.assertResourceCalled('File', '/etc/ambari-logsearch-portal/conf/logsearch.properties',
+                              owner = 'logsearch',
+                              content = Template('logsearch.properties.j2')
+    )
+    self.assertResourceCalled('File', '/etc/ambari-logsearch-portal/conf/log4j.xml',
+                              owner = 'logsearch',
+                              content = InlineTemplate(self.getConfig()['configurations']['logsearch-log4j']['content'])
+    )
+    self.assertResourceCalled('File', '/etc/ambari-logsearch-portal/conf/logsearch-env.sh',
+                              content = InlineTemplate(self.getConfig()['configurations']['logsearch-env']['content']),
+                              mode = 0755,
+                              owner = "logsearch"
+    )
+    self.assertResourceCalled('File', '/etc/ambari-logsearch-portal/conf/solr_configsets/hadoop_logs/conf/solrconfig.xml',
+                              owner = 'logsearch',
+                              content = InlineTemplate(self.getConfig()['configurations']['logsearch-service_logs-solrconfig']['content'])
+    )
+    self.assertResourceCalled('File', '/etc/ambari-logsearch-portal/conf/solr_configsets/audit_logs/conf/solrconfig.xml',
+                              owner = 'logsearch',
+                              content = InlineTemplate(self.getConfig()['configurations']['logsearch-audit_logs-solrconfig']['content'])
+                              )
+    
+    self.assertResourceCalledRegexp('^Execute$', '^export JAVA_HOME=/usr/jdk64/jdk1.7.0_45 ; /usr/lib/ambari-logsearch-solr/server/scripts/cloud-scripts/zkcli.sh -zkhost c6401.ambari.apache.org:None/logsearch -cmd downconfig -confdir /tmp/solr_config_hadoop_logs_0.[0-9]* -confname hadoop_logs$',
+                                    only_if = "^export JAVA_HOME=/usr/jdk64/jdk1.7.0_45 ; /usr/lib/ambari-logsearch-solr/server/scripts/cloud-scripts/zkcli.sh -zkhost c6401.ambari.apache.org:None/logsearch -cmd get /configs/hadoop_logs$"
+    )
+    self.assertResourceCalledRegexp('^Execute$', '^export JAVA_HOME=/usr/jdk64/jdk1.7.0_45 ; /usr/lib/ambari-logsearch-solr/server/scripts/cloud-scripts/zkcli.sh -zkhost c6401.ambari.apache.org:None/logsearch -cmd upconfig -confdir /etc/ambari-logsearch-portal/conf/solr_configsets/hadoop_logs/conf -confname hadoop_logs$',
+                                    not_if = "^test -d /tmp/solr_config_hadoop_logs_0.[0-9]*$"
+    )
+
+    self.assertResourceCalledRegexp('^Execute$', '^export JAVA_HOME=/usr/jdk64/jdk1.7.0_45 ; /usr/lib/ambari-logsearch-solr/server/scripts/cloud-scripts/zkcli.sh -zkhost c6401.ambari.apache.org:None/logsearch -cmd downconfig -confdir /tmp/solr_config_history_0.[0-9]* -confname history$',
+                                    only_if = "^export JAVA_HOME=/usr/jdk64/jdk1.7.0_45 ; /usr/lib/ambari-logsearch-solr/server/scripts/cloud-scripts/zkcli.sh -zkhost c6401.ambari.apache.org:None/logsearch -cmd get /configs/history$"
+    )
+    self.assertResourceCalledRegexp('^Execute$', '^export JAVA_HOME=/usr/jdk64/jdk1.7.0_45 ; /usr/lib/ambari-logsearch-solr/server/scripts/cloud-scripts/zkcli.sh -zkhost c6401.ambari.apache.org:None/logsearch -cmd upconfig -confdir /etc/ambari-logsearch-portal/conf/solr_configsets/history/conf -confname history$',
+                                  not_if = "^test -d /tmp/solr_config_history_0.[0-9]*$"
+    )
+
+    self.assertResourceCalledRegexp('^Execute$', '^export JAVA_HOME=/usr/jdk64/jdk1.7.0_45 ; /usr/lib/ambari-logsearch-solr/server/scripts/cloud-scripts/zkcli.sh -zkhost c6401.ambari.apache.org:None/logsearch -cmd downconfig -confdir /tmp/solr_config_audit_logs_0.[0-9]* -confname audit_logs$',
+                                    only_if = "^export JAVA_HOME=/usr/jdk64/jdk1.7.0_45 ; /usr/lib/ambari-logsearch-solr/server/scripts/cloud-scripts/zkcli.sh -zkhost c6401.ambari.apache.org:None/logsearch -cmd get /configs/audit_logs$"
+    )
+    self.assertResourceCalledRegexp('^Execute$', '^export JAVA_HOME=/usr/jdk64/jdk1.7.0_45 ; /usr/lib/ambari-logsearch-solr/server/scripts/cloud-scripts/zkcli.sh -zkhost c6401.ambari.apache.org:None/logsearch -cmd upconfig -confdir /etc/ambari-logsearch-portal/conf/solr_configsets/audit_logs/conf -confname audit_logs$',
+                                    not_if = "^test -d /tmp/solr_config_audit_logs_0.[0-9]*$"
+    )
+    self.assertResourceCalled('Execute', ('chmod', '-R', 'ugo+r', '/etc/ambari-logsearch-portal/conf/solr_configsets'),
+                              sudo=True
+    )
+  
+  def test_configure_default(self):
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/logsearch.py",
+                       classname = "LogSearch",
+                       command = "configure",
+                       config_file = "default.json",
+                       stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
+    )
+    
+    self.configureResourcesCalled()
+    self.assertNoMoreResources()
+  
+  def test_start_default(self):
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/logsearch.py",
+                       classname = "LogSearch",
+                       command = "start",
+                       config_file = "default.json",
+                       stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
+    )
+    
+    self.configureResourcesCalled()
+    self.assertResourceCalled('Execute', "/usr/lib/ambari-logsearch-portal/run.sh 61888",
+                              environment = {'LOGSEARCH_INCLUDE': '/etc/ambari-logsearch-portal/conf/logsearch-env.sh'},
+                              user = "logsearch"
+    )

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_solr.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_solr.py b/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_solr.py
new file mode 100644
index 0000000..977cd9c
--- /dev/null
+++ b/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_solr.py
@@ -0,0 +1,145 @@
+#!/usr/bin/env python
+
+'''
+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.
+'''
+
+from stacks.utils.RMFTestCase import RMFTestCase, Template, InlineTemplate, StaticFile
+from resource_management.core.exceptions import ComponentIsNotRunning
+from resource_management.libraries.script.config_dictionary import UnknownConfiguration
+
+class TestSolr(RMFTestCase):
+  COMMON_SERVICES_PACKAGE_DIR = "LOGSEARCH/0.5.0/package"
+  STACK_VERSION = "2.4"
+  
+  def configureResourcesCalled(self):
+      self.assertResourceCalled('Directory', '/usr/lib/ambari-logsearch-solr',
+                                owner = 'solr',
+                                group = 'solr',
+                                create_parents = True,
+                                cd_access = 'a',
+                                mode = 0755
+      )
+      self.assertResourceCalled('Directory', '/var/log/ambari-logsearch-solr',
+                                owner = 'solr',
+                                group = 'solr',
+                                create_parents = True,
+                                cd_access = 'a',
+                                mode = 0755
+      )
+      self.assertResourceCalled('Directory', '/var/run/ambari-logsearch-solr',
+                                owner = 'solr',
+                                group = 'solr',
+                                create_parents = True,
+                                cd_access = 'a',
+                                mode = 0755
+      )
+      self.assertResourceCalled('Directory', '/etc/ambari-logsearch-solr/conf',
+                                owner = 'solr',
+                                group = 'solr',
+                                create_parents = True,
+                                cd_access = 'a',
+                                mode = 0755
+      )
+      self.assertResourceCalled('Directory', '/opt/logsearch_solr/data',
+                                owner = 'solr',
+                                group = 'solr',
+                                create_parents = True,
+                                cd_access = 'a',
+                                mode = 0755
+      )
+      self.assertResourceCalled('Directory', '/opt/logsearch_solr/data/resources',
+                                owner = 'solr',
+                                group = 'solr',
+                                create_parents = True,
+                                cd_access = 'a',
+                                mode = 0755
+      )
+      
+      self.assertResourceCalled('File', '/var/log/ambari-logsearch-solr/solr-install.log',
+                                owner = 'solr',
+                                group = 'solr',
+                                mode = 0644,
+                                content = ''
+      )
+      self.assertResourceCalled('File', '/etc/ambari-logsearch-solr/conf/logsearch-solr-env.sh',
+                                owner = 'solr',
+                                mode = 0755,
+                                content = InlineTemplate(self.getConfig()['configurations']['logsearch-solr-env']['content'])
+      )
+      self.assertResourceCalled('File', '/opt/logsearch_solr/data/solr.xml',
+                                owner = 'solr',
+                                content = InlineTemplate(self.getConfig()['configurations']['logsearch-solr-xml']['content'])
+      )
+      self.assertResourceCalled('File', '/etc/ambari-logsearch-solr/conf/log4j.properties',
+                                owner = 'solr',
+                                content = InlineTemplate(self.getConfig()['configurations']['logsearch-solr-log4j']['content'])
+      )
+      self.assertResourceCalled('File', '/opt/logsearch_solr/data/zoo.cfg',
+                                owner = 'solr',
+                                content = Template('zoo.cfg.j2')
+      )
+      self.assertResourceCalled('Execute', 'export JAVA_HOME=/usr/jdk64/jdk1.7.0_45; /usr/lib/ambari-logsearch-solr/server/scripts/cloud-scripts/zkcli.sh -zkhost c6401.ambari.apache.org -cmd makepath /logsearch',
+                                not_if = "export JAVA_HOME=/usr/jdk64/jdk1.7.0_45; /usr/lib/ambari-logsearch-solr/server/scripts/cloud-scripts/zkcli.sh -zkhost c6401.ambari.apache.org -cmd get /logsearch",
+                                ignore_failures = True,
+                                user = "solr"
+      )
+  
+  def test_configure_default(self):
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/solr.py",
+                       classname = "Solr",
+                       command = "configure",
+                       config_file = "default.json",
+                       stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
+    )
+    
+    self.configureResourcesCalled()
+    self.assertNoMoreResources()
+  
+  def test_start_default(self):
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/solr.py",
+                       classname = "Solr",
+                       command = "start",
+                       config_file = "default.json",
+                       stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
+    )
+    
+    self.configureResourcesCalled()
+    self.assertResourceCalled('Execute', "/usr/lib/ambari-logsearch-solr/bin/solr start -cloud -noprompt -s /opt/logsearch_solr/data >> /var/log/ambari-logsearch-solr/solr-install.log 2>&1",
+                              environment = {'SOLR_INCLUDE': '/etc/ambari-logsearch-solr/conf/logsearch-solr-env.sh'},
+                              user = "solr"
+    )
+  
+  def test_stop_default(self):
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/solr.py",
+                       classname = "Solr",
+                       command = "stop",
+                       config_file = "default.json",
+                       stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
+    )
+    
+    self.assertResourceCalled('Execute', '/usr/lib/ambari-logsearch-solr/bin/solr stop -all >> /var/log/ambari-logsearch-solr/solr-install.log',
+                              environment = {'SOLR_INCLUDE': '/etc/ambari-logsearch-solr/conf/logsearch-solr-env.sh'},
+                              user = "solr",
+                              only_if = "test -f /var/run/ambari-logsearch-solr/solr-8886.pid"
+    )
+    self.assertResourceCalled('File', '/var/run/ambari-logsearch-solr/solr-8886.pid',
+                              action = ['delete']
+    )


[6/8] ambari git commit: AMBARI-15806. Initial commit for Logsearch service stack definition (oleewere)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-env.xml b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-env.xml
new file mode 100644
index 0000000..ef6bebf
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-env.xml
@@ -0,0 +1,144 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * 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.
+ */
+-->
+<!-- This is a special config file for properties used to monitor status of the service -->
+<configuration supports_adding_forbidden="true">
+
+  <property>
+    <name>logsearch_pid_dir</name>
+    <value>/var/run/ambari-logsearch-portal</value>
+    <description>Logsearch Process ID Directory</description>
+    <display-name>Logsearch pid dir</display-name>
+  </property>
+
+  <property>
+    <name>logsearch_log_dir</name>
+    <value>/var/log/ambari-logsearch-portal</value>
+    <description>Log directory for Logsearch</description>
+    <display-name>Logsearch log dir</display-name>
+  </property>
+
+  <property>
+    <name>logsearch_user</name>
+    <value>logsearch</value>
+    <property-type>USER</property-type>
+    <description>Logsearch user</description>
+    <display-name>Logsearch User</display-name>
+  </property>
+
+  <property>
+    <name>logsearch_group</name>
+    <value>logsearch</value>
+    <property-type>GROUP</property-type>
+    <description>Logsearch group</description>
+    <display-name>Logsearch Group</display-name>
+  </property>
+
+  <property>
+    <name>logsearch_app_max_memory</name>
+    <value>1g</value>
+    <description>Max memory for LogSearch</description>
+    <display-name>Logearch Max Memory</display-name>
+  </property>
+
+  <property>
+    <name>logsearch_solr_audit_logs_use_ranger</name>
+    <value>false</value>
+    <display-name>Ranger Audit Enabled</display-name>
+    <description>Use Ranger Audit collection. This is supported only if Ranger Solr is installed in SolrCloud mode
+    </description>
+  </property>
+
+  <property>
+    <name>logsearch_debug_enabled</name>
+    <value>false</value>
+    <display-name>Logsearch Debug Enabled</display-name>
+    <description>Enable debug mode for Logsearch Server</description>
+  </property>
+
+  <property>
+    <name>logsearch_debug_port</name>
+    <value>5005</value>
+    <display-name>Logsearch Debug Port</display-name>
+    <description>Debug port for Logsearch Server</description>
+  </property>
+
+  <property>
+    <name>logsearch_solr_audit_logs_zk_node</name>
+    <value>{logsearch_solr_znode}</value>
+    <display-name>Solr Audit Logs Znode</display-name>
+    <description>Only needed if using custom solr cloud. E.g. /audit_logs</description>
+  </property>
+
+  <property>
+    <name>logsearch_solr_audit_logs_zk_quorum</name>
+    <value>{zookeeper_quorum}</value>
+    <display-name>Solr Audit Logs ZK Quorum</display-name>
+    <description>Only needed if using custom solr cloud. E.g. zk1:2181,zk2:2182</description>
+  </property>
+
+  <!-- logsearch-env.sh -->
+
+  <property>
+    <name>content</name>
+    <description>This is the jinja template for logsearch-env.sh file</description>
+    <value>#!/bin/bash
+      # 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.
+
+
+      set -e
+
+      #path containing LogSearch.jar file
+      export LOGSEARCH_PATH={{logsearch_dir}}
+
+      export LOGSEARCH_CONF_DIR={{logsearch_server_conf}}
+
+      export LOGFILE={{logsearch_log_dir}}/logsearch.log
+
+      export PID_FILE={{logsearch_pid_file}}
+
+      export JAVA_HOME={{java64_home}}
+
+      export LOGSEARCH_JAVA_MEM=-Xmx{{logsearch_app_max_memory}}
+      if [ "$LOGSEARCH_JAVA_MEM" = "" ]; then
+      export LOGSEARCH_JAVA_MEM="-Xmx1g"
+      fi
+
+      export LOGSEARCH_DEBUG={{logsearch_debug_enabled}}
+
+      export LOGSEARCH_DEBUG_PORT={{logsearch_debug_port}}
+    </value>
+  </property>
+
+</configuration>  

http://git-wip-us.apache.org/repos/asf/ambari/blob/f903d17f/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-log4j.xml b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-log4j.xml
new file mode 100644
index 0000000..6741f41
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-log4j.xml
@@ -0,0 +1,110 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * 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.
+ */
+-->
+
+<!-- This is a special config file for properties used to monitor status of the service -->
+<configuration supports_adding_forbidden="true">
+
+  <!-- log4j.xml -->
+
+  <property>
+    <name>content</name>
+    <description>This is the jinja template for log4j.xml file for logsearch server</description>
+    <value>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
+&lt;!--
+  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.
+--&gt;
+&lt;!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"&gt;
+&lt;log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"&gt;
+  &lt;appender name="console" class="org.apache.log4j.ConsoleAppender"&gt;
+    &lt;param name="Target" value="System.out" /&gt;
+    &lt;layout class="org.apache.log4j.PatternLayout"&gt;
+      &lt;param name="ConversionPattern" value="%d [%t] %-5p %C{6} (%F:%L) - %m%n" /&gt;
+    &lt;/layout&gt;
+  &lt;/appender&gt;
+
+  &lt;appender name="rolling_file" class="org.apache.log4j.RollingFileAppender"&gt; 
+    &lt;param name="file" value="{{logsearch_log_dir}}/logsearch.log" /&gt; 
+    &lt;param name="append" value="true" /&gt; 
+    &lt;param name="maxFileSize" value="10MB" /&gt; 
+    &lt;param name="maxBackupIndex" value="10" /&gt; 
+    &lt;layout class="org.apache.log4j.PatternLayout"&gt; 
+      &lt;param name="ConversionPattern" value="%d [%t] %-5p %C{6} (%F:%L) - %m%n"/&gt; 
+    &lt;/layout&gt; 
+  &lt;/appender&gt;
+
+  &lt;appender name="audit_rolling_file" class="org.apache.log4j.RollingFileAppender"&gt;
+    &lt;param name="file" value="{{logsearch_log_dir}}/logsearch-audit.log" /&gt;
+    &lt;param name="append" value="true" /&gt;
+    &lt;param name="maxFileSize" value="10MB" /&gt;
+    &lt;param name="maxBackupIndex" value="10" /&gt;
+    &lt;layout class="org.apache.log4j.PatternLayout"&gt;
+      &lt;param name="ConversionPattern" value="%d [%t] %-5p %C{6} (%F:%L) - %m%n"/&gt;
+    &lt;/layout&gt;
+  &lt;/appender&gt;
+
+  &lt;appender name="performance_analyzer" class="org.apache.log4j.RollingFileAppender"&gt;
+    &lt;param name="file" value="{{logsearch_log_dir}}/logsearch-performance.log" /&gt;
+    &lt;param name="Threshold" value="info" /&gt;
+    &lt;param name="append" value="true" /&gt;
+    &lt;param name="maxFileSize" value="10MB" /&gt; 
+    &lt;param name="maxBackupIndex" value="10" /&gt; 
+    &lt;layout class="org.apache.log4j.PatternLayout"&gt;
+      &lt;param name="ConversionPattern" value="%d [%t] %-5p %C{6} (%F:%L) - %m%n" /&gt;
+    &lt;/layout&gt;
+  &lt;/appender&gt;
+
+  &lt;logger name="org.apache.ambari.logsearch.audit" additivity="true"&gt;
+    &lt;appender-ref ref="audit_rolling_file" /&gt;
+  &lt;/logger&gt;
+  
+  &lt;logger name="org.apache.ambari.logsearch.performance" additivity="false"&gt;
+   &lt;appender-ref ref="performance_analyzer" /&gt;
+  &lt;/logger&gt;
+
+  &lt;category name="org.apache.ambari.logsearch" additivity="false"&gt;
+    &lt;priority value="info" /&gt;
+    &lt;appender-ref ref="rolling_file" /&gt;
+  &lt;/category&gt;
+
+  &lt;root&gt;
+    &lt;priority value="warn" /&gt;
+    &lt;appender-ref ref="rolling_file" /&gt;
+  &lt;/root&gt;
+&lt;/log4j:configuration&gt;
+    </value>
+  </property>
+
+
+</configuration>