Untitled conversation
- User
{"took":0,"timed_out":false,"_shards":{"total":1,"successful":1,"skipped":0,"failed":0},"hits":{"total":{"value":14,"relation":"eq"},"max_score":1.0,"hits":[{"_index":"index-test","_type":"_doc","_id":"VDyBJJMBvRjyC8X2Anmg","_score":1.0,"_source":{"@timestamp":"2024-11-13T07:50:54.773Z","log":[],"process":[],"resource":[{"item_id":"1001","alias":"cpu_percent","agent_time":"2024-11-13 15:50:53","host_id":"10.121.177.161","value1":"0.3"},{"item_id":"1002","alias":"mem_percent","agent_time":"2024-11-13 15:50:53","host_id":"10.121.177.161","value1":"23.0"}],"@version":"1"}},{"_index":"index-test","_type":"_doc","_id":"VTyBJJMBvRjyC8X2Gnkm","_score":1.0,"_source":{"@timestamp":"2024-11-13T07:51:00.795Z","log":[],"process":[],"resource":[{"item_id":"1001","alias":"cpu_percent","agent_time":"2024-11-13 15:50:59","host_id":"10.121.177.161","value1":"0.2"},{"item_id":"1002","alias":"mem_percent","agent_time":"2024-11-13 15:50:59","host_id":"10.121.177.161","value1":"23.0"}],"@version":"1"}}]}} 这是我的数据,帮我改写panel,要求:1、查询 host_id 为 10.121.177.161 且 item_id 为 1001 的数据, 这是我的面板,输出一份修改后的完整面板:{ "id": 2, "type": "timeseries", "title": "集群 CPU 资源监控", "gridPos": { "x": 0, "y": 8, "h": 10, "w": 11 }, "fieldConfig": { "defaults": { "custom": { "drawStyle": "line", "lineInterpolation": "linear", "barAlignment": 0, "barWidthFactor": 0.6, "lineWidth": 1, "fillOpacity": 0, "gradientMode": "none", "spanNulls": false, "insertNulls": false, "showPoints": "auto", "pointSize": 5, "stacking": { "mode": "none", "group": "A" }, "axisPlacement": "auto", "axisLabel": "", "axisColorMode": "text", "axisBorderShow": false, "scaleDistribution": { "type": "linear" }, "axisCenteredZero": false, "hideFrom": { "tooltip": false, "viz": false, "legend": false }, "thresholdsStyle": { "mode": "off" } }, "color": { "mode": "palette-classic" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [ { "__systemRef": "hideSeriesFrom", "matcher": { "id": "byNames", "options": { "mode": "exclude", "names": [ "10.121.177.161" ], "prefix": "All except:", "readOnly": true } }, "properties": [ { "id": "custom.hideFrom", "value": { "legend": false, "tooltip": false, "viz": true } } ] } ] }, "pluginVersion": "11.3.0", "targets": [ { "alias": "10.121.177.161", "bucketAggs": [ { "field": "item_id", "id": "2", "settings": { "min_doc_count": "1", "order": "desc", "orderBy": "_term", "size": "10" }, "type": "terms" } ], "hide": false, "metrics": [ { "field": "value1", "id": "1", "type": "max" } ], "query": "item_id:"1001" AND host_id:"10.121.177.161"", "refId": "A", "timeField": "agent_time" } ], "datasource": { "type": "elasticsearch", "uid": "ee3pfbw3ib2m8a" }, "options": { "tooltip": { "mode": "single", "sort": "none" }, "legend": { "showLegend": true, "displayMode": "list", "placement": "right", "calcs": [] } } }
- Assistant
为了帮助您创建符合条件的面板配置,您可以参考以下修改后的完整面板配置: