[英]How to define MetricFilter for AWS Lambda inside Cloudformation template?
I experiment with AWS::Logs::MetricFilter and encountered a small problem I cannot resolve. 我尝试使用AWS :: Logs :: MetricFilter并遇到了一个我无法解决的小问题。 In my Cloudformation template I try to configure it like so: 在我的Cloudformation模板中,我尝试像这样配置它:
SomeMetricFilter:
Type: "AWS::Logs::MetricFilter"
Properties:
FilterPattern: "*thing just happened*"
LogGroupName: "/aws/lambda/some-lambda-name-ISW1N3LSLNK0"
MetricTransformations:
-
MetricValue: "1"
MetricNamespace: "Name/Space"
MetricName: "VeryVerboseMetricName"
LogGroups created for this AWS Lambda has a string of random letters and numbers as a prefix: ISW1N3LSLNK0 为此AWS Lambda创建的LogGroup具有一串随机字母和数字作为前缀:ISW1N3LSLNK0
Which makes it impossible to configure the Filter at this stage. 这使得在此阶段无法配置过滤器。 Maybe someone could help me out and tell me how to work this thing around? 也许有人可以帮助我,告诉我如何解决这个问题?
This was a silly one. 这是一个愚蠢的。 I just have to define a name for the lambda function like: 我只需要为lambda函数定义一个名称,例如:
FunctionName: !Sub "some-function-name"
And then the log group will have the same name. 然后,日志组将具有相同的名称。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.