Skip to content

Lists GuardDuty findings statistics for the specified detector ID

Description

Lists GuardDuty findings statistics for the specified detector ID.

You must provide either findingStatisticTypes or groupBy parameter, and not both. You can use the maxResults and orderBy parameters only when using groupBy.

There might be regional differences because some flags might not be available in all the Regions where GuardDuty is currently supported. For more information, see Regions and endpoints.

Usage

guardduty_get_findings_statistics(DetectorId, FindingStatisticTypes,
  FindingCriteria, GroupBy, OrderBy, MaxResults)

Arguments

  • DetectorId

    [required] The ID of the detector whose findings statistics you want to retrieve.

    To find the detectorId in the current Region, see the Settings page in the GuardDuty console, or run the list_detectors API.

  • FindingStatisticTypes

    The types of finding statistics to retrieve.

  • FindingCriteria

    Represents the criteria that is used for querying findings.

  • GroupBy

    Displays the findings statistics grouped by one of the listed valid values.

  • OrderBy

    Displays the sorted findings in the requested order. The default value of orderBy is DESC.

    You can use this parameter only with the groupBy parameter.

  • MaxResults

    The maximum number of results to be returned in the response. The default value is 25.

    You can use this parameter only with the groupBy parameter.

Value

A list with the following syntax:

list(
  FindingStatistics = list(
    CountBySeverity = list(
      123
    ),
    GroupedByAccount = list(
      list(
        AccountId = "string",
        LastGeneratedAt = as.POSIXct(
          "2015-01-01"
        ),
        TotalFindings = 123
      )
    ),
    GroupedByDate = list(
      list(
        Date = as.POSIXct(
          "2015-01-01"
        ),
        LastGeneratedAt = as.POSIXct(
          "2015-01-01"
        ),
        Severity = 123.0,
        TotalFindings = 123
      )
    ),
    GroupedByFindingType = list(
      list(
        FindingType = "string",
        LastGeneratedAt = as.POSIXct(
          "2015-01-01"
        ),
        TotalFindings = 123
      )
    ),
    GroupedByResource = list(
      list(
        AccountId = "string",
        LastGeneratedAt = as.POSIXct(
          "2015-01-01"
        ),
        ResourceId = "string",
        ResourceType = "string",
        TotalFindings = 123
      )
    ),
    GroupedBySeverity = list(
      list(
        LastGeneratedAt = as.POSIXct(
          "2015-01-01"
        ),
        Severity = 123.0,
        TotalFindings = 123
      )
    )
  ),
  NextToken = "string"
)

Request syntax

svc$get_findings_statistics(
  DetectorId = "string",
  FindingStatisticTypes = list(
    "COUNT_BY_SEVERITY"
  ),
  FindingCriteria = list(
    Criterion = list(
      list(
        Eq = list(
          "string"
        ),
        Neq = list(
          "string"
        ),
        Gt = 123,
        Gte = 123,
        Lt = 123,
        Lte = 123,
        Equals = list(
          "string"
        ),
        NotEquals = list(
          "string"
        ),
        GreaterThan = 123,
        GreaterThanOrEqual = 123,
        LessThan = 123,
        LessThanOrEqual = 123,
        Matches = list(
          "string"
        ),
        NotMatches = list(
          "string"
        )
      )
    )
  ),
  GroupBy = "ACCOUNT"|"DATE"|"FINDING_TYPE"|"RESOURCE"|"SEVERITY",
  OrderBy = "ASC"|"DESC",
  MaxResults = 123
)