你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
输入关键字进行搜索
搜索:
没有找到相关结果
JackGe
赞同来自: redhat 、CarrieJin
public class SearchLoggerPlugin extends Plugin { @Override public String name() { return "requestLogger"; } @Override public String description() { return "attempt to log search request through TCP."; } public void onModule(final ActionModule module) { module.registerFilter(SearchRequestActionFilter.class); } } public class SearchRequestActionFilter extends ActionFilter.Simple { private final ESLogger tcpSearchLogger; private static final String INDEX_TCP_SEARCH_LOG_PREFIX = "index.tcp.search.log"; @Inject public SearchRequestActionFilter(Settings settings) { super(settings); this.tcpSearchLogger = Loggers.getLogger(INDEX_TCP_SEARCH_LOG_PREFIX); } @Override public int order() { return 0; } @SuppressWarnings("rawtypes") @Override public boolean apply(String action, ActionRequest actionRequest, final ActionListener listener) { tcpSearchLogger.info("request info...."); return true; } @SuppressWarnings("rawtypes") @Override public boolean apply(String s, ActionResponse actionResponse, ActionListener actionListener) { tcpSearchLogger.info("response info...."); return true; } }
code4j - coder github: https://github.com/rpgmakervx
赞同来自:
bill
laoyang360 - 《一本书讲透Elasticsearch》作者,Elastic认证工程师 [死磕Elasitcsearch]知识星球地址:http://t.cn/RmwM3N9;微信公众号:铭毅天下; 博客:https://elastic.blog.csdn.net
要回复问题请先登录或注册
4 个回复
JackGe
赞同来自: redhat 、CarrieJin
2. 实现查询网关,可以扩展审计限流,记录日志,故障迁移等功能。需要仿照es网络通信源码实现网关(实现较复杂)。
code4j - coder github: https://github.com/rpgmakervx
赞同来自:
bill
赞同来自:
# curl -XGET '192.168.1.111:9200/log_test1/_stats/search?pretty'
{
"_shards" : {
"total" : 12,
"successful" : 12,
"failed" : 0
},
"_all" : {
"primaries" : {
"search" : {
"open_contexts" : 0,
"query_total" : 1,
"query_time_in_millis" : 0,
"query_current" : 0,
"fetch_total" : 0,
"fetch_time_in_millis" : 0,
"fetch_current" : 0,
"scroll_total" : 0,
"scroll_time_in_millis" : 0,
"scroll_current" : 0
}
},
"total" : {
"search" : {
"open_contexts" : 0,
"query_total" : 4,
"query_time_in_millis" : 0,
"query_current" : 0,
"fetch_total" : 0,
"fetch_time_in_millis" : 0,
"fetch_current" : 0,
"scroll_total" : 0,
"scroll_time_in_millis" : 0,
"scroll_current" : 0
}
}
},
"indices" : {
"log_test1" : {
"primaries" : {
"search" : {
"open_contexts" : 0,
"query_total" : 1,
"query_time_in_millis" : 0,
"query_current" : 0,
"fetch_total" : 0,
"fetch_time_in_millis" : 0,
"fetch_current" : 0,
"scroll_total" : 0,
"scroll_time_in_millis" : 0,
"scroll_current" : 0
}
},
"total" : {
"search" : {
"open_contexts" : 0,
"query_total" : 4,
"query_time_in_millis" : 0,
"query_current" : 0,
"fetch_total" : 0,
"fetch_time_in_millis" : 0,
"fetch_current" : 0,
"scroll_total" : 0,
"scroll_time_in_millis" : 0,
"scroll_current" : 0
}
}
}
}
}
laoyang360 - 《一本书讲透Elasticsearch》作者,Elastic认证工程师 [死磕Elasitcsearch]知识星球地址:http://t.cn/RmwM3N9;微信公众号:铭毅天下; 博客:https://elastic.blog.csdn.net
赞同来自: