ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject [07/55] [abbrv] ambari git commit: AMBARI-18310. Refactor logsearch portal side code - Part 2 (oleewere)
Date Mon, 07 Nov 2016 20:51:30 GMT
http://git-wip-us.apache.org/repos/asf/ambari/blob/cbfa083d/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/solr/metrics/SolrMetricsLoader.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/solr/metrics/SolrMetricsLoader.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/solr/metrics/SolrMetricsLoader.java
deleted file mode 100644
index 53e2ca2..0000000
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/solr/metrics/SolrMetricsLoader.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.ambari.logsearch.solr.metrics;
-
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Map;
-import java.util.Timer;
-import java.util.TimerTask;
-import java.util.TreeMap;
-
-import javax.management.MalformedObjectNameException;
-
-import org.apache.ambari.logsearch.common.PropertiesHelper;
-import org.apache.ambari.logsearch.solr.AmbariSolrCloudClient;
-import org.apache.ambari.logsearch.solr.AmbariSolrCloudClientBuilder;
-import org.apache.commons.lang.StringUtils;
-import org.apache.hadoop.metrics2.sink.timeline.TimelineMetric;
-import org.apache.hadoop.metrics2.sink.timeline.TimelineMetrics;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class SolrMetricsLoader extends TimerTask {
-  private static final Logger LOG = LoggerFactory.getLogger(SolrMetricsLoader.class);
-
-  private static final int RETRY = 3;
-  private static final int MAX_METRIC_SIZE= 1000;
-
-  private final String solrHost;
-  private final SolrJmxAdapter solrJmxAdapter;
-  private final SolrAmsClient solrAmsClient;
-  
-  private final TimelineMetrics metrics = new TimelineMetrics();
-
-  public SolrMetricsLoader(String solrHost, int solrJmxPort, String collectorHost) throws IOException {
-    this.solrHost = solrHost;
-    this.solrJmxAdapter = new SolrJmxAdapter(solrHost, solrJmxPort);
-    this.solrAmsClient = new SolrAmsClient(collectorHost);
-
-    solrJmxAdapter.connect();
-  }
-
-  @Override
-  public void run() {
-    LOG.info("Loading Solr Metrics for the host " + solrHost);
-
-    addCpuUsageMetric();
-    addHeapMemoryUsageMetric();
-    addIndexSizeMetric();
-
-    emitMetrics();
-    removeOverTheLimitMetrics();
-  }
-
-  private void addCpuUsageMetric() {
-    Exception lastException = null;
-    for (int retries = 0; retries < RETRY; retries++) {
-      try {
-        double processCpuLoad = solrJmxAdapter.getProcessCpuLoad();
-        addMetric("logsearch.solr.cpu.usage", "Float", processCpuLoad);
-        return;
-      } catch (MalformedObjectNameException e) {
-        lastException = e;
-        try {
-          solrJmxAdapter.reConnect();
-        } catch (IOException e1) {
-        }
-      }
-    }
-
-    LOG.info("Could not load solr cpu usage metric, last exception:", lastException);
-  }
-
-  private void addHeapMemoryUsageMetric() {
-    Exception lastException = null;
-    for (int retries = 0; retries < RETRY; retries++) {
-      try {
-        Map<String, Long> memoryData = solrJmxAdapter.getMemoryData();
-        addMetric("jvm.JvmMetrics.MemHeapUsedM", "Long", memoryData.get("heapMemoryUsed").doubleValue() / 1024 / 1024);
-        addMetric("jvm.JvmMetrics.MemHeapCommittedM", "Long", memoryData.get("heapMemoryCommitted").doubleValue() / 1024 / 1024);
-        addMetric("jvm.JvmMetrics.MemHeapMaxM", "Long", memoryData.get("heapMemoryMax").doubleValue() / 1024 / 1024);
-        addMetric("jvm.JvmMetrics.MemNonHeapUsedM", "Long", memoryData.get("nonHeapMemoryUsed").doubleValue() / 1024 / 1024);
-        addMetric("jvm.JvmMetrics.MemNonHeapCommittedM", "Long", memoryData.get("nonHeapMemoryCommitted").doubleValue() / 1024 / 1024);
-        addMetric("jvm.JvmMetrics.MemNonHeapMaxM", "Long", memoryData.get("nonHeapMemoryMax").doubleValue() / 1024 / 1024);
-        return;
-      } catch (MalformedObjectNameException e) {
-        lastException = e;
-        try {
-          solrJmxAdapter.reConnect();
-        } catch (IOException e1) {
-        }
-      }
-    }
-
-    LOG.info("Could not load solr heap memory usage metric, last exception:", lastException);
-  }
-
-  private void addIndexSizeMetric() {
-    Exception lastException = null;
-    for (int retries = 0; retries < RETRY; retries++) {
-      try {
-        double indexSize = solrJmxAdapter.getIndexSize();
-        addMetric("logsearch.solr.index.size", "Long", indexSize / 1024 / 1024 / 1024);
-        return;
-      } catch (Exception e) {
-        lastException = e;
-        try {
-          solrJmxAdapter.reConnect();
-        } catch (IOException e1) {
-        }
-      }
-    }
-
-    LOG.info("Could not load solr index size metric, last exception:", lastException);
-  }
-
-  private void addMetric(String metricName, String type, Double value) {
-    Long currMS = System.currentTimeMillis();
-
-    TimelineMetric metric = new TimelineMetric();
-    metric.setMetricName(metricName);
-    metric.setHostName(solrHost);
-    metric.setAppId("infra-solr");
-    metric.setStartTime(currMS);
-    metric.setType(type);
-    metric.setTimestamp(currMS);
-    metric.getMetricValues().put(currMS, value);
-
-    metrics.addOrMergeTimelineMetric(metric);
-  }
-
-  private void emitMetrics() {
-    Exception lastException = null;
-    for (int retries = 0; retries < RETRY; retries++) {
-      try {
-        if (solrAmsClient.emitMetrics(metrics)) {
-          metrics.getMetrics().clear();
-          return;
-        }
-      } catch (Exception e) {
-        lastException = e;
-      }
-    }
-
-    LOG.info("Could not emit metrics, last exception:", lastException);
-  }
-
-  private void removeOverTheLimitMetrics() {
-    for (TimelineMetric metric : metrics.getMetrics()) {
-      TreeMap<Long, Double> metricValues = metric.getMetricValues();
-      while (metricValues.size() > MAX_METRIC_SIZE) {
-        metricValues.remove(metricValues.firstKey());
-      }
-    }
-  }
-
-  public static void startSolrMetricsLoaderTasks() {
-    try {
-      String collectorHosts = PropertiesHelper.getProperty("logsearch.solr.metrics.collector.hosts");
-      if (StringUtils.isEmpty(collectorHosts)) {
-        LOG.warn("No Ambari Metrics service is available, no Solr metrics will be loaded!");
-        return;
-      }
-
-      int solrJmxPort = PropertiesHelper.getIntProperty("logsearch.solr.jmx.port");
-
-      String zkConnectString = PropertiesHelper.getProperty("logsearch.solr.zk_connect_string");
-      AmbariSolrCloudClient ambariSolrCloudClient = new AmbariSolrCloudClientBuilder()
-          .withZkConnectString(zkConnectString)
-          .build();
-
-      Collection<String> solrHosts = ambariSolrCloudClient.getSolrHosts();
-      for (String solrHost : solrHosts) {
-        SolrMetricsLoader sml = new SolrMetricsLoader(solrHost, solrJmxPort, collectorHosts);
-        Timer timer = new Timer("Solr Metrics Loader - " + solrHost, true);
-        timer.scheduleAtFixedRate(sml, 0, 10000);
-      }
-    } catch (Exception e) {
-      LOG.warn("Could not start solr metric loader tasks", e);
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/cbfa083d/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/solr/model/SolrAuditLogData.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/solr/model/SolrAuditLogData.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/solr/model/SolrAuditLogData.java
index a3f59f7..0cf05a6 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/solr/model/SolrAuditLogData.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/solr/model/SolrAuditLogData.java
@@ -69,7 +69,7 @@ public class SolrAuditLogData extends SolrCommonLogData implements AuditLogData
   private String repo;
 
   @Field("repoType")
-  private String repoType;
+  private Integer repoType;
 
   @Field("reqData")
   private String requestData;
@@ -188,12 +188,12 @@ public class SolrAuditLogData extends SolrCommonLogData implements AuditLogData
   }
 
   @Override
-  public String getRepoType() {
+  public Integer getRepoType() {
     return repoType;
   }
 
   @Override
-  public void setRepoType(String repoType) {
+  public void setRepoType(Integer repoType) {
     this.repoType = repoType;
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/cbfa083d/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/authenticate/LogsearchLogoutSuccessHandler.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/authenticate/LogsearchLogoutSuccessHandler.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/authenticate/LogsearchLogoutSuccessHandler.java
index 5da1c97..c20e383 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/authenticate/LogsearchLogoutSuccessHandler.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/authenticate/LogsearchLogoutSuccessHandler.java
@@ -36,6 +36,6 @@ public class LogsearchLogoutSuccessHandler extends SimpleUrlLogoutSuccessHandler
     public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication)
       throws IOException, ServletException {
       logger.debug("LogsearchLogoutSuccessHandler ::: onLogoutSuccess");
-      response.sendRedirect("/login.html");
+      response.sendRedirect("/index.html");
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/cbfa083d/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchAuthenticationEntryPoint.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchAuthenticationEntryPoint.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchAuthenticationEntryPoint.java
index 1b24c06..1831697 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchAuthenticationEntryPoint.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchAuthenticationEntryPoint.java
@@ -28,7 +28,7 @@ import org.apache.log4j.Logger;
 import org.springframework.security.core.AuthenticationException;
 import org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint;
 
-class LogsearchAuthenticationEntryPoint extends LoginUrlAuthenticationEntryPoint {
+public class LogsearchAuthenticationEntryPoint extends LoginUrlAuthenticationEntryPoint {
   private static final Logger logger = Logger.getLogger(LogsearchAuthenticationEntryPoint.class);
 
   public LogsearchAuthenticationEntryPoint(String loginFormUrl) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/cbfa083d/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchKRBAuthenticationFilter.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchKRBAuthenticationFilter.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchKRBAuthenticationFilter.java
index 29fd5b2..8cd435b 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchKRBAuthenticationFilter.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchKRBAuthenticationFilter.java
@@ -61,6 +61,7 @@ import org.apache.hadoop.security.authentication.server.KerberosAuthenticationHa
 import org.apache.hadoop.security.authentication.server.PseudoAuthenticationHandler;
 import org.apache.hadoop.security.authentication.util.KerberosName;
 import org.springframework.security.web.authentication.WebAuthenticationDetails;
+import org.springframework.stereotype.Component;
 
 public class LogsearchKRBAuthenticationFilter extends LogsearchKrbFilter {
   private static final Logger logger = LoggerFactory.getLogger(LogsearchKRBAuthenticationFilter.class);

http://git-wip-us.apache.org/repos/asf/ambari/blob/cbfa083d/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchSecurityContextFormationFilter.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchSecurityContextFormationFilter.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchSecurityContextFormationFilter.java
index a34fbd0..1320278 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchSecurityContextFormationFilter.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchSecurityContextFormationFilter.java
@@ -38,6 +38,7 @@ import org.apache.log4j.Logger;
 import org.springframework.security.authentication.AnonymousAuthenticationToken;
 import org.springframework.security.core.Authentication;
 import org.springframework.security.core.context.SecurityContextHolder;
+import org.springframework.stereotype.Component;
 import org.springframework.web.filter.GenericFilterBean;
 
 public class LogsearchSecurityContextFormationFilter extends GenericFilterBean {

http://git-wip-us.apache.org/repos/asf/ambari/blob/cbfa083d/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchUsernamePasswordAuthenticationFilter.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchUsernamePasswordAuthenticationFilter.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchUsernamePasswordAuthenticationFilter.java
index 2c83001..85688a2 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchUsernamePasswordAuthenticationFilter.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchUsernamePasswordAuthenticationFilter.java
@@ -20,11 +20,13 @@ package org.apache.ambari.logsearch.web.filters;
 
 import java.io.IOException;
 
+import javax.inject.Inject;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.log4j.Logger;
+import org.springframework.security.authentication.AuthenticationManager;
 import org.springframework.security.core.AuthenticationException;
 import org.springframework.security.web.authentication.RememberMeServices;
 import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;

http://git-wip-us.apache.org/repos/asf/ambari/blob/cbfa083d/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/listeners/SpringEventListener.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/listeners/SpringEventListener.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/listeners/SpringEventListener.java
deleted file mode 100644
index fc6a594..0000000
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/listeners/SpringEventListener.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.ambari.logsearch.web.listeners;
-
-import org.apache.log4j.Logger;
-import org.springframework.context.ApplicationListener;
-import org.springframework.security.authentication.event.AbstractAuthenticationEvent;
-
-public class SpringEventListener implements ApplicationListener<AbstractAuthenticationEvent> {
-  private static final Logger logger = Logger.getLogger(SpringEventListener.class);
-
-  @Override
-  public void onApplicationEvent(AbstractAuthenticationEvent event) {
-    logger.trace(" Inside onApplicationEvent  SpringEventListener");
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/cbfa083d/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchAbstractAuthenticationProvider.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchAbstractAuthenticationProvider.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchAbstractAuthenticationProvider.java
index 0c102c3..eab33a1 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchAbstractAuthenticationProvider.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchAbstractAuthenticationProvider.java
@@ -65,14 +65,4 @@ public abstract class LogsearchAbstractAuthenticationProvider implements Authent
     return isEnable;
   }
 
-  /**
-   * Check authentication provider is enable or disable
-   * 
-   * @return boolean
-   */
-  public boolean isEnable() {
-    // default is disabled
-    return false;
-  }
-
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/cbfa083d/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchAuthenticationProvider.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchAuthenticationProvider.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchAuthenticationProvider.java
index 3534818..05104b4 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchAuthenticationProvider.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchAuthenticationProvider.java
@@ -26,7 +26,6 @@ import org.apache.log4j.Logger;
 import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
 import org.springframework.security.core.Authentication;
 import org.springframework.security.core.AuthenticationException;
-import org.springframework.security.core.userdetails.UserDetailsService;
 import org.springframework.security.web.authentication.WebAuthenticationDetails;
 import org.springframework.stereotype.Component;
 
@@ -41,19 +40,19 @@ public class LogsearchAuthenticationProvider extends
     .getLogger("org.apache.ambari.logsearch.audit");
 
   @Inject
-  UserDao userDao;
+  private UserDao userDao;
 
   @Inject
-  LogsearchLdapAuthenticationProvider ldapAuthenticationProvider;
+  private LogsearchLdapAuthenticationProvider ldapAuthenticationProvider;
 
   @Inject
-  LogsearchFileAuthenticationProvider fileAuthenticationProvider;
+  private LogsearchFileAuthenticationProvider fileAuthenticationProvider;
 
   @Inject
-  LogsearchSimpleAuthenticationProvider simpleAuthenticationProvider;
+  private LogsearchSimpleAuthenticationProvider simpleAuthenticationProvider;
 
   @Inject
-  LogsearchExternalServerAuthenticationProvider externalServerAuthenticationProvider;
+  private LogsearchExternalServerAuthenticationProvider externalServerAuthenticationProvider;
 
   @Override
   public Authentication authenticate(Authentication authentication)
@@ -128,7 +127,7 @@ public class LogsearchAuthenticationProvider extends
       authentication = fileAuthenticationProvider.authenticate(authentication);
     } else if (authMethod.equals(AUTH_METHOD.SIMPLE)) {
       authentication = simpleAuthenticationProvider.authenticate(authentication);
-    }else if (authMethod.equals(AUTH_METHOD.EXTERNAL_AUTH)) {
+    } else if (authMethod.equals(AUTH_METHOD.EXTERNAL_AUTH)) {
       authentication = externalServerAuthenticationProvider.authenticate(authentication);
     } else {
       logger.error("Invalid authentication method :" + authMethod.name());

http://git-wip-us.apache.org/repos/asf/ambari/blob/cbfa083d/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchExternalServerAuthenticationProvider.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchExternalServerAuthenticationProvider.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchExternalServerAuthenticationProvider.java
index a06a381..d398bdc 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchExternalServerAuthenticationProvider.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchExternalServerAuthenticationProvider.java
@@ -21,7 +21,6 @@ package org.apache.ambari.logsearch.web.security;
 import java.util.ArrayList;
 import java.util.List;
 
-import javax.annotation.PostConstruct;
 import javax.inject.Inject;
 
 import org.apache.ambari.logsearch.common.ExternalServerClient;
@@ -114,7 +113,7 @@ public class LogsearchExternalServerAuthenticationProvider extends
   @Override
   public Authentication authenticate(Authentication authentication)
       throws AuthenticationException {
-    if (!this.isEnable()) {
+    if (!authConfig.isAuthExternalEnabled()) {
       LOG.debug("external server auth is disabled.");
       return authentication;
     }
@@ -173,13 +172,4 @@ public class LogsearchExternalServerAuthenticationProvider extends
     }
     return false;
   }
-
-  /**
-   * Return true/false based on EXTERNAL_AUTH authentication method is
-   * enabled/disabled return boolean
-   */
-  @Override
-  public boolean isEnable() {
-    return isEnable(AUTH_METHOD.EXTERNAL_AUTH);
-  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/cbfa083d/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchFileAuthenticationProvider.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchFileAuthenticationProvider.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchFileAuthenticationProvider.java
index 180de31..9662266 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchFileAuthenticationProvider.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchFileAuthenticationProvider.java
@@ -20,6 +20,7 @@ package org.apache.ambari.logsearch.web.security;
 
 import java.util.Collection;
 
+import org.apache.ambari.logsearch.conf.AuthConfig;
 import org.apache.ambari.logsearch.util.CommonUtil;
 import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.commons.lang.StringUtils;
@@ -41,11 +42,14 @@ public class LogsearchFileAuthenticationProvider extends LogsearchAbstractAuthen
   private static Logger logger = Logger.getLogger(LogsearchFileAuthenticationProvider.class);
 
   @Inject
+  private AuthConfig authConfig;
+
+  @Inject
   private UserDetailsService userDetailsService;
 
   @Override
   public Authentication authenticate(Authentication authentication) throws AuthenticationException {
-    if (!this.isEnable()) {
+    if (!authConfig.isAuthFileEnabled()) {
       logger.debug("File auth is disabled.");
       return authentication;
     }
@@ -80,9 +84,4 @@ public class LogsearchFileAuthenticationProvider extends LogsearchAbstractAuthen
     authentication = new UsernamePasswordAuthenticationToken(username, encPassword, authorities);
     return authentication;
   }
-
-  @Override
-  public boolean isEnable() {
-    return isEnable(AUTH_METHOD.FILE);
-  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/cbfa083d/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchLdapAuthenticationProvider.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchLdapAuthenticationProvider.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchLdapAuthenticationProvider.java
index 742cd9b..f6c7df0 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchLdapAuthenticationProvider.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchLdapAuthenticationProvider.java
@@ -20,6 +20,7 @@ package org.apache.ambari.logsearch.web.security;
 
 import java.util.List;
 
+import org.apache.ambari.logsearch.conf.AuthConfig;
 import org.apache.log4j.Logger;
 import org.springframework.ldap.CommunicationException;
 import org.springframework.ldap.core.support.LdapContextSource;
@@ -31,6 +32,9 @@ import org.springframework.security.ldap.authentication.LdapAuthenticationProvid
 import org.springframework.security.ldap.search.FilterBasedLdapUserSearch;
 import org.springframework.stereotype.Component;
 
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+
 @Component
 public class LogsearchLdapAuthenticationProvider extends
   LogsearchAbstractAuthenticationProvider {
@@ -42,9 +46,16 @@ public class LogsearchLdapAuthenticationProvider extends
   private static LdapAuthenticationProvider ldapAuthProvider = null;
   private String logStatement = "";
 
+  @Inject
+  private AuthConfig authConfig;
+
   public LogsearchLdapAuthenticationProvider() {
+  }
+
+  @PostConstruct
+  public void postConstruct() {
     logger.debug("Creating object of ldap auth provider ");
-    if (this.isEnable()) {
+    if (authConfig.isAuthLdapEnabled()) {
       ldapAuthProvider = loadLdapAuthenticationProvider();
     } else {
       logger.info("Ldap auth is disabled");
@@ -54,7 +65,7 @@ public class LogsearchLdapAuthenticationProvider extends
   @Override
   public Authentication authenticate(Authentication authentication)
     throws AuthenticationException {
-    if (!this.isEnable()) {
+    if (!authConfig.isAuthLdapEnabled()) {
       logger.debug("Ldap auth is disabled");
       return authentication;
     }
@@ -98,7 +109,7 @@ public class LogsearchLdapAuthenticationProvider extends
    *
    * @return corresponding LDAP authentication provider
    */
-  LdapAuthenticationProvider loadLdapAuthenticationProvider() {
+  private LdapAuthenticationProvider loadLdapAuthenticationProvider() {
     if (reloadLdapServerProperties()) {
       logger.info("LDAP Properties changed - rebuilding Context");
       LdapContextSource springSecurityContextSource = new LdapContextSource();
@@ -173,9 +184,4 @@ public class LogsearchLdapAuthenticationProvider extends
     return false;
   }
 
-  @Override
-  public boolean isEnable() {
-    return isEnable(AUTH_METHOD.LDAP);
-  }
-
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/cbfa083d/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchLdapBindAuthenticator.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchLdapBindAuthenticator.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchLdapBindAuthenticator.java
index f9207b1..10f7507 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchLdapBindAuthenticator.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchLdapBindAuthenticator.java
@@ -40,69 +40,7 @@ public class LogsearchLdapBindAuthenticator extends BindAuthenticator {
 
   @Override
   public DirContextOperations authenticate(Authentication authentication) {
-
-    DirContextOperations user = super.authenticate(authentication);
-
-    return setAmbariAdminAttr(user);
-  }
-
-  /**
-   * Checks whether user is a member of ambari administrators group in LDAP.
-   * If yes, sets user's ambari_admin attribute to true
-   *
-   * @param user
-   * @return
-   */
-  private DirContextOperations setAmbariAdminAttr(DirContextOperations user) {
-    String baseDn = ldapServerProperties.getBaseDN().toLowerCase();
-    String groupBase = ldapServerProperties.getGroupBase().toLowerCase();
-    String groupObjectClass = ldapServerProperties.getGroupObjectClass();
-    String groupMembershipAttr = ldapServerProperties
-      .getGroupMembershipAttr();
-    String adminGroupMappingRules = ldapServerProperties
-      .getAdminGroupMappingRules();
-    final String groupNamingAttribute = ldapServerProperties
-      .getGroupNamingAttr();
-    String groupSearchFilter = ldapServerProperties.getGroupSearchFilter();
-
-    // If groupBase is set incorrectly or isn't set - search in BaseDn
-    int indexOfBaseDn = groupBase.indexOf(baseDn);
-    groupBase = indexOfBaseDn <= 0 ? "" : groupBase.substring(0,
-      indexOfBaseDn - 1);
-
-    StringBuilder filterBuilder = new StringBuilder();
-
-    filterBuilder.append("(&(");
-    filterBuilder.append(groupMembershipAttr);
-    filterBuilder.append("=");
-    filterBuilder.append(user.getNameInNamespace());// DN
-
-    if ((groupSearchFilter == null) || groupSearchFilter.equals("")) {
-      // If groupSearchFilter is not specified, build it from other
-      // authorization
-      // group properties
-      filterBuilder.append(")(objectclass=");
-      filterBuilder.append(groupObjectClass);
-      filterBuilder.append(")(|");
-      String[] adminGroupMappingRegexs = adminGroupMappingRules
-        .split(",");
-      for (String adminGroupMappingRegex : adminGroupMappingRegexs) {
-        filterBuilder.append("(");
-        filterBuilder.append(groupNamingAttribute);
-        filterBuilder.append("=");
-        filterBuilder.append(adminGroupMappingRegex);
-        filterBuilder.append(")");
-      }
-      filterBuilder.append(")");
-    } else {
-      filterBuilder.append(")");
-      filterBuilder.append(groupSearchFilter);
-    }
-    filterBuilder.append(")");
-
-    logger.info("filter=" + filterBuilder);
-    // TODO: Filter is not used anywhere
-    return user;
+    return super.authenticate(authentication);
   }
 
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/cbfa083d/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchSimpleAuthenticationProvider.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchSimpleAuthenticationProvider.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchSimpleAuthenticationProvider.java
index ec2516c..5dc1c1f 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchSimpleAuthenticationProvider.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchSimpleAuthenticationProvider.java
@@ -18,6 +18,7 @@
  */
 package org.apache.ambari.logsearch.web.security;
 
+import org.apache.ambari.logsearch.conf.AuthConfig;
 import org.apache.ambari.logsearch.web.model.User;
 import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.commons.lang.StringUtils;
@@ -28,14 +29,19 @@ import org.springframework.security.core.Authentication;
 import org.springframework.security.core.AuthenticationException;
 import org.springframework.stereotype.Component;
 
+import javax.inject.Inject;
+
 @Component
 public class LogsearchSimpleAuthenticationProvider extends LogsearchAbstractAuthenticationProvider {
 
   private static Logger logger = Logger.getLogger(LogsearchSimpleAuthenticationProvider.class);
 
+  @Inject
+  private AuthConfig authConfig;
+
   @Override
   public Authentication authenticate(Authentication authentication) throws AuthenticationException {
-    if (!this.isEnable()) {
+    if (!authConfig.isAuthSimpleEnabled()) {
       logger.debug("Simple auth is disabled");
       return authentication;
     }
@@ -64,9 +70,4 @@ public class LogsearchSimpleAuthenticationProvider extends LogsearchAbstractAuth
       return false;
     }
   }
-
-  @Override
-  public boolean isEnable() {
-    return this.isEnable(AUTH_METHOD.SIMPLE);
-  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/cbfa083d/ambari-logsearch/ambari-logsearch-portal/src/main/resources/log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/resources/log4j.xml b/ambari-logsearch/ambari-logsearch-portal/src/main/resources/log4j.xml
index ad96558..60b09cd 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/resources/log4j.xml
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/resources/log4j.xml
@@ -57,7 +57,7 @@
 
  <appender name="rolling_file_json"
   class="org.apache.ambari.logsearch.appender.LogsearchRollingFileAppender">
-  <param name="file" value="logs/logsearch-app.json" />
+  <param name="file" value="target/logs/logsearch-app.json" />
   <param name="Threshold" value="info" />
   <param name="append" value="true" />
   <param name="maxFileSize" value="10MB" />
@@ -67,7 +67,7 @@
 
   <appender name="audit_rolling_file_json"
     class="org.apache.ambari.logsearch.appender.LogsearchRollingFileAppender">
-    <param name="file" value="logs/logsearch-audit.json" />
+    <param name="file" value="target/logs/logsearch-audit.json" />
     <param name="Threshold" value="info" />
     <param name="append" value="true" />
     <param name="maxFileSize" value="10MB" />
@@ -77,7 +77,7 @@
 
   <appender name="performance_analyzer_json"
     class="org.apache.ambari.logsearch.appender.LogsearchRollingFileAppender">
-    <param name="file" value="logs/logsearch-performance.json" />
+    <param name="file" value="target/logs/logsearch-performance.json" />
     <param name="Threshold" value="info" />
     <param name="append" value="true" />
     <param name="maxFileSize" value="10MB" />

http://git-wip-us.apache.org/repos/asf/ambari/blob/cbfa083d/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/META-INF/security-applicationContext.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/META-INF/security-applicationContext.xml b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/META-INF/security-applicationContext.xml
deleted file mode 100644
index 9961cd0..0000000
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/META-INF/security-applicationContext.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  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.
--->
-<beans:beans xmlns="http://www.springframework.org/schema/security"
-xmlns:beans="http://www.springframework.org/schema/beans"
-xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-xmlns:security="http://www.springframework.org/schema/security"
-xsi:schemaLocation="http://www.springframework.org/schema/beans
-http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
-http://www.springframework.org/schema/security
-http://www.springframework.org/schema/security/spring-security-4.0.xsd">
-  
-    <security:http pattern="/login.html" security="none" />
-    <security:http pattern="/styles/**" security="none" />
-    <security:http pattern="/fonts/**" security="none" />
-    <security:http pattern="/scripts/**" security="none" />
-    <security:http pattern="/libs/**" security="none" />
-    <security:http pattern="/images/**" security="none" />
-    <security:http pattern="/templates/**" security="none" />
-    <security:http pattern="/favicon.ico" security="none" />
-    <security:http pattern="/api/v1/public/**" security="none" />
-    <security:http pattern="/api/v1/swagger.json" security="none"/>
-    <security:http pattern="/api/v1/swagger.yaml" security="none"/>
-  	
-	<security:http disable-url-rewriting="true" use-expressions="true" create-session="always" entry-point-ref="authenticationProcessingFilterEntryPoint">
-		<csrf disabled="true"/> 
-		<security:session-management session-fixation-protection="newSession" />
-		<intercept-url pattern="/**" access="isAuthenticated()"/>       
-        <security:custom-filter ref="krbAuthenticationFilter" after="FIRST" />
-		<security:custom-filter position="FORM_LOGIN_FILTER" ref="logsearchUsernamePasswordAuthenticationFilter"/>
-		<security:custom-filter position="LAST" ref="userContextFormationFilter"/>
-		<security:logout delete-cookies="JSESSIONID" logout-url="/logout.html" success-handler-ref="logsearchLogoutSuccessHandler" />
-		<http-basic entry-point-ref="authenticationProcessingFilterEntryPoint"/>
-	</security:http>
-
-	<beans:bean id="userContextFormationFilter" class="org.apache.ambari.logsearch.web.filters.LogsearchSecurityContextFormationFilter"/>
-
-    <beans:bean id="krbAuthenticationFilter" class="org.apache.ambari.logsearch.web.filters.LogsearchKRBAuthenticationFilter"/>
-  
-	<beans:bean id="logsearchUsernamePasswordAuthenticationFilter" class="org.apache.ambari.logsearch.web.filters.LogsearchUsernamePasswordAuthenticationFilter">
-		<beans:property name="authenticationManager" ref="authenticationManager"/>
-		<beans:property name="authenticationSuccessHandler" ref="authSuccessHandler"/>
-		<beans:property name="authenticationFailureHandler"	ref="authFailureHandler"/>
-	</beans:bean>
-  
-	<beans:bean id="authenticationProcessingFilterEntryPoint" class="org.apache.ambari.logsearch.web.filters.LogsearchAuthenticationEntryPoint">
-		<beans:constructor-arg index="0" value="/login.html"/>
-		<beans:property name="forceHttps" value="false"/>
-	</beans:bean>
-
-	<beans:bean id="authSuccessHandler" class="org.apache.ambari.logsearch.web.authenticate.LogsearchAuthSuccessHandler">
-	</beans:bean>
-
-	<beans:bean id="authFailureHandler" class="org.apache.ambari.logsearch.web.authenticate.LogsearchAuthFailureHandler">
-	</beans:bean>
-
-	<beans:bean id="logsearchLogoutSuccessHandler" class="org.apache.ambari.logsearch.web.authenticate.LogsearchLogoutSuccessHandler">
-	</beans:bean>
-	
-	 <beans:bean id="logsearchAuthenticationProvider" class="org.apache.ambari.logsearch.web.security.LogsearchAuthenticationProvider" >
- 	</beans:bean>
-
-	<security:authentication-manager alias="authenticationManager">
-         <security:authentication-provider ref="logsearchAuthenticationProvider"/>
-	</security:authentication-manager>
-	
-	<beans:bean id="securityEventListener" class ="org.apache.ambari.logsearch.web.listeners.SpringEventListener"/>
-	
-</beans:beans>

http://git-wip-us.apache.org/repos/asf/ambari/blob/cbfa083d/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/WEB-INF/web.xml b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/WEB-INF/web.xml
deleted file mode 100755
index 0f1beec..0000000
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/WEB-INF/web.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  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.
--->
-<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
-
-  <listener>
-    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
-  </listener>
-  <context-param>
-    <param-name>contextClass</param-name>
-    <param-value>
-      org.springframework.web.context.support.AnnotationConfigWebApplicationContext
-    </param-value>
-  </context-param>
-  <context-param>
-    <param-name>contextConfigLocation</param-name>
-    <param-value>org.apache.ambari.logsearch.conf.ApplicationConfig</param-value>
-  </context-param>
-
-	<listener>
-		<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
-	</listener>
-	<filter>
-		<filter-name>springSecurityFilterChain</filter-name>
-		<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
-	</filter>
-
-	<filter-mapping>
-		<filter-name>springSecurityFilterChain</filter-name>
-		<url-pattern>/*</url-pattern>
-	</filter-mapping>
-  
-	<!-- Servlet mapping for REST -->
-	<servlet>
-		<servlet-name>REST service</servlet-name>
-		<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
-		<init-param>
-			<param-name>jersey.config.server.provider.packages</param-name>
-			<param-value>org.apache.ambari.logsearch.rest,io.swagger.jaxrs.listing</param-value>
-		</init-param>
-		<load-on-startup>1</load-on-startup>
-	</servlet>
-	  <servlet-mapping>
-		<servlet-name>REST service</servlet-name>
-		<url-pattern>/api/v1/*</url-pattern>
-	</servlet-mapping>
-
-</web-app>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/cbfa083d/ambari-logsearch/docker/test-config/logfeeder/logfeeder.properties
----------------------------------------------------------------------
diff --git a/ambari-logsearch/docker/test-config/logfeeder/logfeeder.properties b/ambari-logsearch/docker/test-config/logfeeder/logfeeder.properties
index b588a2d..f930ec9 100644
--- a/ambari-logsearch/docker/test-config/logfeeder/logfeeder.properties
+++ b/ambari-logsearch/docker/test-config/logfeeder/logfeeder.properties
@@ -21,7 +21,8 @@ logfeeder.config.files=shipper-conf/global.config.json,\
   shipper-conf/input.config-logsearch.json,\
   shipper-conf/input.config-hst.json,\
   shipper-conf/input.config-system_message.json,\
-  shipper-conf/input.config-secure_log.json
+  shipper-conf/input.config-secure_log.json,\
+  shipper-conf/input.config-hdfs.json
 logfeeder.log.filter.enable=true
 logfeeder.solr.config.interval=5
 logfeeder.solr.core.config.name=history

http://git-wip-us.apache.org/repos/asf/ambari/blob/cbfa083d/ambari-logsearch/docker/test-config/logfeeder/shipper-conf/input.config-hdfs.json
----------------------------------------------------------------------
diff --git a/ambari-logsearch/docker/test-config/logfeeder/shipper-conf/input.config-hdfs.json b/ambari-logsearch/docker/test-config/logfeeder/shipper-conf/input.config-hdfs.json
new file mode 100644
index 0000000..d975b0d
--- /dev/null
+++ b/ambari-logsearch/docker/test-config/logfeeder/shipper-conf/input.config-hdfs.json
@@ -0,0 +1,172 @@
+{
+  "input": [
+    {
+      "type": "hdfs_audit",
+      "rowtype": "audit",
+      "is_enabled": "true",
+      "add_fields": {
+        "logType": "HDFSAudit",
+        "enforcer": "hadoop-acl",
+        "repoType": "1",
+        "repo": "hdfs"
+      },
+      "path": "/root/test-logs/hdfs-audit/hdfs-audit.log"
+    }
+  ],
+  "filter": [
+    {
+      "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":{
+            "target_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/cbfa083d/ambari-logsearch/docker/test-logs/hdfs-audit/hdfs-audit.log
----------------------------------------------------------------------
diff --git a/ambari-logsearch/docker/test-logs/hdfs-audit/hdfs-audit.log b/ambari-logsearch/docker/test-logs/hdfs-audit/hdfs-audit.log
new file mode 100644
index 0000000..a646cc4
--- /dev/null
+++ b/ambari-logsearch/docker/test-logs/hdfs-audit/hdfs-audit.log
@@ -0,0 +1,4 @@
+2016-03-18 10:00:47,252 INFO FSNamesystem.audit: allowed=true	ugi=ambari-qa (auth:SIMPLE)	ip=/192.168.64.102	cmd=getfileinfo	src=/ats/active	dst=null	perm=null	proto=rpc	callerContext=HIVE_QUERY_ID:ambari-qa_20160317200111_223b3079-4a2d-431c-920f-6ba37ed63e9f
+2016-03-18 10:00:48,939 INFO FSNamesystem.audit: allowed=true	ugi=ambari-qa (auth:SIMPLE)	ip=/192.168.64.102	cmd=delete	src=/tmp/hive/ambari-qa/resource1	dst=null	perm=null	proto=rpc
+2016-03-18 10:00:49,242 INFO FSNamesystem.audit: allowed=true	ugi=ambari-qa (auth:SIMPLE)	ip=/192.168.64.102	cmd=getfileinfo	src=/tmp/hive/ambari-qa/resource2	dst=null	perm=null	proto=rpc
+2016-03-18 10:00:49,277 INFO FSNamesystem.audit: allowed=true	ugi=ambari-qa (auth:SIMPLE)	ip=/192.168.64.102	cmd=getfileinfo	src=/tmp/hive/ambari-qa/resource2	dst=null	perm=null	proto=rpc


Mime
View raw message