当前位置: 首页 > news >正文

如何做网站导航栏wordpress摘要字数的插件

如何做网站导航栏,wordpress摘要字数的插件,网站开发公司流程,网站引导动画怎么做的【elasticsearch】慢查询替代查询审计的尝试 使用了es有两年了,突然发现一个,es没有查询审计日志,某个用户查询了某个索引的审计。 找了官方文档和社区的回复都是说使用slow log替代慢查询。 尝试一下。 参考链接1:https://discus…

【elasticsearch】慢查询替代查询审计的尝试

使用了es有两年了,突然发现一个,es没有查询审计日志,某个用户查询了某个索引的审计。
找了官方文档和社区的回复都是说使用slow log替代慢查询。
尝试一下。

参考链接1:https://discuss.elastic.co/t/does-elasticsearch-capture-audit-logs-for-query-dsl-eql-and-sql-or-not/339398/8
参考链接2:https://www.elastic.co/guide/en/elasticsearch/reference/7.17/auditing-search-queries.html

前置条件

elasticsearch: 7.17.13
操作系统:linux7.9
es加密配置,只有加密后才可以使用slow log

xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate 
xpack.security.transport.ssl.keystore.path: certs/elastic-certificates.p12 
xpack.security.transport.ssl.truststore.path: certs/elastic-certificates.p12

普通查询

 curl -u elastic:AAA320 localhost:9200/sq-20240506/_search

普通插入

curl -u elastic:AAA320 -H 'Content-Type: application/json' -X POST localhost:9200/sq-20240506/_doc/1 -d '
{
"firstname": "Krishna",
"lastname": "kumar"
}'

上述查询和插入没有任何slow log信息。

设置慢查询

这里设置trace的慢查询为0ms,会捕获所有查询。

curl -u elastic:AAA320 -H 'Content-Type: application/json'  -XPUT 'http://localhost:9200/_all/_settings?preserve_existing=true' -d '{"index.search.slowlog.threshold.fetch.debug" : "500ms","index.search.slowlog.threshold.fetch.info" : "800ms","index.search.slowlog.threshold.fetch.trace" : "0ms","index.search.slowlog.threshold.fetch.warn" : "1s","index.search.slowlog.threshold.query.debug" : "2s","index.search.slowlog.threshold.query.info" : "5s","index.search.slowlog.threshold.query.trace" : "0ms","index.search.slowlog.threshold.query.warn" : "10s"
}'

查看日志

慢查询日志,存放再es的日志文件夹中,elasticsearch_index_search_slowlog.log,这里可以看到TRACE级别的日志,可以看到分query和fetch两种,有节点信息、索引信息、分片以及耗时,但是我还是觉得这里缺少了查询用户,查询来源信息,目前还是无法满足我的实际排查需求。

] tailf elasticsearch_index_search_slowlog.log
[2024-05-06T16:33:29,528][TRACE][i.s.s.query              ] [node-1] [sq-20240506][0] took[179.4micros], took_millis[0], total_hits[1 hits], types[], stats[], search_type[QUERY_THEN_FETCH], total_shards[1], source[{}], id[], 
[2024-05-06T16:33:29,529][TRACE][i.s.s.fetch              ] [node-1] [sq-20240506][0] took[3.3ms], took_millis[3], total_hits[1 hits], types[], stats[], search_type[QUERY_THEN_FETCH], total_shards[1], source[{}], id[],

取消慢查询

curl -u elastic:AAA320 -H 'Content-Type: application/json' -XPUT 'http://localhost:9200/_all/_settings' -d '{"index.search.slowlog.threshold.fetch.debug": null,"index.search.slowlog.threshold.fetch.info": null,"index.search.slowlog.threshold.fetch.trace": null,"index.search.slowlog.threshold.fetch.warn": null,"index.search.slowlog.threshold.query.debug": null,"index.search.slowlog.threshold.query.info": null,"index.search.slowlog.threshold.query.trace": null,"index.search.slowlog.threshold.query.warn": null
}'
http://www.yayakq.cn/news/83174/

相关文章:

  • 常德政务网站赤峰建网站的电话
  • 企业年报查询网站北京外包公司有哪些
  • 织梦万网网站搬家教程wordpress 友链
  • 湖北建设网官方网站网站套程序
  • 1g内存的服务器可以建设几个网站网络营销的名词解释是什么
  • 如何建设门户网站盈佳国际天天做赢家网站
  • 商务网站如何推广免费优化网站的软件
  • 中国建设银行信用卡旅游卡服务网站榆社网站建设
  • 医院网站内链优化wordpress模板 古典
  • 网站死链接怎么提交wordpress安装不成功
  • 北京网站建设公司案例网站怎么做sem优化
  • 表情包做旧网站500网站建设
  • 城乡住房和城乡建设厅网站网络营销软文范例300
  • 公司网站能否申请国外免费空间免费分站网站
  • 湖北专业的网站制作代理商wordpress hook 列表
  • 公司的网站建设费用入什么科目美食网站网页设计论文
  • 新手如何做网站运营word超链接网站怎样做
  • 黄冈市建设局网站网站建设的知名公司
  • 网站做com合net的区别天津网站建设找哪家
  • 怎么进入网站管理系统百度云wordpress教程视频教程
  • 淘宝网官方网站购物商城灰色推广
  • seo有哪些网站微商城怎么注册怎么弄
  • 有哪些免费推广网站网站建设的平台分析
  • 网站怎么做全站搜索专门做金融培训的网站有哪些
  • 怎么做网站背景图片网站 建设ppt模板
  • 钢城网站建设在线网页代理太太猫
  • dw软件网站建设教程视频制作网站的过程是对信息的
  • 绍兴网站建设专业的公司ffmpeg做视频网站
  • 保山市建设局网站登录最好的免费logo设计网站
  • 网站建设所需软件北京seo优化费用