describe-log-groups

Quick search

    How to describe log groups

    The command provides a list of specified log groups and allows you to filter the results according to prefix.

    describe-log groups This is a paginated operation. An entire set of data can be retrieved by issuing multiple API calls. Using the --no-paginated argument, will disable any pagination. When --query and --output text arguments are applied on a paginated response, it is compulsory that the --query argument extracts the data of the results for the query expression: logGroups.

    Syntax

    describe-log-groups
    [--log-group-name-prefix <value>]
    [--cli-input-json <value>]
    [--starting-token <value>]
    [--page-size <value>]
    [--max-items <value>]
    [--generate-cli-skeleton <value>]

    Syntax Description

    --log group name (string)

    the prefix to match.

    --cli-input-json (string)

    When a JSON string is provided the --cli-input-json performs a service operation on it. generate-cli-skeleton generates a format for JSON strings to follow. JSON provided values are overridden by CLI values if any other arguments are provided on the command line. You cannot use a JSON-provided value to pass any arbitrary binary value as the string will be take literally.

    --starting-token (string)

    a token to indicate where pagination should start. This is a token NextToken that is generated from a previous truncated response.

    --page-size (string)

    Describes the size of each page in the AWS service call. A smaller page size leads to more AWS calls and fewer items are retrieved per call and this prevents service call time-outs. The number of items returned in the command's output is not affected.

    --max-items (string)

    The total number of items a command's output returns. If the value specified is less than the total number of items, then NextToken is generated in the command's output. When you provide the NextToken value in the starting-token argument of the following command, pagination is resumed. Make sure that the NextToken is NOT used directly outside of AWS CLI.

    generate-cli-skeleton (string)

    Prints a JSON skeleton to standard output. This is done without sending an API request.

    • For a value input or no value: A sample input JSON is printed and used as a --cli-input-json argument.
    • For a value output: command inputs are validated and a sample output JSON is returned for that command.

    Instance:

    Objective: To describe a specified log group named "first-log".

    aws logs describe-log-groups --log-group-name-prefix my-logs

    Results

    {
        "logGroups": [
            {
                "storedBytes": 0,
                "metricFilterCount": 0,
                "creationTime": 1433189500783,
                "logGroupName": "my-logs",
                "retentionInDays": 5,
                "arn": "arn:aws:logs:us-west-2:0123456789012:log-group:my-logs:*"
            }
        ]
    }
    					

    Result Description

    logGroups -> (list)
    The log groups.
    (structure)
    Represents a log group.

    logGroupName -> (string)
    The name of the log group.

    creationTime -> (long)
    -Describes when the export task was created. It is expressed in the number of milliseconds after Jan 1, 1970 00:00:00 UTC.

    retentionInDays -> (integer)
    Specifies number of days to retain the log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, and 3653.

    metricFilterCount -> (integer)
    The number of metric filters.

    arn -> (string)
    The Amazon Resource Name (ARN) of the log group.

    storedBytes -> (long)
    The number of bytes stored.

    kmsKeyId -> (string)
    The Amazon Resource Name (ARN) of the CMK used to encrypt log data.

    nextToken -> (string)
    -The token to return the next set of items. It lasts for 24 hours.

    EventLog Analyzer

    EventLog Analyzer, a one-stop log management solution, collects, analyzes, correlates, and archives log data from you on-premises as well as cloud network.With its in-depth log analysis capability, EventLog Analyzer helps enterprises to thwart security threats in real-time, spot anomalous user behaviors, and manage security incidents effectively. Want to know how our solution helps you protect your cloud environment? Check out.

    Download now

    © 2020 Zoho Corporation Pvt. Ltd. All rights reserved.