Returns a list of the fields that are included in log events in the specified log group.
Includes the percentage of log events that contain each field. The search is limited to a time
period that you specify.
You can specify the log group to search by using either logGroupIdentifier or logGroupName.
You must specify one of these parameters, but you can't specify both.
In the results, fields that start with @ are fields generated by CloudWatch
Logs. For example, @timestamp is the timestamp of each log event. For more
information about the fields that are generated by CloudWatch logs, see Supported
Logs and Discovered Fields.
The response results are sorted by the frequency percentage, starting
with the highest percentage.
If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account and
view data from the linked source accounts. For more information, see
CloudWatch cross-account observability.
Example
Use a bare-bones client and the command you need to make an API call.
Returns a list of the fields that are included in log events in the specified log group. Includes the percentage of log events that contain each field. The search is limited to a time period that you specify.
You can specify the log group to search by using either
logGroupIdentifier
orlogGroupName
. You must specify one of these parameters, but you can't specify both.In the results, fields that start with
@
are fields generated by CloudWatch Logs. For example,@timestamp
is the timestamp of each log event. For more information about the fields that are generated by CloudWatch logs, see Supported Logs and Discovered Fields.The response results are sorted by the frequency percentage, starting with the highest percentage.
If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account and view data from the linked source accounts. For more information, see CloudWatch cross-account observability.
Example
Use a bare-bones client and the command you need to make an API call.
Param
GetLogGroupFieldsCommandInput
Returns
GetLogGroupFieldsCommandOutput
See
input
shape.response
shape.config
shape.Throws
InvalidParameterException (client fault)
A parameter is specified incorrectly.
Throws
LimitExceededException (client fault)
You have reached the maximum number of resources that can be created.
Throws
ResourceNotFoundException (client fault)
The specified resource does not exist.
Throws
ServiceUnavailableException (server fault)
The service cannot complete the request.
Throws
CloudWatchLogsServiceException
Base exception class for all service exceptions from CloudWatchLogs service.