Repository: ambari Updated Branches: refs/heads/branch-2.4 d53366f1d -> def1097dc
AMBARI-17420. Audit log_message field changes for handling search issues. (Dharmesh Makwana via oleewere) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/def1097d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/def1097d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/def1097d Branch: refs/heads/branch-2.4 Commit: def1097dc2b6bc5539ee773ac4852d4866253fd1 Parents: d53366f Author: oleewere <[email protected]> Authored: Fri Jul 1 10:16:01 2016 +0200 Committer: oleewere <[email protected]> Committed: Fri Jul 1 10:18:26 2016 +0200 ---------------------------------------------------------------------- .../configsets/audit_logs/conf/managed-schema | 5 +---- .../ambari/logsearch/query/QueryGeneration.java | 6 ++--- .../src/main/webapp/scripts/utils/Utils.js | 9 ++++++++ .../scripts/views/audit/AuditTabLayoutView.js | 22 ++----------------- .../dashboard/BubbleGraphTableLayoutView.js | 23 ++++++++++---------- .../audit/AuditTabLayoutView_tmpl.html | 3 --- 6 files changed, 26 insertions(+), 42 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/def1097d/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/managed-schema ---------------------------------------------------------------------- diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/managed-schema b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/managed-schema index d2a1b6d..f58652c 100644 --- a/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/managed-schema +++ b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/managed-schema @@ -104,13 +104,10 @@ <field name="req_self_id" type="key_lower_case" multiValued="false"/> <field name="event_md5" type="string" multiValued="false"/> <field name="file" type="key_lower_case" multiValued="false"/> - <field name="log_message" type="text_std_token_lower_case" multiValued="false" omitNorms="false"/> + <field name="log_message" type="key_lower_case" multiValued="false" omitNorms="false"/> <field name="logfile_line_number" type="tint" omitNorms="false"/> <!-- <field name="message" type="text_std_token_lower_case" indexed="true" stored="true"/> --> <field name="message_md5" type="string" multiValued="false"/> <field name="type" type="key_lower_case" multiValued="false"/> - <dynamicField name='ngram_*' type="n_gram" multiValued="false" stored="false"/> - <dynamicField name='std_*' type="text_std_token_lower_case" multiValued="false" stored="false"/> - </schema> http://git-wip-us.apache.org/repos/asf/ambari/blob/def1097d/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/query/QueryGeneration.java ---------------------------------------------------------------------- diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/query/QueryGeneration.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/query/QueryGeneration.java index 93105b0..646abd6 100644 --- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/query/QueryGeneration.java +++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/query/QueryGeneration.java @@ -347,14 +347,14 @@ public class QueryGeneration extends QueryGenerationBase { case SERVICE: String serviceLogs = PropertiesUtil.getProperty("logsearch.solr.collection.service.logs",LogSearchConstants.DEFAULT_SERVICE_COLUMN_SUFFIX); type = ConfigUtil.schemaFieldsName.get(key + serviceLogs); + if (key.equalsIgnoreCase(LogSearchConstants.SOLR_LOG_MESSAGE)) { + return solrUtil.escapeForLogMessage(key, str); + } break; default: // set as null type = null; } - if (key.equalsIgnoreCase(LogSearchConstants.SOLR_LOG_MESSAGE)) { - return solrUtil.escapeForLogMessage(key, str); - } if (type == null) { return key + ":" + "*" + str + "*"; } else if ("text_std_token_lower_case".equalsIgnoreCase(type)) { http://git-wip-us.apache.org/repos/asf/ambari/blob/def1097d/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/utils/Utils.js ---------------------------------------------------------------------- diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/utils/Utils.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/utils/Utils.js index 4b18b15..3d2657d 100644 --- a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/utils/Utils.js +++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/utils/Utils.js @@ -1212,6 +1212,15 @@ define(['require', return str.replace(/(?:^|\s)\w/g, function(match) { return match.toUpperCase() }); + }, + Utils.manipulateValueForAddingAstrik = function(str){ + if(!str){ + return ""; + } + var string = ((str.lastIndexOf('*',0) === 0)) ? str : '*'+str; + string = ((str.lastIndexOf('*', str.length - 1) === str.length - 1)) ? string : string+'*'; + + return string; }; return Utils; http://git-wip-us.apache.org/repos/asf/ambari/blob/def1097d/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/audit/AuditTabLayoutView.js ---------------------------------------------------------------------- diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/audit/AuditTabLayoutView.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/audit/AuditTabLayoutView.js index 1462080..21f1779 100644 --- a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/audit/AuditTabLayoutView.js +++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/audit/AuditTabLayoutView.js @@ -183,24 +183,6 @@ define(['require', delete that.columns[v] } }); - that.RVisualSearch.show(new VisualSearchView({ - vent : that.vent, - globalVent:that.globalVent, - customOptions : _.values(that.columns), - eventName : "search:audit:query", - myFormatData : function(query,searchCollection){ - var obj=[]; - searchCollection.each(function(m){ - var data = {}; - data[m.get("category")] = m.get("value"); - obj.push(data); - }); - return { - columnQuery : JSON.stringify(obj), - query : query - } - } - })); that.RVisualSearchInc.show(new VisualSearchView({ viewName : "includeColumns", placeholder : "Include Search", @@ -212,7 +194,7 @@ define(['require', var obj=[]; searchCollection.each(function(m){ var data = {}; - data[m.get("category")] = m.get("value"); + data[m.get("category")] = Utils.manipulateValueForAddingAstrik(m.get("value")); obj.push(data); }); return { @@ -231,7 +213,7 @@ define(['require', var obj=[]; searchCollection.each(function(m){ var data = {}; - data[m.get("category")] = m.get("value"); + data[m.get("category")] = Utils.manipulateValueForAddingAstrik(m.get("value")); obj.push(data); }); return { http://git-wip-us.apache.org/repos/asf/ambari/blob/def1097d/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/BubbleGraphTableLayoutView.js ---------------------------------------------------------------------- diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/BubbleGraphTableLayoutView.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/BubbleGraphTableLayoutView.js index 04dbe42..093ed83 100644 --- a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/BubbleGraphTableLayoutView.js +++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/BubbleGraphTableLayoutView.js @@ -519,6 +519,17 @@ define(['require', // } // } // }) + $('body').on("mouseup.contextMenu",function(e){ + var selection; + if (window.getSelection) { + selection = window.getSelection(); + } else if (document.selection) { + selection = document.selection.createRange(); + } + if(_.isEmpty(selection.toString()) && ($(".contextMenuBody").is(":hidden")) ){ + that.selectionText =""; + } + }); this.$el.on('mouseup contextmenu', ".logMessage", function(e){ var selection; e.stopPropagation(); @@ -532,18 +543,6 @@ define(['require', },1); }); - $('body').on("mouseup.contextMenu",function(e){ - var selection; - if (window.getSelection) { - selection = window.getSelection(); - } else if (document.selection) { - selection = document.selection.createRange(); - } - if(_.isEmpty(selection.toString())){ - that.selectionText =""; - } - - }); }, selectionCallBack : function(selection,e){ this.RLogTable.currentView.$el.removeHighlight(true); http://git-wip-us.apache.org/repos/asf/ambari/blob/def1097d/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/templates/audit/AuditTabLayoutView_tmpl.html ---------------------------------------------------------------------- diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/templates/audit/AuditTabLayoutView_tmpl.html b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/templates/audit/AuditTabLayoutView_tmpl.html index ef894a2..1c8412d 100644 --- a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/templates/audit/AuditTabLayoutView_tmpl.html +++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/templates/audit/AuditTabLayoutView_tmpl.html @@ -37,9 +37,6 @@ </div> <div class="box-content overflowChange"> <div class="row row-margin-bottom"> - <div class="col-md-12" id="r_vsSearch"></div> - </div> - <div class="row row-margin-bottom"> <div class="col-md-6"> <div id="r_vsSearchInc"></div> </div>
