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 2018/11/27 14:42:02 UTC

[ambari-logsearch] branch master updated: AMBARI-24959. Log Search: show log level filters enabled or disabled on /info/features endpoint (#44)

This is an automated email from the ASF dual-hosted git repository.

oleewere pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ambari-logsearch.git


The following commit(s) were added to refs/heads/master by this push:
     new fb10052  AMBARI-24959. Log Search: show log level filters enabled or disabled on /info/features endpoint (#44)
fb10052 is described below

commit fb10052422db4be1865500b87d685da3f8fc380b
Author: Olivér Szabó <ol...@gmail.com>
AuthorDate: Tue Nov 27 15:41:57 2018 +0100

    AMBARI-24959. Log Search: show log level filters enabled or disabled on /info/features endpoint (#44)
---
 .../java/org/apache/ambari/logsearch/common/LogSearchConstants.java     | 1 +
 .../src/main/java/org/apache/ambari/logsearch/manager/InfoManager.java  | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/common/LogSearchConstants.java b/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/common/LogSearchConstants.java
index 7db839f..a0c5aa9 100644
--- a/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/common/LogSearchConstants.java
+++ b/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/common/LogSearchConstants.java
@@ -62,6 +62,7 @@ public class LogSearchConstants {
   public static final String SORT = "sort";
 
   // info features constants
+  public static final String LOG_LEVEL_FILTERS_KEY = "log_level_filters";
   public static final String SHIPPER_CONFIG_API_KEY = "metadata_patterns";
   public static final String AUTH_FEATURE_KEY = "auth";
 
diff --git a/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/manager/InfoManager.java b/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/manager/InfoManager.java
index 3aabdbf..687bf0b 100644
--- a/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/manager/InfoManager.java
+++ b/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/manager/InfoManager.java
@@ -81,6 +81,8 @@ public class InfoManager extends JsonManagerBase {
     Map<String, Object> featuresMap = new HashMap<>();
     featuresMap.put(LogSearchConstants.AUTH_FEATURE_KEY, getAuthMap());
     featuresMap.put(LogSearchConstants.SHIPPER_CONFIG_API_KEY, logSearchConfigApiConfig.isConfigApiEnabled());
+    boolean logLevelFiltersEnabled = logSearchConfigApiConfig.isConfigApiEnabled() || logSearchConfigApiConfig.isSolrFilterStorage() || logSearchConfigApiConfig.isZkFilterStorage();
+    featuresMap.put(LogSearchConstants.LOG_LEVEL_FILTERS_KEY, logLevelFiltersEnabled);
     return featuresMap;
   }