mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 12:56:46 +08:00
[@types/aws-lambda]: Add extractedFields optional field (#27670)
* [@types/aws-lambda]: Add extractedFields optional field Added an undocumented optional field to a datatype which is sent zipped and base64 encoded. This field is only available if users select certain options when creating a subscription filter. You can see the field used if you create a subscription filter to elasticsearch and look at the source for the builtin lambda. I couldn't find any documentation for this field except in the terms "fields extracted" [here](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html) and found some amazon code referencing it [here](https://github.com/amazon-archives/cloudwatch-logs-subscription-consumer/blob/master/src/test/resources/aws-lambda-log-example.json#L14). I nearly went insane tracking this down. * Narrow the type of extracted fields to string:string * Add test for extracted fields
This commit is contained in:
committed by
Sheetal Nandi
parent
c1b7e33e7f
commit
efe7ba616a
@@ -479,6 +479,7 @@ str = cloudwatchLogsDecodedData.messageType;
|
||||
str = cloudwatchLogsDecodedData.logEvents[0].id;
|
||||
num = cloudwatchLogsDecodedData.logEvents[0].timestamp;
|
||||
str = cloudwatchLogsDecodedData.logEvents[0].message;
|
||||
str = cloudwatchLogsDecodedData.logEvents[0].extractedFields!["example"];
|
||||
|
||||
/* ClientContext */
|
||||
clientContextClient = clientCtx.client;
|
||||
|
||||
1
types/aws-lambda/index.d.ts
vendored
1
types/aws-lambda/index.d.ts
vendored
@@ -371,6 +371,7 @@ export interface CloudWatchLogsLogEvent {
|
||||
id: string;
|
||||
timestamp: number;
|
||||
message: string;
|
||||
extractedFields?: {[key: string]: string};
|
||||
}
|
||||
|
||||
// Context
|
||||
|
||||
Reference in New Issue
Block a user