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

ElasticSearch查询指定时间内出现的次数/2秒内出现的次数

  1. 查询指定时间内出现的次数
POST process-log/_search
{"size": 0,"query": {"bool": {"filter": [{"range": {"requestTime": {"from": 1722470400000,"to": 1722556800000}}}]}},"aggs": {"server_request": {"terms": {"script": {"source": "if (doc['serverName.keyword'].size() > 0 && doc['requestUri.keyword'].size() > 0) { return doc['serverName.keyword'].value + ' ' + doc['requestUri.keyword'].value; } else { return 'N/A'; }","lang": "painless"},"size": 10,"order": {"_count": "desc"}}}}
}
  1. Elasticsearch 插叙2秒内出现的次数
POST process-log/_search
{"size": 0,"query": {"bool": {"filter": {"range": {"requestTime": {"from": 1721692800000,"to": 1721952000000}}}}},"aggs": {"uri_over_time": {"composite": {"size": 100, "sources": [{"requestTime": {"date_histogram": {"field": "requestTime","fixed_interval": "2s"}}},{"requestUri": {"terms": {"field": "requestUri.keyword"}}},{"serverName": {"terms": {"field": "serverName.keyword"}}}]}}}
}
http://www.xdnf.cn/news/9660.html

相关文章:

  • 我们来学mysql -- 输出一份“数据备份还原”sh脚本
  • 手写字魔法消除1:数据集说明(含下载链接)
  • Kruskal算法剖析与py/cpp/Java语言实现
  • linux中基础IO(上)
  • 浅谈 JavaScript 性能优化
  • 深度解析 Nginx 配置:从性能优化到 HTTPS 安全实践
  • YOLOv8性能提升:引入华为GhostNetv1特征提取网络
  • 第五章 宽松内存一致性模型 A Primer on Memory Consistency and Cache Coherence - 2nd Edition
  • Houdini learning Record
  • Python中的跨域资源共享(CORS)处理
  • CRTP学习笔记与指南
  • MySQL8.4主从复制
  • Mysql学习笔记之事务
  • 大数据未来发展的趋势与挑战
  • 深入详解(0020,0052) Frame of Reference UID在序列空间定位中的定义与作用
  • 【机器学习基础】机器学习入门核心算法:GBDT(Gradient Boosting Decision Tree)
  • 20250528-C#知识:强制类型转换
  • PostgreSQL 数据完整性检查工具对比:amcheck 与 pg_checksums
  • TCP连接数统计脚本
  • 【系统架构设计师】2025年上半年真题论文回忆版: 论系统负载均衡设计方法(包括解题思路和参考素材)
  • 电子电路:压降的定义与原理
  • 在 Ubuntu 上挂载其他硬盘的步骤
  • uniapp 实战demo
  • AI赋能金融风控:基于机器学习的智能欺诈检测系统实战教程
  • SQL中各个子句的执行顺序
  • SpringBoot中解决跨域问题
  • Next.js 15 与 Apollo Client 的现代集成及性能优化
  • Web3 风控挑战重重,图数据库为何成为破局关键-悦数图数据库
  • Microsoft 推出 Magentic-UI,多智能体引领网页人机协作变革
  • Step9—Ambari Web UI 初始化安装 (Ambari3.0.0)