Skip to content
Start here

Get layer 3 attacks time series grouped by dimension

client.Radar.Attacks.Layer3.TimeseriesGroupsV2(ctx, dimension, query) (*AttackLayer3TimeseriesGroupsV2Response, error)
GET/radar/attacks/layer3/timeseries_groups/{dimension}

Retrieves the distribution of layer 3 attacks grouped by dimension over time.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
User Details WriteUser Details Read
ParametersExpand Collapse

Specifies the attribute by which to group the results.

One of the following:
const AttackLayer3TimeseriesGroupsV2ParamsDimensionProtocol AttackLayer3TimeseriesGroupsV2ParamsDimension = "PROTOCOL"
const AttackLayer3TimeseriesGroupsV2ParamsDimensionIPVersion AttackLayer3TimeseriesGroupsV2ParamsDimension = "IP_VERSION"
const AttackLayer3TimeseriesGroupsV2ParamsDimensionVector AttackLayer3TimeseriesGroupsV2ParamsDimension = "VECTOR"
const AttackLayer3TimeseriesGroupsV2ParamsDimensionDuration AttackLayer3TimeseriesGroupsV2ParamsDimension = "DURATION"
const AttackLayer3TimeseriesGroupsV2ParamsDimensionBitrate AttackLayer3TimeseriesGroupsV2ParamsDimension = "BITRATE"
const AttackLayer3TimeseriesGroupsV2ParamsDimensionVertical AttackLayer3TimeseriesGroupsV2ParamsDimension = "VERTICAL"
const AttackLayer3TimeseriesGroupsV2ParamsDimensionIndustry AttackLayer3TimeseriesGroupsV2ParamsDimension = "INDUSTRY"
query AttackLayer3TimeseriesGroupsV2Params
AggInterval param.Field[AttackLayer3TimeseriesGroupsV2ParamsAggInterval]Optional

Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). Refer to Aggregation intervals.

const AttackLayer3TimeseriesGroupsV2ParamsAggInterval15m AttackLayer3TimeseriesGroupsV2ParamsAggInterval = "15m"
const AttackLayer3TimeseriesGroupsV2ParamsAggInterval1h AttackLayer3TimeseriesGroupsV2ParamsAggInterval = "1h"
const AttackLayer3TimeseriesGroupsV2ParamsAggInterval1d AttackLayer3TimeseriesGroupsV2ParamsAggInterval = "1d"
const AttackLayer3TimeseriesGroupsV2ParamsAggInterval1w AttackLayer3TimeseriesGroupsV2ParamsAggInterval = "1w"
Continent param.Field[[]string]Optional

Filters results by continent. Specify a comma-separated list of alpha-2 codes. Prefix with - to exclude continents from results. For example, -EU,NA excludes results from EU, but includes results from NA.

DateEnd param.Field[[]Time]Optional

End of the date range (inclusive).

DateRange param.Field[[]string]Optional

Filters results by date range. For example, use 7d and 7dcontrol to compare this week with the previous week. Use this parameter or set specific start and end dates (dateStart and dateEnd parameters).

DateStart param.Field[[]Time]Optional

Start of the date range.

Direction param.Field[AttackLayer3TimeseriesGroupsV2ParamsDirection]Optional

Specifies whether the location filter applies to the source or target location.

const AttackLayer3TimeseriesGroupsV2ParamsDirectionOrigin AttackLayer3TimeseriesGroupsV2ParamsDirection = "ORIGIN"
const AttackLayer3TimeseriesGroupsV2ParamsDirectionTarget AttackLayer3TimeseriesGroupsV2ParamsDirection = "TARGET"
Format param.Field[AttackLayer3TimeseriesGroupsV2ParamsFormat]Optional

Format in which results will be returned.

const AttackLayer3TimeseriesGroupsV2ParamsFormatJson AttackLayer3TimeseriesGroupsV2ParamsFormat = "JSON"
const AttackLayer3TimeseriesGroupsV2ParamsFormatCsv AttackLayer3TimeseriesGroupsV2ParamsFormat = "CSV"
IPVersion param.Field[[]AttackLayer3TimeseriesGroupsV2ParamsIPVersion]Optional

Filters results by IP version (Ipv4 vs. IPv6).

const AttackLayer3TimeseriesGroupsV2ParamsIPVersionIPv4 AttackLayer3TimeseriesGroupsV2ParamsIPVersion = "IPv4"
const AttackLayer3TimeseriesGroupsV2ParamsIPVersionIPv6 AttackLayer3TimeseriesGroupsV2ParamsIPVersion = "IPv6"
LimitPerGroup param.Field[int64]Optional

Limits the number of objects per group to the top items within the specified time range. When item count exceeds the limit, extra items appear grouped under an “other” category.

Location param.Field[[]string]Optional

Filters results by location. Specify a comma-separated list of alpha-2 codes. Prefix with - to exclude locations from results. For example, -US,PT excludes results from the US, but includes results from PT.

Name param.Field[[]string]Optional

Array of names used to label the series in the response.

Normalization param.Field[AttackLayer3TimeseriesGroupsV2ParamsNormalization]Optional

Normalization method applied to the results. Refer to Normalization methods.

const AttackLayer3TimeseriesGroupsV2ParamsNormalizationPercentage AttackLayer3TimeseriesGroupsV2ParamsNormalization = "PERCENTAGE"
const AttackLayer3TimeseriesGroupsV2ParamsNormalizationMin0Max AttackLayer3TimeseriesGroupsV2ParamsNormalization = "MIN0_MAX"
Protocol param.Field[[]AttackLayer3TimeseriesGroupsV2ParamsProtocol]Optional

Filters the results by layer 3/4 protocol.

const AttackLayer3TimeseriesGroupsV2ParamsProtocolUdp AttackLayer3TimeseriesGroupsV2ParamsProtocol = "UDP"
const AttackLayer3TimeseriesGroupsV2ParamsProtocolTCP AttackLayer3TimeseriesGroupsV2ParamsProtocol = "TCP"
const AttackLayer3TimeseriesGroupsV2ParamsProtocolIcmp AttackLayer3TimeseriesGroupsV2ParamsProtocol = "ICMP"
const AttackLayer3TimeseriesGroupsV2ParamsProtocolGRE AttackLayer3TimeseriesGroupsV2ParamsProtocol = "GRE"
ReturnsExpand Collapse
type AttackLayer3TimeseriesGroupsV2Response struct{…}
Meta AttackLayer3TimeseriesGroupsV2ResponseMeta

Metadata for the results.

AggInterval AttackLayer3TimeseriesGroupsV2ResponseMetaAggInterval

Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). Refer to Aggregation intervals.

One of the following:
const AttackLayer3TimeseriesGroupsV2ResponseMetaAggIntervalFifteenMinutes AttackLayer3TimeseriesGroupsV2ResponseMetaAggInterval = "FIFTEEN_MINUTES"
const AttackLayer3TimeseriesGroupsV2ResponseMetaAggIntervalOneHour AttackLayer3TimeseriesGroupsV2ResponseMetaAggInterval = "ONE_HOUR"
const AttackLayer3TimeseriesGroupsV2ResponseMetaAggIntervalOneDay AttackLayer3TimeseriesGroupsV2ResponseMetaAggInterval = "ONE_DAY"
const AttackLayer3TimeseriesGroupsV2ResponseMetaAggIntervalOneWeek AttackLayer3TimeseriesGroupsV2ResponseMetaAggInterval = "ONE_WEEK"
const AttackLayer3TimeseriesGroupsV2ResponseMetaAggIntervalOneMonth AttackLayer3TimeseriesGroupsV2ResponseMetaAggInterval = "ONE_MONTH"
ConfidenceInfo AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfo
Annotations []AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotation
DataSource AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSource

Data source for annotations.

One of the following:
const AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSourceAll AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSource = "ALL"
const AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSourceAIBots AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSource = "AI_BOTS"
const AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSourceAIGateway AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSource = "AI_GATEWAY"
const AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSourceBGP AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSource = "BGP"
const AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSourceBots AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSource = "BOTS"
const AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSourceConnectionAnomaly AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSource = "CONNECTION_ANOMALY"
const AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSourceCT AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSource = "CT"
const AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSourceDNS AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSource = "DNS"
const AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSourceDNSMagnitude AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_MAGNITUDE"
const AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSourceDNSAS112 AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_AS112"
const AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSourceDos AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSource = "DOS"
const AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSourceEmailRouting AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_ROUTING"
const AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSourceEmailSecurity AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_SECURITY"
const AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSourceFw AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSource = "FW"
const AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSourceFwPg AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSource = "FW_PG"
const AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSourceHTTP AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP"
const AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSourceHTTPControl AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CONTROL"
const AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSourceHTTPCrawlerReferer AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CRAWLER_REFERER"
const AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSourceHTTPOrigins AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_ORIGINS"
const AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSourceIQI AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSource = "IQI"
const AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSourceLeakedCredentials AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSource = "LEAKED_CREDENTIALS"
const AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSourceNet AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSource = "NET"
const AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSourceRobotsTXT AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSource = "ROBOTS_TXT"
const AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSourceSpeed AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSource = "SPEED"
const AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSourceWorkersAI AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsDataSource = "WORKERS_AI"
Description string
EndDate Time
formatdate-time
EventType AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsEventType

Event type for annotations.

One of the following:
const AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsEventTypeEvent AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsEventType = "EVENT"
const AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsEventTypeGeneral AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsEventType = "GENERAL"
const AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsEventTypeOutage AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsEventType = "OUTAGE"
const AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsEventTypePartialProjection AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsEventType = "PARTIAL_PROJECTION"
const AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsEventTypePipeline AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsEventType = "PIPELINE"
const AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsEventTypeTrafficAnomaly AttackLayer3TimeseriesGroupsV2ResponseMetaConfidenceInfoAnnotationsEventType = "TRAFFIC_ANOMALY"
IsInstantaneous bool

Whether event is a single point in time or a time range.

LinkedURL string
formaturi
StartDate Time
formatdate-time
Tags []stringOptional
Level int64

Provides an indication of how much confidence Cloudflare has in the data.

DateRange []AttackLayer3TimeseriesGroupsV2ResponseMetaDateRange
EndTime Time

Adjusted end of date range.

formatdate-time
StartTime Time

Adjusted start of date range.

formatdate-time
LastUpdated Time

Timestamp of the last dataset update.

formatdate-time
Normalization AttackLayer3TimeseriesGroupsV2ResponseMetaNormalization

Normalization method applied to the results. Refer to Normalization methods.

One of the following:
const AttackLayer3TimeseriesGroupsV2ResponseMetaNormalizationPercentage AttackLayer3TimeseriesGroupsV2ResponseMetaNormalization = "PERCENTAGE"
const AttackLayer3TimeseriesGroupsV2ResponseMetaNormalizationMin0Max AttackLayer3TimeseriesGroupsV2ResponseMetaNormalization = "MIN0_MAX"
const AttackLayer3TimeseriesGroupsV2ResponseMetaNormalizationMinMax AttackLayer3TimeseriesGroupsV2ResponseMetaNormalization = "MIN_MAX"
const AttackLayer3TimeseriesGroupsV2ResponseMetaNormalizationRawValues AttackLayer3TimeseriesGroupsV2ResponseMetaNormalization = "RAW_VALUES"
const AttackLayer3TimeseriesGroupsV2ResponseMetaNormalizationPercentageChange AttackLayer3TimeseriesGroupsV2ResponseMetaNormalization = "PERCENTAGE_CHANGE"
const AttackLayer3TimeseriesGroupsV2ResponseMetaNormalizationRollingAverage AttackLayer3TimeseriesGroupsV2ResponseMetaNormalization = "ROLLING_AVERAGE"
const AttackLayer3TimeseriesGroupsV2ResponseMetaNormalizationOverlappedPercentage AttackLayer3TimeseriesGroupsV2ResponseMetaNormalization = "OVERLAPPED_PERCENTAGE"
const AttackLayer3TimeseriesGroupsV2ResponseMetaNormalizationRatio AttackLayer3TimeseriesGroupsV2ResponseMetaNormalization = "RATIO"
Units []AttackLayer3TimeseriesGroupsV2ResponseMetaUnit

Measurement units for the results.

Name string
Value string
Serie0 AttackLayer3TimeseriesGroupsV2ResponseSerie0
Timestamps []Time

Get layer 3 attacks time series grouped by dimension

package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/cloudflare-go"
  "github.com/stainless-sdks/cloudflare-go/option"
  "github.com/stainless-sdks/cloudflare-go/radar"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  response, err := client.Radar.Attacks.Layer3.TimeseriesGroupsV2(
    context.TODO(),
    radar.AttackLayer3TimeseriesGroupsV2ParamsDimensionProtocol,
    radar.AttackLayer3TimeseriesGroupsV2Params{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Meta)
}
{
  "result": {
    "meta": {
      "aggInterval": "FIFTEEN_MINUTES",
      "confidenceInfo": {
        "annotations": [
          {
            "dataSource": "ALL",
            "description": "Cable cut in Tonga",
            "endDate": "2019-12-27T18:11:19.117Z",
            "eventType": "EVENT",
            "isInstantaneous": true,
            "linkedUrl": "https://example.com",
            "startDate": "2019-12-27T18:11:19.117Z",
            "tags": [
              "BOT_CLASS"
            ]
          }
        ],
        "level": 0
      },
      "dateRange": [
        {
          "endTime": "2022-09-17T10:22:57.555Z",
          "startTime": "2022-09-16T10:22:57.555Z"
        }
      ],
      "lastUpdated": "2019-12-27T18:11:19.117Z",
      "normalization": "PERCENTAGE",
      "units": [
        {
          "name": "*",
          "value": "requests"
        }
      ]
    },
    "serie_0": {
      "timestamps": [
        "2023-08-08T10:15:00Z"
      ]
    }
  },
  "success": true
}
Returns Examples
{
  "result": {
    "meta": {
      "aggInterval": "FIFTEEN_MINUTES",
      "confidenceInfo": {
        "annotations": [
          {
            "dataSource": "ALL",
            "description": "Cable cut in Tonga",
            "endDate": "2019-12-27T18:11:19.117Z",
            "eventType": "EVENT",
            "isInstantaneous": true,
            "linkedUrl": "https://example.com",
            "startDate": "2019-12-27T18:11:19.117Z",
            "tags": [
              "BOT_CLASS"
            ]
          }
        ],
        "level": 0
      },
      "dateRange": [
        {
          "endTime": "2022-09-17T10:22:57.555Z",
          "startTime": "2022-09-16T10:22:57.555Z"
        }
      ],
      "lastUpdated": "2019-12-27T18:11:19.117Z",
      "normalization": "PERCENTAGE",
      "units": [
        {
          "name": "*",
          "value": "requests"
        }
      ]
    },
    "serie_0": {
      "timestamps": [
        "2023-08-08T10:15:00Z"
      ]
    }
  },
  "success": true
}