问题描述
我再次尝试在CloudWatch Log Insights中弄清楚如何使用stats
。 (如果可能的话,除AWS提供的文档外,我将不胜感激,这将是一个很大的帮助。)但是,我创建了CloudWatch Log Insight片段,使我可以在单独的列中获取customer_username和ingestId。它非常适合作为表格查看,但是我希望能够使用customer_name
来创建与message
与上述filter level = "error"
# filters logs streams of ingest- ONLY
| filter strcontains(@logStream,'ingest-')
# in every message,this captures a group of both the customer_username and ingestId,and provides all characters after which would be [-\w]+
| parse message /(ingestId=(?<ingestId>[-\w]+))\s(customer_username=(?<customer_username>[-\w]+))/
| display ingestId,customer_username
| fields @timestamp,message,level,@logStream
| sort customer_username,@timestamp asc
# experiment on having each customer with the associated error (if more than once,stack)
| | stats count(message) as Errors by customer_username
相对应的条形图。这是我到目前为止的代码:
{{1}}
UPDATE(v1): 我能够得到带有错误数量的customer_name;但是,我想将错误(消息中的错误)放在3个单独的列中:customer_name,错误(对于客户而言总共有多少个错误)和消息(即错误消息)。>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)