Skip to content

Latest commit

 

History

History
42 lines (34 loc) · 1.25 KB

aws-cloudwatch-logs-insights-average.md

File metadata and controls

42 lines (34 loc) · 1.25 KB
aliases category classification date date_modified draft id image links local_archive_links pinned print series tags title type
aws-cloudwatch-logs-insights-average
aws
public
2021-03-02 08:23:13 -0800
2021-03-02 08:23:13 -0800
false
20210302162313
false
false
syntax
cloudwatch
logs
insights
average
AWS CloudWatch Insights Average
tech-note

CloudWatch Logs Insights Query Syntax

Parsing the below log entry.

2021-03-02 00:04:29,532 INFO  [backendTaskScheduler-2] control.NodeHealthMonitor - 1609@ip-10-0-1-104#vFR NodeHealth[updated=2021-03-02T00:04:29.532, host='10.0.1.104', pid='1609', maxMemory=12884901886, usedMemory=418226480, usedMemoryOneHourMax=421286304, usedMemoryOneDayMax=427718856, member='[uuid:ab992f4b-305e-4100-8bf7-390168f5dd30,port:5701,lite:false]', mode=AS_SERVER, joined=2021-03-01T16:49:04.346, left=null, state=READY]

The below will plot the average used memory and output a line graph visualisation.

parse @message "usedMemory=*," as usedmem
| stats avg(usedmem) by bin(5m)

The below will output the average used memory as a single figure only.

parse @message "usedMemory=*," as usedmem
| avg(usedmem)