buildKibanaServerUrl
private String buildKibanaServerUrl(DiscountIndexMailData mailData,Statistic stat,String failureCause) {
StringBuilder sb = new StringBuilder(kibanaServerUrl);
sb.append("#/discover?_g=(time:(from:now-7d,mode:quick,to:now))")
.append("&_a=(query:(language:lucene,query:'msg:")
.append(failureCause)
.append("%20AND%20severity:error%20AND%20class:")
.append(stat.getTopic())
.append("%20AND%20timestamp.keyword:%7B%22")
.append(getLocalTimeStr(getDefaultLocalTimeFromInstant(mailData.getStartTime())))
.append("%22%20TO%20%22")
.append(getLocalTimeStr(getDefaultLocalTimeFromInstant(mailData.getEndTime())))
.append("%22%5D'))");
return sb.toString();
}
public static LocalDateTime getDefaultLocalTimeFromInstant(Instant instant) {
return LocalDateTime.ofInstant(instant, ZoneId.systemDefault());
}
public static String getLocalTimeStr(LocalDateTime localDateTime) {
return localDateTime.toLocalDate().toString() + ' ' + localDateTime.toLocalTime().toString();
}
kibana.server.url=http://localhost:5601/app/kibana
buildKibanaServerUrl的更多相关文章
随机推荐
- Vue02 样式的动态绑定
daigengxin......2018-3-8 21:09:18 跟angular2类似,分为CSS类绑定和Style样式绑定两种方式,详情参见
- UITextField的文本框部分文本以*的方式来显示
#import "AppDelegate.h" @interface AppDelegate ()<UITextFieldDelegate>// 添加代理协议 @end ...
- C语言-郝斌笔记-001求二次方程的根
求二次方程的根 #include <stdio.h > #include<math.h> int main(void) { //把三个系数保存到计算机中 ; //=不表示相等, ...
- python---pyspider,报错?
conf.json文件内容如下: { "message_queue": "redis://127.0.0.1:6379/15", "webui&quo ...
- bootstrap.js 文件使用指南
介绍 使用 Bootstrap v3.3.7 时,需要引入三个脚本文件. https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.m ...
- pthread中如何追踪stack over flow
通常在程序挂掉的时候我们会catch 他们挂掉的signal,然后在signal中打印出当时的一个stack,来方便问题调查, 但是在stack overflow的情况发生时,会没有拿到stack.s ...
- webapi 返回json
web api 默认的已 xml 格式返回数据 现在开发一般都是以 json 格式为主 下面配置让 webapi 默认返回 json ,在需要返回 xml 时只需要加一个查询参数 datatype=x ...
- JavaScript混淆压缩
比较好用的压缩软件,支持合并 JsCompressor-v3.0 比较好用的混淆站点:http://dean.edwards.name/packer/
- C++时间操作的汇总
. 获取当前时间 time_t cur_time = time(NULL); . 把整数时间转为字符串时间 string GetStringTime(const time_t time) { stru ...
- 正经学C#_判断[switch语句]:[c#入门经典]
switch是一个和IF语句极其相似的语句.但是Switch允许条件可以有多个值. 程序的基本结构如下 switch(textVal) { case Val: 程序代码 break case Val2 ...