- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用以下查询检索标准化的 CPU 利用率百分比。
curl -H "Content-Type: application/json" -X POST http://localhost:12001/metricbeat*/_search?pretty=true -d '{"query":{"bool":{"must": [{"range": {"system.cpu.total.norm.pct": {"gte": 0.1}}},{"range": {"@timestamp": {"gte": "now-10m","lte": "now/m"}}}]}}}'
{
"took" : 1,
"timed_out" : false,
"_shards" : {
"total" : 8,
"successful" : 8,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : 0,
"max_score" : null,
"hits" : [ ]
}
}
module: system
metricsets:
- cpu # CPU usage
- load # CPU load averages
- memory # Memory usage
- network # Network IO
- process # Per process metrics
- process_summary # Process summary
- uptime # System Uptime
- core # Per CPU core usage
#- diskio # Disk IO
- filesystem # File system usage for each mountpoint
#- fsstat # File system summary metrics
#- raid # Raid
#- socket # Sockets and connection info (linux only)
enabled: true
period: 10s
processes: ['.*']
# Configure the metric types that are included by these metricsets.
cpu.metrics: ["percentages", "normalized_percentages", "ticks"] # The other available options are normalized_percentages and ticks.
core.metrics: ["percentages"] # The other available option is ticks.
module: elasticsearch
metricsets:
- node
- node_stats
#- index
#- index_recovery
#- index_summary
#- shard
#- ml_job
period: 10s
hosts: ["localhost:8881"]
# Starting with Beats version 6.0.0, the dashboards are loaded via the Kibana API.
# This requires a Kibana endpoint configuration.
setup.kibana:
# Kibana Host
# Scheme and port can be left out and will be set to the default (http and 5601)
# In case you specify and additional path, the scheme is required: http://localhost:5601/path
# IPv6 addresses should always be defined as: https://[2001:db8::1]:5601
host: "localhost:8882"
最佳答案
您使用的是哪个版本的 metricsbeat? system.cpu.total.norm.pct 是相对较新的字段,不存在于旧的 metricsbeat 版本中。
这可能是字段 system.cpu.total.norm.pct 本身不属于 metricsbeat 或 system.cpu.total.norm.pct 大于 0.1 的条件未完全填充。
如果您只想检索一个字段,那么它应该是 _source 下包含部分的一部分,而不是像下面这样的条件本身
curl -H "Content-Type: application/json" -X POST http://localhost:12001/metricbeat*/_search?pretty=true -d '{ "_source": {"includes": [ "system.cpu.total.norm.pct"]},"query":{"bool":{"must": [{"range": {"@timestamp": {"gte": "now-10m","lte": "now/m"}}}]}}}'
metricbeat.config.modules:
# Glob pattern for configuration loading
path: ${path.config}/modules.d/*.yml
modules.d/aerospike.yml.disabled
modules.d/apache.yml.disabled
modules.d/ceph.yml.disabled
modules.d/couchbase.yml.disabled
modules.d/docker.yml.disabled
modules.d/dropwizard.yml.disabled
modules.d/elasticsearch.yml.disabled
modules.d/envoyproxy.yml.disabled
modules.d/etcd.yml.disabled
modules.d/golang.yml.disabled
modules.d/graphite.yml.disabled
modules.d/haproxy.yml.disabled
modules.d/http.yml.disabled
modules.d/jolokia.yml.disabled
modules.d/kafka.yml.disabled
modules.d/kibana.yml.disabled
modules.d/kubernetes.yml.disabled
modules.d/kvm.yml.disabled
modules.d/logstash.yml.disabled
modules.d/memcached.yml.disabled
modules.d/mongodb.yml.disabled
modules.d/munin.yml.disabled
modules.d/mysql.yml.disabled
modules.d/nginx.yml.disabled
modules.d/php_fpm.yml.disabled
modules.d/postgresql.yml.disabled
modules.d/prometheus.yml.disabled
modules.d/rabbitmq.yml.disabled
modules.d/redis.yml.disabled
modules.d/system.yml
modules.d/traefik.yml.disabled
modules.d/uwsgi.yml.disabled
modules.d/vsphere.yml.disabled
modules.d/windows.yml.disabled
modules.d/zookeeper.yml.disabled
path: ${path.config}/modules.d/*.yml
的条件所以它包括在内。
$ ./metricbeat modules list
Enabled:
system
Disabled:
aerospike
apache
ceph
couchbase
docker
dropwizard
elasticsearch
envoyproxy
etcd
golang
graphite
haproxy
http
jolokia
kafka
kibana
kubernetes
kvm
logstash
memcached
mongodb
munin
mysql
nginx
php_fpm
postgresql
prometheus
rabbitmq
redis
traefik
uwsgi
vsphere
windows
zookeeper
$ ./metricbeat modules
Manage configured modules
Usage:
metricbeat modules [command]
Available Commands:
disable Disable one or more given modules
enable Enable one or more given modules
list List modules
Flags:
-h, --help help for modules
Global Flags:
-E, --E setting=value Configuration overwrite
-c, --c string Configuration file, relative to path.config (default "metricbeat.yml")
-d, --d string Enable certain debug selectors
-e, --e Log to stderr and disable syslog/file output
--path.config string Configuration path
--path.data string Data path
--path.home string Home path
--path.logs string Logs path
--plugin pluginList Load additional plugins
--strict.perms Strict permission checking on config files (default true)
-v, --v Log at INFO level
$ ./metricbeat modules enable kafka
Enabled kafka
$ ./metricbeat modules list
Enabled:
kafka
system
Disabled:
aerospike
apache
ceph
couchbase
docker
dropwizard
elasticsearch
envoyproxy
etcd
golang
graphite
haproxy
http
jolokia
kibana
kubernetes
kvm
logstash
memcached
mongodb
munin
mysql
nginx
php_fpm
postgresql
prometheus
rabbitmq
redis
traefik
uwsgi
vsphere
windows
zookeeper
modules.d/kafka.yml.disabled
至
modules.d/kafka.yml
并且您可以更新修改
modules.d/kafka.yml
下的配置
关于elasticsearch - 无法使用 elasticsearch 和 metricbeat 检索标准化 CPU 利用率百分比,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55691164/
我在这里有一个问题,我不知道这是否正常。 但是我认为这里有些湖,安装插件elasticsearch-head之后,我在浏览器中启动url“http://localhost:9200/_plugin/h
我写了这个 flex 搜索查询: es.search(index=['ind1'],doc_type=['doc']) 我得到以下结果: {'_shards': {'failed': 0, 'skip
在ElasticSearch.Net v.5中,存在一个属性 Elasticsearch.Net.RequestData.Path ,该属性在ElasticSearch.Net v.6中已成为depr
如何让 elasticsearch 应用新配置?我更改了文件 ~ES_HOME/config/elasticsearch.yml 中的一个字符串: # Disable HTTP completely:
我正在尝试使用以下分析器在 elastic serach 7.1 中实现部分子字符串搜索 PUT my_index-001 { "settings": { "analysis": {
假设一个 elasticsearch 服务器在很短的时间内接收到 100 个任务。有些任务很短,有些任务很耗时,有些任务是删除任务,有些是插入和搜索查询。 elasticsearch 是如何决定先运行
我需要根据日期过滤一组值(在此处添加字段),然后按 device_id 对其进行分组。所以我正在使用以下东西: { "aggs":{ "dates_between":{ "fi
我在 Elasticsearch 中有一个企业索引。索引中的每个文档代表一个业务,每个业务都有business_hours。我试图允许使用星期几和时间过滤营业时间。例如,我们希望能够进行过滤,以显示我
我有一个这样的过滤查询 query: { filtered: { query: { bool: { should: [{multi_match: {
Elasticsearch 相当新,所以可能不得不忍受我,我遇到了一个问题,如果我使用 20 个字符或更少的字符搜索文档,文档会出现,但是查询中同一个单词中的任何更多字符,我没有结果: 使用“苯氧甲基
我试图更好地理解 ElasticSearch 的内部结构,所以我想知道 ElasticSearch 在内部计算以下两种情况的术语统计信息的方式是否存在任何差异。 第一种情况是当我有这样的文件时: {
在我的 elasticsearch 索引中,我索引了一堆工作。为简单起见,我们只说它们是一堆职位。当人们在我的搜索引擎中输入职位时,我想“自动完成”可能的匹配。 我在这里调查了完成建议:http://
我在很多映射中使用多字段。在 Elastic Search 的文档中,指示应将多字段替换为“fields”参数。参见 http://www.elasticsearch.org/guide/en/ela
我有如下查询, query = { "query": {"query_string": {"query": "%s" % q}}, "filter":{"ids
我有一个Json数据 "hits": [ { "_index": "outboxprov1", "_type": "deleted-c
这可能是一个初学者的问题,但我对大小有一些疑问。 根据 Elasticsearch 规范,大小的最大值可以是 10000,我想在下面验证我的理解: 示例查询: GET testindex-2016.0
我在 Elastic Search 中发现了滚动功能,这看起来非常有趣。看了那么多文档,下面的问题我还是不清楚。 如果偏移量已经存在那么为什么要使用滚动? 即将到来的记录呢?假设它完成了所有数据的滚动
我有以下基于注释的 Elasticsearch 配置,我已将索引设置为不被分析,因为我不希望这些字段被标记化: @Document(indexName = "abc", type = "efg
我正在尝试在单个索引中创建多个类型。例如,我试图在host索引中创建两种类型(post,ytb),以便在它们之间创建父子关系。 PUT /ytb { "mappings": { "po
我尝试创建一个简单的模板,包括一些动态模板,但我似乎无法为文档编制索引。 我得到错误: 400 {"error":"MapperParsingException[mapping [_default_]
我是一名优秀的程序员,十分优秀!