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/11 18:14:59 UTC

[45/51] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch module (oleewre)

http://git-wip-us.apache.org/repos/asf/ambari/blob/39c85bb8/ambari-logsearch/ambari-logsearch-logfeeder/src/main/scripts/run.sh.j2
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/scripts/run.sh.j2 b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/scripts/run.sh.j2
new file mode 100644
index 0000000..713a73a
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/scripts/run.sh.j2
@@ -0,0 +1,83 @@
+#!/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.
+
+curr_dir=`pwd`
+cd `dirname $0`; script_dir=`pwd`; cd $curr_dir
+
+foreground=0
+if [ "$1" = "-foreground" ]; then
+    foreground=1
+    shift
+fi
+
+JAVA=java
+if [ -x $JAVA_HOME/bin/java ]; then
+    JAVA=$JAVA_HOME/bin/java
+fi
+
+if [ "$LOGFEEDER_JAVA_MEM" = "" ]; then
+    LOGFEEDER_JAVA_MEM="-Xmx512m"
+fi
+
+if [ "$LOGFILE" = "" ]; then
+    LOGFILE="{{logfeeder_log_dir}}/logfeeder.out"
+fi
+
+if [ "$PID_FILE" = "" ]; then
+    LOGFEEDER_PID_DIR=$HOME
+    PID_FILE=$LOGFEEDER_PID_DIR/logsearch-logfeeder-$USER.pid
+fi
+
+if [ "$LOGFEEDER_CONF_DIR" = "" ]; then
+    LOGFEEDER_CONF_DIR="/etc/logfeeder/conf"
+fi
+
+LOGFEEDER_GC_LOGFILE=`dirname $LOGFILE`/logfeeder_gc.log
+LOGFEEDER_GC_OPTS="-XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:$LOGFEEDER_GC_LOGFILE"
+
+#LOGFEEDER_JAVA_OPTS=
+#JMX="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=2098"
+
+if [ $foreground -eq 0 ]; then
+    if [ -f ${PID_FILE} ]; then
+	PID=`cat ${PID_FILE}`
+	if kill -0 $PID 2>/dev/null; then
+	    echo "logfeeder already running (${PID}) killing..."
+	    kill $PID 2>/dev/null
+	    sleep 5
+	    if kill -0 $PID 2>/dev/null; then
+		echo "logfeeder still running. Will kill process forcefully in another 10 seconds..."
+		sleep 10
+		kill -9 $PID 2>/dev/null
+		sleep 2
+	    fi
+	fi
+
+	if kill -0 $PID 2>/dev/null; then
+	    echo "ERROR: Even after all efforts to stop logfeeder, it is still running. pid=$PID. Please manually kill the service and try again."
+	    exit 1
+	fi
+    fi
+
+    echo "Starting logfeeder. Output file=$LOGFILE pid_file=$PID_FILE"
+    #LOGFEEDER_CLI_CLASSPATH=
+    #set -x
+    nohup $JAVA -cp "$LOGFEEDER_CLI_CLASSPATH:/etc/logfeeder/conf:$script_dir/libs/*:$script_dir/classes:$script_dir/LogProcessor.jar" $LOGFEEDER_GC_OPTS $LOGFEEDER_JAVA_MEM $LOGFEEDER_JAVA_OPTS $JMX org.apache.ambari.logfeeder.LogFeeder $* > $LOGFILE 2>&1 &
+    echo $! > $PID_FILE
+else
+    $JAVA -cp "$LOGFEEDER_CLI_CLASSPATH:$LOGFEEDER_CONF_DIR:$script_dir/libs/*:$script_dir/classes:$script_dir/LogProcessor.jar" $LOGFEEDER_JAVA_MEM $LOGFEEDER_JAVA_OPTS $JMX org.apache.ambari.logfeeder.LogFeeder $*
+fi
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/39c85bb8/ambari-logsearch/ambari-logsearch-logfeeder/src/test/java/org/apache/ambari/logfeeder/AppTest.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/test/java/org/apache/ambari/logfeeder/AppTest.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/java/org/apache/ambari/logfeeder/AppTest.java
new file mode 100644
index 0000000..193cb48
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/java/org/apache/ambari/logfeeder/AppTest.java
@@ -0,0 +1,116 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ambari.logfeeder;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.ambari.logfeeder.filter.FilterGrok;
+import org.apache.log4j.Logger;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest extends TestCase {
+  static Logger logger = Logger.getLogger(AppTest.class);
+
+  /**
+   * Create the test case
+   *
+   * @param testName name of the test case
+   */
+  public AppTest(String testName) {
+    super(testName);
+  }
+
+  /**
+   * @return the suite of tests being tested
+   */
+  public static Test suite() {
+    return new TestSuite(AppTest.class);
+  }
+
+  /**
+   * Rigourous Test :-)
+   */
+  public void testApp() {
+    assertTrue(true);
+  }
+
+  public void testGrok() {
+    logger.info("testGrok()");
+    FilterGrok grokFilter = new FilterGrok();
+    try {
+      Map<String, Object> map = new HashMap<String, Object>();
+      map.put("message_pattern",
+        "^%{LOGLEVEL:level}%{SPACE}%{GREEDYDATA:log_message}");
+      grokFilter.loadConfig(map);
+      grokFilter.init();
+      String out = grokFilter.grokParse("INFO This is a test");
+      logger.info("out=" + out);
+
+    } catch (Exception e) {
+      // TODO Auto-generated catch block
+      e.printStackTrace();
+      assertFalse(true);
+    }
+
+    assertTrue(true);
+  }
+
+  public void testGrokUGI() {
+    logger.info("testGrok()");
+    String[] ugis = new String[]{"user1@xyz.com (auth:TOKEN)",
+      "ambari-qa@example.com (auth:kerberos)",
+      "my_user@example.com (auth:kerberos)",
+      "hive/bdurai-dojran-2.novalocal@example.com (auth:kerberos)",
+      "just_me",
+      "ambari-qa (auth:PROXY) via hive/myhost.novalocal@EXAMPLE.COM (auth:KERBEROS)"};
+
+    FilterGrok grokFilter = new FilterGrok();
+    try {
+      Map<String, Object> map = new HashMap<String, Object>();
+      // map.put("message_pattern",
+      // "(?<user>([\\w\\d\\-]+))\\/|(?<user>([\\w\\d\\-]+))@|(?<user>([\\w\\d\\-]+))/[\\w\\d\\-.]+@|(?<user>([\\w\\d.\\-_]+))[\\s(]+");
+      // map.put("message_pattern",
+      // "(?<user>([\\w\\d\\-]+))/[\\w\\d\\-.]+@");
+      // *(auth:(?<auth>[\\w\\d\\-]+))
+      // GOOD: map.put("message_pattern", "(?<user>([\\w\\d\\-]+)).+auth:(?<auth>([\\w\\d\\-]+))");
+      // OK: map.put("message_pattern", "(?<user>([\\w\\d\\-]+)).+auth:(?<auth>([\\w\\d\\-]+))|%{USERNAME:xuser}");
+      //map.put("message_pattern", "%{USERNAME:user}.+auth:%{USERNAME:authType}|%{USERNAME:x_user}");
+      map.put("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}");
+      grokFilter.loadConfig(map);
+      grokFilter.init();
+      for (String ugi : ugis) {
+        String out = grokFilter.grokParse(ugi);
+        logger.info(ugi + "=" + out);
+      }
+
+    } catch (Exception e) {
+      // TODO Auto-generated catch block
+      e.printStackTrace();
+      assertFalse(true);
+    }
+    assertTrue(true);
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/39c85bb8/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/sample_filter.json
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/sample_filter.json b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/sample_filter.json
new file mode 100644
index 0000000..8c64c28
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/sample_filter.json
@@ -0,0 +1,166 @@
+{
+	"filter": {
+		"hdfs_namenode": {
+			"label": "hdfs_namenode",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"yarn_resourcemanager": {
+			"label": "yarn_resourcemanager",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"logsearch_perf": {
+			"label": "logsearch_perf",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"hdfs_secondarynamenode": {
+			"label": "hdfs_secondarynamenode",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"mapred_historyserver": {
+			"label": "mapred_historyserver",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"ams_hbase_master": {
+			"label": "ams_hbase_master",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"ambari_server": {
+			"label": "ambari_server",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"yarn_timelineserver": {
+			"label": "yarn_timelineserver",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"hdfs_datanode": {
+			"label": "hdfs_datanode",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"logsearch_app": {
+			"label": "logsearch_app",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"kafka_statechange": {
+			"label": "kafka_statechange",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"hbase_master": {
+			"label": "hbase_master",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"kafka_server": {
+			"label": "kafka_server",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"oozie_app": {
+			"label": "oozie_app",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"hive_hiveserver2": {
+			"label": "hive_hiveserver2",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"yarn_nodemanager": {
+			"label": "yarn_nodemanager",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"hbase_regionserver": {
+			"label": "hbase_regionserver",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"ambari_agent": {
+			"label": "ambari_agent",
+			"hosts": ["host1","host2"],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": "2016-04-05T08:30:00.000Z"
+		},
+		"logsearch_feeder": {
+			"label": "logsearch_feeder",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"kafka_controller": {
+			"label": "kafka_controller",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"ams_collector": {
+			"label": "ams_collector",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"yarn_jobsummary": {
+			"label": "yarn_jobsummary",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"hive_metastore": {
+			"label": "hive_metastore",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		}
+	},
+	"id": "1459861568220"
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/39c85bb8/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/config/config_audit.json
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/config/config_audit.json b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/config/config_audit.json
new file mode 100644
index 0000000..b7d0a6e
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/config/config_audit.json
@@ -0,0 +1,173 @@
+{
+	"global": {
+		"add_fields": {
+			"cluster": "audit"
+		},
+		"source": "file",
+		"tail": "true",
+		"gen_event_md5": "true",
+		"start_position": "beginning"
+	},
+	"input": [{
+		"type": "hdfs_audit",
+		"rowtype": "hdfs_audit",
+		"path": "{path}/src/test/resources/samples/jsonlogs/audit_log.json"
+	}],
+	"filter": [{
+			"filter": "json",
+			"conditions": {
+				"fields": {
+					"type": [
+						"hdfs_audit"
+					]
+
+				}
+			}
+		}, {
+			"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"
+					}
+
+				}
+
+			}
+
+		}
+
+	],
+
+	"output": [{
+			"is_enabled": "true",
+			"comment": "Output to file for audit logs",
+			"destination": "solr",
+			"url": "http://localhost:8983/solr/audit_logs",
+			"collection": "audit_logs",
+			"number_of_shards": "1",
+			"splits_interval_mins": "100000",
+			"conditions": {
+				"fields": {
+					"rowtype": [
+						"hdfs_audit"
+					]
+				}
+			}
+		}
+
+	]
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/39c85bb8/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/config/config_service.json
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/config/config_service.json b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/config/config_service.json
new file mode 100644
index 0000000..2e96fd7
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/config/config_service.json
@@ -0,0 +1,43 @@
+{
+	"global": {
+		"add_fields": {
+			"cluster": "cluster_name"
+		},
+		"source": "file",
+		"tail": "true",
+		"gen_event_md5": "true",
+		"start_position": "beginning"
+	},
+	"input": [{
+		"type": "logsearch",
+		"rowtype": "service",
+		"path": "{path}/src/test/resources/samples/jsonlogs/service_log.json"
+	}],
+	"filter": [{
+		"filter": "json",
+		"conditions": {
+			"fields": {
+				"type": [
+					"logsearch"
+				]
+			}
+		}
+	}],
+	"output": [{
+		"comment": "Output to solr for service records",
+		"is_enabled": "true",
+		"destination": "solr",
+		"url": "http://localhost:8983/solr/hadoop_logs",
+		"collection": "hadoop_logs",
+		"number_of_shards": "1",
+		"splits_interval_mins": "100000",
+		"conditions": {
+			"fields": {
+				"rowtype": [
+					"service"
+				]
+			}
+		}
+	}]
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/39c85bb8/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/jsonlogs/audit_log.json
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/jsonlogs/audit_log.json b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/jsonlogs/audit_log.json
new file mode 100644
index 0000000..3ffa40d
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/jsonlogs/audit_log.json
@@ -0,0 +1,9 @@
+{"level":"DEBUG","file":"App.java","thread_name":"main","line_number":15,"log_message":"FSNamesystem.audit: allowed\u003dtrue\tugi\u003doozie (auth:SIMPLE)\tip\u003d/10.10.10.41\tcmd\u003dlistStatus\tsrc\u003d/user/oozie/share/lib\tdst\u003dnull\tperm\u003dnull\tproto\u003drpc","logger_name":"logserach.appender.test.App","logtime":"1456917617284"}
+{"level":"DEBUG","file":"App.java","thread_name":"main","line_number":15,"log_message":"FSNamesystem.audit: allowed\u003dtrue\tugi\u003doozie (auth:SIMPLE)\tip\u003d/10.10.10.41\tcmd\u003dlistStatus\tsrc\u003d/user/oozie/share/lib\tdst\u003dnull\tperm\u003dnull\tproto\u003drpc","logger_name":"logserach.appender.test.App","logtime":"1456917617284"}
+{"level":"DEBUG","file":"App.java","thread_name":"main","line_number":15,"log_message":"FSNamesystem.audit: allowed\u003dtrue\tugi\u003doozie (auth:SIMPLE)\tip\u003d/10.10.10.41\tcmd\u003dlistStatus\tsrc\u003d/user/oozie/share/lib\tdst\u003dnull\tperm\u003dnull\tproto\u003drpc","logger_name":"logserach.appender.test.App","logtime":"1456917617284"}
+{"level":"DEBUG","file":"App.java","thread_name":"main","line_number":15,"log_message":"FSNamesystem.audit: allowed\u003dtrue\tugi\u003doozie (auth:SIMPLE)\tip\u003d/10.10.10.41\tcmd\u003dlistStatus\tsrc\u003d/user/oozie/share/lib\tdst\u003dnull\tperm\u003dnull\tproto\u003drpc","logger_name":"logserach.appender.test.App","logtime":"1456917617284"}
+{"level":"DEBUG","file":"App.java","thread_name":"main","line_number":15,"log_message":"FSNamesystem.audit: allowed\u003dtrue\tugi\u003doozie (auth:SIMPLE)\tip\u003d/10.10.10.41\tcmd\u003dlistStatus\tsrc\u003d/user/oozie/share/lib\tdst\u003dnull\tperm\u003dnull\tproto\u003drpc","logger_name":"logserach.appender.test.App","logtime":"1456917617284"}
+{"level":"DEBUG","file":"App.java","thread_name":"main","line_number":15,"log_message":"FSNamesystem.audit: allowed\u003dtrue\tugi\u003doozie (auth:SIMPLE)\tip\u003d/10.10.10.41\tcmd\u003dlistStatus\tsrc\u003d/user/oozie/share/lib\tdst\u003dnull\tperm\u003dnull\tproto\u003drpc","logger_name":"logserach.appender.test.App","logtime":"1456917617284"}
+{"level":"DEBUG","file":"App.java","thread_name":"main","line_number":15,"log_message":"FSNamesystem.audit: allowed\u003dtrue\tugi\u003doozie (auth:SIMPLE)\tip\u003d/10.10.10.41\tcmd\u003dlistStatus\tsrc\u003d/user/oozie/share/lib\tdst\u003dnull\tperm\u003dnull\tproto\u003drpc","logger_name":"logserach.appender.test.App","logtime":"1456917617284"}
+{"level":"DEBUG","file":"App.java","thread_name":"main","line_number":15,"log_message":"FSNamesystem.audit: allowed\u003dtrue\tugi\u003doozie (auth:SIMPLE)\tip\u003d/10.10.10.41\tcmd\u003dlistStatus\tsrc\u003d/user/oozie/share/lib\tdst\u003dnull\tperm\u003dnull\tproto\u003drpc","logger_name":"logserach.appender.test.App","logtime":"1456917617284"}
+{"level":"DEBUG","file":"App.java","thread_name":"main","line_number":15,"log_message":"FSNamesystem.audit: allowed\u003dtrue\tugi\u003doozie (auth:SIMPLE)\tip\u003d/10.10.10.41\tcmd\u003dlistStatus\tsrc\u003d/user/oozie/share/lib\tdst\u003dnull\tperm\u003dnull\tproto\u003drpc","logger_name":"logserach.appender.test.App","logtime":"1456917717290"}

http://git-wip-us.apache.org/repos/asf/ambari/blob/39c85bb8/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/jsonlogs/service_log.json
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/jsonlogs/service_log.json b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/jsonlogs/service_log.json
new file mode 100644
index 0000000..e0a3728
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/jsonlogs/service_log.json
@@ -0,0 +1,7 @@
+{"level":"INFO","file":"LogSearch.java","thread_name":"org.apache.ambari.logsearch.LogSearch.main()","line_number":48,"log_message":"Starting logsearch server...","logger_name":"org.apache.ambari.logsearch.LogSearch","logtime":"1457000117434"}
+{"level":"INFO","file":"PropertiesLoaderSupport.java","thread_name":"org.apache.ambari.logsearch.LogSearch.main()","line_number":177,"log_message":"Loading properties file from class path resource [logsearch.properties]","logger_name":"org.apache.ambari.logsearch.util.PropertiesUtil","logtime":"1457000118770"}
+{"level":"INFO","file":"PropertiesLoaderSupport.java","thread_name":"org.apache.ambari.logsearch.LogSearch.main()","line_number":177,"log_message":"Loading properties file from class path resource [custom.properties]","logger_name":"org.apache.ambari.logsearch.util.PropertiesUtil","logtime":"1457000118774"}
+{"level":"INFO","file":"SolrDaoBase.java","thread_name":"org.apache.ambari.logsearch.LogSearch.main()","line_number":83,"log_message":"connectToSolr() zkHosts\u003dnull, collection\u003daudit_logs, url\u003dhttp://localhost:8983/solr","logger_name":"org.apache.ambari.logsearch.dao.SolrDaoBase","logtime":"1457000118940"}
+{"level":"INFO","file":"SolrDaoBase.java","thread_name":"org.apache.ambari.logsearch.LogSearch.main()","line_number":104,"log_message":"Connencting to  solr : http://localhost:8983/solr/audit_logs","logger_name":"org.apache.ambari.logsearch.dao.SolrDaoBase","logtime":"1457000118942"}
+{"level":"ERROR","file":"AuditSolrDao.java","thread_name":"org.apache.ambari.logsearch.LogSearch.main()","line_number":53,"log_message":"Error while connecting to Solr for audit logs : solrUrl\u003dhttp://localhost:8983/solr, zkHosts\u003dnull, collection\u003daudit_logs\norg.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://localhost:8983/solr/audit_logs: Expected mime type application/octet-stream but got text/html. \u003chtml\u003e\n\u003chead\u003e\n\u003cmeta http-equiv\u003d\"Content-Type\" content\u003d\"text/html; charset\u003dUTF-8\"/\u003e\n\u003ctitle\u003eError 404 Not Found\u003c/title\u003e\n\u003c/head\u003e\n\u003cbody\u003e\u003ch2\u003eHTTP ERROR 404\u003c/h2\u003e\n\u003cp\u003eProblem accessing /solr/audit_logs/admin/collections. Reason:\n\u003cpre\u003e    Not Found\u003c/pre\u003e\u003c/p\u003e\u003chr\u003e\u003ci\u003e\u003csmall\u003ePowered by Jetty://\u003c/small\u003e\u003c/i\u003e\u003chr/\u003e\n\n\u003c/body\
 u003e\n\u003c/html\u003e\n\n\tat org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:528)\n\tat org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:234)\n\tat org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:226)\n\tat org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:135)\n\tat org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:152)\n\tat org.apache.ambari.logsearch.dao.SolrDaoBase.setupCollections(SolrDaoBase.java:169)\n\tat org.apache.ambari.logsearch.dao.AuditSolrDao.postConstructor(AuditSolrDao.java:50)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:498)\n\tat org.springframework.beans.factory.annotation.InitDestroyAnnotatio
 nBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:346)\n\tat org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:299)\n\tat org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:132)\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1448)\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(Abstract
 AutowireCapableBeanFactory.java:456)\n\tat org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)\n\tat org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:605)\n\tat org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:925)\n\tat org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:472)\n\tat org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)\n\tat org.spri
 ngframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)\n\tat org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)\n\tat org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:549)\n\tat org.mortbay.jetty.servlet.Context.startContext(Context.java:136)\n\tat org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1282)\n\tat org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:518)\n\tat org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:499)\n\tat org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)\n\tat org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)\n\tat org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:156)\n\tat org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)\n\tat org.mortbay.jetty.handler.HandlerWrapper.doStart(Hand
 lerWrapper.java:130)\n\tat org.mortbay.jetty.Server.doStart(Server.java:224)\n\tat org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)\n\tat org.apache.hadoop.http.HttpServer2.start(HttpServer2.java:857)\n\tat org.apache.ambari.logsearch.LogSearch.main(LogSearch.java:50)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:498)\n\tat org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)\n\tat java.lang.Thread.run(Thread.java:745)\n","logger_name":"org.apache.ambari.logsearch.dao.AuditSolrDao","logtime":"1457000119375"}
+{"level":"INFO","file":"SolrDaoBase.java","thread_name":"org.apache.ambari.logsearch.LogSearch.main()","line_number":83,"log_message":"connectToSolr() zkHosts\u003dnull, collection\u003dhadoop_logs, url\u003dhttp://localhost:8983/solr","logger_name":"org.apache.ambari.logsearch.dao.SolrDaoBase","logtime":"1457000119392"}

http://git-wip-us.apache.org/repos/asf/ambari/blob/39c85bb8/ambari-logsearch/ambari-logsearch-portal/.gitignore
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/.gitignore b/ambari-logsearch/ambari-logsearch-portal/.gitignore
new file mode 100644
index 0000000..07e0389
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/.gitignore
@@ -0,0 +1,9 @@
+target
+.settings
+.classpath
+.project
+/bin/
+node_modules/
+logs/
+node/
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/39c85bb8/ambari-logsearch/ambari-logsearch-portal/README.md
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/README.md b/ambari-logsearch/ambari-logsearch-portal/README.md
new file mode 100644
index 0000000..126f651
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/README.md
@@ -0,0 +1,55 @@
+<!--
+{% comment %}
+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.
+{% endcomment %}
+-->
+
+#Compilation
+mvn clean compile package
+
+#Deploy
+##Copy to remote
+copy target/logsearch-portal.tar.gz to host machine
+##Setup environment
+```bash
+mkdir /opt/logsearch
+cd /opt/logsearch
+tar xfz ~/logsearch-portal.tar.gz 
+```
+#Create Solr Collection
+*Edit for log retention days (default is 7 days)*
+```bash
+vi solr_configsets/hadoop_logs/conf/solrconfig.xml
+```
+```
+    <processor class="solr.DefaultValueUpdateProcessorFactory">
+        <str name="fieldName">_ttl_</str>
+        <str name="value">+7DAYS</str>
+    </processor>
+```
+```bash
+./create_collections.sh $SOLR_HOME $NUM_SHARDS $NUM_OF_REPLICATIONS `pwd`/solr_configsets
+```
+```bash
+vi classes/logsearch.properties
+```
+```
+solr.zkhosts=$ZK1:2181,$ZK2:2181,$ZK3:2181/solr
+```
+*This script will stop logsearch if it is running and restart it*
+```bash
+./run.sh
+```

http://git-wip-us.apache.org/repos/asf/ambari/blob/39c85bb8/ambari-logsearch/ambari-logsearch-portal/build.properties
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/build.properties b/ambari-logsearch/ambari-logsearch-portal/build.properties
new file mode 100644
index 0000000..1cd118a
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/build.properties
@@ -0,0 +1,23 @@
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+
+# log4j configuration used during build and unit tests
+
+TOMCAT_HOME=/Library/Tomcat/Home
+app.work.dir=${builddir}/build/work
+app.war.dir=${app.work.dir}/war
+app.pkg.dir=${app.work.dir}/pkg
+
+app.dev.war.dir=${app.work.dir}/webapps/logsearch
+app.war.name=logsearch.war
+
+app.target.dir=${builddir}/target/classes/webapps/app
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/39c85bb8/ambari-logsearch/ambari-logsearch-portal/build.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/build.xml b/ambari-logsearch/ambari-logsearch-portal/build.xml
new file mode 100644
index 0000000..22c7938
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/build.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+   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.
+-->
+<project basedir="." default="build" name="logsearch">
+  <property environment="env"/>
+  <property name="debuglevel" value="source,lines,vars"/>
+  <dirname property="builddir" file="build.xml"/>
+  <property name="target" value="1.7"/>
+  <property name="source" value="1.7"/>
+  <property file="local.properties"/>
+  <property file="build.properties"/>
+
+  <target name="init">
+  </target>
+  <target name="build"/>
+  <target name="create-dev-war">
+    <copy todir="${app.target.dir}" includeEmptyDirs="no">
+      <fileset dir="src/main/webapp" excludes="**/*.class"/>
+    </copy>
+  </target>
+
+  <target name="package">
+    <delete dir="target/package"/>
+    <copy todir="target/package/libs" includeEmptyDirs="no">
+      <fileset dir="target/libs"/>
+    </copy>
+    <copy todir="target/package/" includeEmptyDirs="no">
+      <fileset file="target/LogSearch.jar"/>
+    </copy>
+    <copy todir="target/package/classes" includeEmptyDirs="no">
+      <fileset dir="target/classes"/>
+    </copy>
+    <copy todir="target/package/solr_configsets" includeEmptyDirs="yes">
+      <fileset dir="src/main/configsets"/>
+    </copy>
+    <copy todir="target/package" includeEmptyDirs="no">
+      <fileset file="src/main/scripts/*"/>
+    </copy>
+    <chmod file="target/package/*.sh" perm="755"/>
+    <tar compression="gzip" destfile="target/ambari-logsearch-portal.tar.gz">
+      <tarfileset mode="755" dir="target/package">
+        <include name="*.sh"/>
+      </tarfileset>
+      <tarfileset mode="664" dir="target/package">
+        <exclude name="*.sh"/>
+      </tarfileset>
+    </tar>
+
+  </target>
+
+
+  <target description="Build all projects which reference this project. Useful to propagate changes."
+          name="build-refprojects"/>
+</project>

http://git-wip-us.apache.org/repos/asf/ambari/blob/39c85bb8/ambari-logsearch/ambari-logsearch-portal/gulpfile.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/gulpfile.js b/ambari-logsearch/ambari-logsearch-portal/gulpfile.js
new file mode 100644
index 0000000..88ab1b3
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/gulpfile.js
@@ -0,0 +1,136 @@
+/**
+ * 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.
+ */
+
+'use strict';
+
+var gulp = require('gulp'),
+    minifyHTML = require('gulp-minify-html'),
+    minifyCss = require('gulp-minify-css'),
+    Del = require('del'),
+    Yargs = require('yargs'),
+    RunSequence = require('run-sequence'),
+    shell = require('gulp-shell');
+
+
+var argv = Yargs.argv;
+
+
+/**
+ * Build Settings
+ */
+var settings = {
+
+    /*
+     * Environment to build our application for
+     *
+     * If we have passed an environment via a
+     * CLI option, then use that. If not attempt
+     * to use the NODE_ENV. If not set, use production.
+     */
+    environment: !!argv.env ? argv.env : process.env.NODE_ENV || 'p',
+
+    productionFolder: 'target/webapp-build',
+
+    devFolder: 'src/main/webapp'
+
+};
+
+
+
+/**
+ * Clean Task
+ *
+ * Clears the build folder from our
+ * previous builds files.
+ */
+gulp.task('clean', function(cb) {
+    return Del([
+        settings.productionFolder
+    ], cb);
+
+});
+
+/**
+ * minify JS Task
+ *
+ */
+gulp.task('minify-js', ['clean'], shell.task([
+    'node production/r.js -o production/build.js'
+]));
+
+
+/**
+ * minify CSS Task
+ *
+ */
+
+gulp.task('minify-css', ['minify-js'], function() {
+    return gulp.src(settings.productionFolder+'/**/*.css')
+        .pipe(minifyCss({
+            compatibility: 'ie8'
+        }))
+        .pipe(gulp.dest(settings.productionFolder+'/'));
+});
+/**
+ * minify HTML Task
+ *
+ */
+// gulp.task('minify-html', function() {
+//     return gulp.src(settings.productionFolder+'/**/*.html')
+//         .pipe(minifyHTML({
+//             empty: true
+//         }))
+//         .pipe(gulp.dest(settings.productionFolder+'/'));
+// });
+
+/**
+ * Build Task
+ *
+ */
+/*gulp.task('builProduction', ['minify-css'], shell.task([
+    'mvn clean compile package -Denv=' + settings.productionFolder
+]));
+
+gulp.task('runProduction', ['builProduction'], shell.task([
+    'mvn exec:java -Denv=' + settings.productionFolder
+]));
+
+gulp.task('runDev', ['buildDev'], shell.task([
+    'mvn exec:java -DwebAppDir=' + settings.devFolder
+]));
+
+gulp.task('buildDev', shell.task([
+    'mvn clean compile package -DwebAppDir=' + settings.devFolder
+]));*/
+/**
+ * Default Task
+ *
+ * Run the above tasks in the correct order
+ */
+gulp.task('default', function(cb) {
+
+/*    if (settings.environment) {
+        if (settings.environment == "p") {
+            gulp.run(['runProduction']);
+        }
+        if (settings.environment == "d") {
+            gulp.run(['runDev']);
+        }
+    }
+    return gutil.log("All Done!");*/
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/39c85bb8/ambari-logsearch/ambari-logsearch-portal/package.json
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/package.json b/ambari-logsearch/ambari-logsearch-portal/package.json
new file mode 100644
index 0000000..dcc1fef
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/package.json
@@ -0,0 +1,21 @@
+{
+  "name": "logsearch-portal",
+  "version": "1.0.0",
+  "description": "<!-- {% comment %} 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",
+  "main": "gulpfile.js",
+  "dependencies": {
+    "del": "^2.2.0",
+    "gulp": "^3.9.0",
+    "gulp-minify-css": "^1.2.3",
+    "gulp-minify-html": "^1.0.5",
+    "gulp-shell": "^0.5.2",
+    "run-sequence": "^1.1.5",
+    "yargs": "^3.32.0"
+  },
+  "devDependencies": {},
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "author": "",
+  "license": "ISC"
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/39c85bb8/ambari-logsearch/ambari-logsearch-portal/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/pom.xml b/ambari-logsearch/ambari-logsearch-portal/pom.xml
new file mode 100755
index 0000000..9c5ba72
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/pom.xml
@@ -0,0 +1,547 @@
+<?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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <artifactId>ambari-logsearch</artifactId>
+    <groupId>org.apache.ambari</groupId>
+    <version>2.0.0.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.ambari</groupId>
+  <artifactId>ambari-logsearch-portal</artifactId>
+  <packaging>jar</packaging>
+  <version>2.0.0.0-SNAPSHOT</version>
+  <url>http://maven.apache.org</url>
+  <name>Ambari Logsearch Portal</name>
+  <properties>
+    <spring.version>4.2.5.RELEASE</spring.version>
+    <spring.security.version>4.0.4.RELEASE</spring.security.version>
+    <spring.ldap.version>2.0.4.RELEASE</spring.ldap.version>
+  </properties>
+  <profiles>
+    <!-- Dev Profile Start -->
+    <profile>
+      <id>dev</id>
+      <activation>
+        <activeByDefault>true</activeByDefault>
+      </activation>
+      <build>
+        <finalName>LogSearch</finalName>
+        <pluginManagement>
+          <plugins>
+            <plugin>
+              <artifactId>maven-compiler-plugin</artifactId>
+              <version>3.0</version>
+            </plugin>
+            <plugin>
+              <artifactId>maven-dependency-plugin</artifactId>
+              <version>2.8</version>
+            </plugin>
+          </plugins>
+        </pluginManagement>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-compiler-plugin</artifactId>
+            <version>3.0</version>
+            <configuration>
+              <source>1.7</source>
+              <target>1.7</target>
+            </configuration>
+          </plugin>
+          <!-- copying resources UI -->
+          <plugin>
+            <artifactId>maven-resources-plugin</artifactId>
+            <version>2.6</version>
+            <executions>
+              <execution>
+                <id>copy-resources</id>
+                <phase>process-resources</phase>
+                <goals>
+                  <goal>copy-resources</goal>
+                </goals>
+                <configuration>
+                  <outputDirectory>${basedir}/target/classes/webapps/app</outputDirectory>
+                  <resources>
+                    <resource>
+                      <directory>src/main/webapp</directory>
+                      <filtering>false</filtering>
+                    </resource>
+                  </resources>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+          <!-- Exec main class plugin -->
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>exec-maven-plugin</artifactId>
+            <version>1.2.1</version>
+            <executions>
+              <execution>
+                <goals>
+                  <goal>java</goal>
+                </goals>
+              </execution>
+            </executions>
+            <configuration>
+              <mainClass>org.apache.ambari.logsearch.LogSearch</mainClass>
+              <!-- <arguments> <argument></argument> </arguments> -->
+            </configuration>
+          </plugin>
+          <!-- copy-dependencies -->
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-dependency-plugin</artifactId>
+            <version>2.8</version>
+            <executions>
+              <execution>
+                <id>copy-dependencies</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>copy-dependencies</goal>
+                </goals>
+                <configuration>
+                  <artifactItems>*</artifactItems>
+                  <outputAbsoluteArtifactFilename>true</outputAbsoluteArtifactFilename>
+                  <outputDirectory>${basedir}/target/libs</outputDirectory>
+                  <overWriteReleases>false</overWriteReleases>
+                  <overWriteSnapshots>false</overWriteSnapshots>
+                  <overWriteIfNewer>true</overWriteIfNewer>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+          <!-- - -->
+          <!-- ant pacakge -->
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-antrun-plugin</artifactId>
+            <version>1.7</version>
+            <executions>
+              <execution>
+                <phase>package</phase>
+                <configuration>
+                  <target>
+                    <!-- <taskdef resource="build.properties" classpathref="maven.plugin.classpath" /> -->
+                    <ant antfile="build.xml">
+                      <target name="package"/>
+                    </ant>
+                  </target>
+                </configuration>
+                <goals>
+                  <goal>run</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+          <plugin>
+            <groupId>org.apache.rat</groupId>
+            <artifactId>apache-rat-plugin</artifactId>
+            <configuration>
+              <excludes>
+                <exclude>src/main/webapp/libs/**/*</exclude>
+                <exclude>production/r.js</exclude>
+                <exclude>src/main/configsets/hadoop_logs/conf/managed-schema</exclude>
+                <exclude>src/main/webapp/robots.txt</exclude>
+                <exclude>src/main/webapp/styles/animate.css</exclude>
+                <exclude>**/*.json</exclude>
+                <exclude>src/main/webapp/styles/visualsearch.css</exclude>
+              </excludes>
+            </configuration>
+            <executions>
+              <execution>
+                <phase>test</phase>
+                <goals>
+                  <goal>check</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+          <!-- /ant package -->
+        </plugins>
+      </build>
+    </profile>
+    <!-- Dev Profile End -->
+    <!-- Production Profile Start -->
+    <profile>
+      <id>production</id>
+      <build>
+        <finalName>LogSearch</finalName>
+        <pluginManagement>
+          <plugins>
+            <plugin>
+              <artifactId>maven-compiler-plugin</artifactId>
+              <version>3.0</version>
+            </plugin>
+            <plugin>
+              <artifactId>maven-dependency-plugin</artifactId>
+              <version>2.8</version>
+            </plugin>
+          </plugins>
+        </pluginManagement>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-compiler-plugin</artifactId>
+            <version>3.0</version>
+            <configuration>
+              <source>1.7</source>
+              <target>1.7</target>
+            </configuration>
+          </plugin>
+          <!-- copying resources UI -->
+          <plugin>
+            <artifactId>maven-resources-plugin</artifactId>
+            <version>2.6</version>
+            <executions>
+              <execution>
+                <id>copy-resources</id>
+                <phase>process-resources</phase>
+                <goals>
+                  <goal>copy-resources</goal>
+                </goals>
+                <configuration>
+                  <outputDirectory>${basedir}/target/classes/webapps/app</outputDirectory>
+                  <resources>
+                    <resource>
+                      <directory>target/webapp-build</directory>
+                      <filtering>false</filtering>
+                    </resource>
+                  </resources>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+          <!-- Exec main class plugin -->
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>exec-maven-plugin</artifactId>
+            <version>1.2.1</version>
+            <executions>
+              <execution>
+                <goals>
+                  <goal>java</goal>
+                </goals>
+              </execution>
+            </executions>
+            <configuration>
+              <mainClass>org.apache.ambari.logsearch.LogSearch</mainClass>
+              <!-- <arguments> <argument></argument> </arguments> -->
+            </configuration>
+          </plugin>
+          <!-- copy-dependencies -->
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-dependency-plugin</artifactId>
+            <version>2.8</version>
+            <executions>
+              <execution>
+                <id>copy-dependencies</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>copy-dependencies</goal>
+                </goals>
+                <configuration>
+                  <artifactItems>*</artifactItems>
+                  <outputAbsoluteArtifactFilename>true</outputAbsoluteArtifactFilename>
+                  <outputDirectory>${basedir}/target/libs</outputDirectory>
+                  <overWriteReleases>false</overWriteReleases>
+                  <overWriteSnapshots>false</overWriteSnapshots>
+                  <overWriteIfNewer>true</overWriteIfNewer>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+          <!-- - -->
+          <!-- ant pacakge -->
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-antrun-plugin</artifactId>
+            <version>1.7</version>
+            <executions>
+              <execution>
+                <phase>package</phase>
+                <configuration>
+                  <target>
+                    <!-- <taskdef resource="build.properties" classpathref="maven.plugin.classpath" /> -->
+                    <ant antfile="build.xml">
+                      <target name="package"/>
+                    </ant>
+                  </target>
+                </configuration>
+                <goals>
+                  <goal>run</goal>
+                </goals>
+              </execution>
+              <!-- <execution>
+                <id>Packag Install</id>
+                <phase>generate-resources</phase>
+                <configuration>
+                  <target>
+                    <exec executable="npm">
+                      <arg value="install" />
+                    </exec>
+                  </target>
+                </configuration>
+                <goals>
+                  <goal>run</goal>
+                </goals>
+              </execution>
+              <execution>
+                <id>Js Packaging</id>
+                <phase>generate-resources</phase>
+                <configuration>
+                  <target>
+                    <exec executable="gulp">
+                      <arg value="minify-css" />
+                    </exec>
+                  </target>
+                </configuration>
+                <goals>
+                  <goal>run</goal>
+                </goals>
+              </execution> -->
+            </executions>
+          </plugin>
+          <plugin>
+            <groupId>org.apache.rat</groupId>
+            <artifactId>apache-rat-plugin</artifactId>
+            <configuration>
+              <excludes>
+                <exclude>**/*</exclude>
+              </excludes>
+            </configuration>
+            <executions>
+              <execution>
+                <phase>test</phase>
+                <goals>
+                  <goal>check</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+    <!-- Production Profile End -->
+    <profile>
+      <id>skipMinify</id>
+      <activation>
+        <activeByDefault>false</activeByDefault>
+      </activation>
+      <build>
+        <finalName>LogSearch</finalName>
+        <pluginManagement>
+          <plugins>
+            <plugin>
+              <artifactId>maven-compiler-plugin</artifactId>
+              <version>3.0</version>
+            </plugin>
+            <plugin>
+              <artifactId>maven-dependency-plugin</artifactId>
+              <version>2.8</version>
+            </plugin>
+          </plugins>
+        </pluginManagement>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-compiler-plugin</artifactId>
+            <version>3.0</version>
+            <configuration>
+              <source>1.7</source>
+              <target>1.7</target>
+            </configuration>
+          </plugin>
+          <!-- copying resources UI -->
+          <plugin>
+            <artifactId>maven-resources-plugin</artifactId>
+            <version>2.6</version>
+            <executions>
+              <execution>
+                <id>copy-resources</id>
+                <phase>process-resources</phase>
+                <goals>
+                  <goal>copy-resources</goal>
+                </goals>
+                <configuration>
+                  <outputDirectory>${basedir}/target/classes/webapps/app</outputDirectory>
+                  <resources>
+                    <resource>
+                      <directory>target/webapp-build</directory>
+                      <filtering>false</filtering>
+                    </resource>
+                  </resources>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+          <!-- Exec main class plugin -->
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>exec-maven-plugin</artifactId>
+            <version>1.2.1</version>
+            <executions>
+              <execution>
+                <goals>
+                  <goal>java</goal>
+                </goals>
+              </execution>
+            </executions>
+            <configuration>
+              <mainClass>org.apache.ambari.logsearch.LogSearch</mainClass>
+              <!-- <arguments> <argument></argument> </arguments> -->
+            </configuration>
+          </plugin>
+          <!-- copy-dependencies -->
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-dependency-plugin</artifactId>
+            <version>2.8</version>
+            <executions>
+              <execution>
+                <id>copy-dependencies</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>copy-dependencies</goal>
+                </goals>
+                <configuration>
+                  <artifactItems>*</artifactItems>
+                  <outputAbsoluteArtifactFilename>true</outputAbsoluteArtifactFilename>
+                  <outputDirectory>${basedir}/target/libs</outputDirectory>
+                  <overWriteReleases>false</overWriteReleases>
+                  <overWriteSnapshots>false</overWriteSnapshots>
+                  <overWriteIfNewer>true</overWriteIfNewer>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+          <!-- - -->
+          <!-- ant pacakge -->
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-antrun-plugin</artifactId>
+            <version>1.7</version>
+            <executions>
+              <execution>
+                <phase>package</phase>
+                <configuration>
+                  <target>
+                    <!-- <taskdef resource="build.properties" classpathref="maven.plugin.classpath" 
+                      /> -->
+                    <ant antfile="build.xml">
+                      <target name="package"/>
+                    </ant>
+                  </target>
+                </configuration>
+                <goals>
+                  <goal>run</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+  <dependencies>
+    <!-- Spring dependencies -->
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-beans</artifactId>
+      <version>${spring.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-context</artifactId>
+      <version>${spring.version}</version>
+    </dependency>
+    <!-- Spring Security -->
+    <dependency>
+      <groupId>org.springframework.security</groupId>
+      <artifactId>spring-security-web</artifactId>
+      <version>${spring.security.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.security</groupId>
+      <artifactId>spring-security-core</artifactId>
+      <version>${spring.security.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.security</groupId>
+      <artifactId>spring-security-config</artifactId>
+      <version>${spring.security.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.springframework.ldap</groupId>
+      <artifactId>spring-ldap-core</artifactId>
+      <version>${spring.ldap.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.security</groupId>
+      <artifactId>spring-security-ldap</artifactId>
+      <version>${spring.security.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>com.sun.jersey.contribs</groupId>
+      <artifactId>jersey-spring</artifactId>
+      <version>1.19</version>
+      <exclusions>
+        <exclusion>
+          <groupId>org.springframework</groupId>
+          <artifactId>*</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>javax.servlet-api</artifactId>
+      <version>3.1.0</version>
+    </dependency>
+    <dependency>
+      <groupId>log4j</groupId>
+      <artifactId>log4j</artifactId>
+      <version>1.2.17</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.solr</groupId>
+      <artifactId>solr-solrj</artifactId>
+      <version>${solr.version}</version>
+    </dependency>
+    <!-- Hadoop -->
+    <dependency>
+      <groupId>commons-httpclient</groupId>
+      <artifactId>commons-httpclient</artifactId>
+      <version>3.0.1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.hadoop</groupId>
+      <artifactId>hadoop-common</artifactId>
+      <version>2.7.0</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+      <version>2.4</version>
+    </dependency>
+
+  </dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/ambari/blob/39c85bb8/ambari-logsearch/ambari-logsearch-portal/production/build.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/production/build.js b/ambari-logsearch/ambari-logsearch-portal/production/build.js
new file mode 100644
index 0000000..afeea67
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/production/build.js
@@ -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.
+*/
+
+{
+    appDir: "../src/main/webapp",
+    baseUrl: "scripts",
+    dir: "../target/webapp-build",
+    modules: [
+        {
+            name: "Init"
+        }
+    ]
+}