0

考虑日志输出:

2018-07-09 14:59:48,938 INFO [req-id:aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa] [sqs-m-id:aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa] [bucket:my-bucket] [s3Key:folder/myFile.pdf] com.mycompany.MyJavaClass - some message with spaces
2018-07-09 14:59:48,938 INFO [req-id:bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb] [sqs-m-id:bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb] [bucket:my-bucket] [s3Key:folder/myOtherFile.pdf] com.mycompany.MyJavaClass - some other message also with spaces
2018-07-09 14:59:48,938 INFO [req-id:bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb] [sqs-m-id:bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb] [bucket:my-bucket] [s3Key:folder/myOtherFile.pdf] com.mycompany.MyJavaClass - ELAPSED_TIME_NS 1520093301
START RequestId: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa Version: $LATEST

如何提取仅应用于ELAPSED_TIME_NS行的指标。并从中获取价值?

4

1 回答 1

1

这种模式应该适合你:

[..., message=ELAPSED_TIME_NS, nanoseconds]

在这里查看更多详细信息:https ://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html#extract-log-event-values

于 2018-07-09T19:54:52.470 回答