Permalink
Browse files

Fix ES source link generator

  • Loading branch information...
kiwiz committed Jul 5, 2017
1 parent e32fbeb commit 99d583d6a39c7c9777713455b1f4c187693fd920
Showing with 5 additions and 4 deletions.
  1. +2 −3 config_example.php
  2. +3 −1 phplib/Search/Elasticsearch.php
View
@@ -96,9 +96,8 @@
* '@' - Parse as a UNIX timestamp.
* '#' - Parse as a UNIX timestamps (in milliseconds).
* All other strings are interpretted via PHP's date formatting syntax.
* 'src_url': A format string for generating default source links.
* Requires the following format specifiers: 's', 'd', 'd'.
* Ex: 'https://localhost/?query=%s&from=%d&to=%d'
* 'src_url': A server name for generating source links.
* Ex: 'https://localhost:5601'
*/
# Configuration for the 411 Alerts index.
@@ -34,7 +34,9 @@ public function generateLink($query, $start, $end) {
return null;
}
return sprintf($cfg['src_url'], $start, $end, rawurlencode($query));
$index = $cfg['date_based'] ? \ESQuery\Util::generateKibanaPattern($cfg['index']):$cfg['index'];
$parser = new \ESQuery\Parser;
return $parser->generateUrl($query, $start, $end, $cfg['src_url'], $index);
}
public function isTimeBased() {

0 comments on commit 99d583d

Please sign in to comment.