Skip to content
This repository has been archived by the owner on Nov 22, 2017. It is now read-only.

Add filter fields action on logs #296

Open
wants to merge 2 commits into
base: kibana-ruby
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions public/lib/js/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,8 @@ function details_table(objid,theme) {
var buttons = "<span class='raw'>" + xmlEnt(value) + "</span>" +
"<i class='jlink icon-large icon-search msearch' " +
"data-action='' data-field='"+field+"'></i> " +
"<i class='jlink icon-large icon-filter msearch' " +
"data-action='FILTER ' data-field='"+field+"'></i> " +
"<i class='jlink icon-large icon-ban-circle msearch' " +
"data-action='NOT ' data-field='"+field+"'></i> ";

Expand All @@ -925,7 +927,7 @@ function details_table(objid,theme) {
if (resultjson.kibana.clickable_urls) {
var value = value === undefined ? "-" : value.toString();
// Detect URLs and inserts delimiters
var value = value.replace(RegExp("(https?://([-\\w\\.]+)+(:\\d+)?(/([\\w/_\\.]*(\\?\\S+)?)?)?)", "g"),
var value = value.replace(RegExp("(https?://([-\\w\\.]+)+(:\\d+)?(/([\\,-\\w/_\\.]*(\\?\\S+)?)?)?)", "g"),
function (all, text, char) {
return "@KIBANA_LINK_START@" + text + "@KIBANA_LINK_END@";
}
Expand Down Expand Up @@ -991,7 +993,12 @@ function mSearch(field, value, mode) {
var query = field + ":" + "\"" + addslashes(value.toString()) + "\"";
}
var glue = queryinput != "" ? " AND " : " ";
window.hashjson.search = queryinput + glue + query;
if (query.indexOf('FILTER') !== -1) {
window.hashjson.search = query.slice(7);
}
else {
window.hashjson.search = queryinput + glue + query;
}
setHash(window.hashjson);
scroll(0, 0);
}
Expand Down