Sensor Usage - CrowdStrike/falconpy GitHub Wiki

CrowdStrike Falcon CrowdStrike Subreddit

Using the Sensor Usage service collection

Uber class support Service class support Documentation Version Page Updated

Table of Contents

Operation ID Description
GetSensorUsageHourly
PEP 8 get_hourly_usage
Fetches hourly average. Each data point represents the average of how many unique AIDs were seen per hour for the previous 28 days.
GetSensorUsageWeekly
PEP 8 get_weekly_usage
Fetches weekly average. Each data point represents the average of how many unique AIDs were seen per week for the previous 28 days.

Passing credentials

WARNING

client_id and client_secret are keyword arguments that contain your CrowdStrike API credentials. Please note that all examples below do not hard code these values. (These values are ingested as strings.)

CrowdStrike does not recommend hard coding API credentials or customer identifiers within source code.

GetSensorUsageHourly

Fetches hourly average. Each data point represents the average of how many unique AIDs were seen per hour for the previous 28 days.

PEP8 method name

get_hourly_usage

Endpoint

Method Route
GET /billing-dashboards-usage/aggregates/hourly-average/v1

Required Scope

sensor-usage:read

Content-Type

  • Consumes: application/json
  • Produces: application/json

Keyword Arguments

Name Service Uber Type Data type Description
filter Service Class Support Uber Class Support query string The FQL search filter.
parameters Service Class Support Uber Class Support query dictionary Full query string parameters payload in JSON format. Not required if using other keywords.
Allowed filters
Filter Description
event_date A specified date that will be final date of the results returned. Specified date cannot be after the default. Format: 2024-06-11, Default: the current date, minus 2 days, in UTC
period An integer surrounded by single quotes representing the number of days to return. Format: 30, Default: 28, Minimum: 1, Maximum: 395
selected_cids A comma delimited list of CIDs to return data for. Caller must be a parent CID or have special access enabled. Format: cid_1,cid_2,cid_3, Default: for parent CIDs the default is the parent and all children, otherwise the current CID

Usage

Service class example (PEP8 syntax)
from falconpy import SensorUsage

# Do not hardcode API credentials!
falcon = SensorUsage(client_id=CLIENT_ID,
                     client_secret=CLIENT_SECRET
                     )

response = falcon.get_hourly_usage(filter="string")
print(response)
Service class example (Operation ID syntax)
from falconpy import SensorUsage

# Do not hardcode API credentials!
falcon = SensorUsage(client_id=CLIENT_ID,
                     client_secret=CLIENT_SECRET
                     )

response = falcon.GetSensorUsageHourly(filter="string")
print(response)
Uber class example
from falconpy import APIHarnessV2

# Do not hardcode API credentials!
falcon = APIHarnessV2(client_id=CLIENT_ID,
                      client_secret=CLIENT_SECRET
                      )

response = falcon.command("GetSensorUsageHourly", filter="string")
print(response)

Back to Table of Contents

GetSensorUsageWeekly

Fetches weekly average. Each data point represents the average of how many unique AIDs were seen per week for the previous 28 days.

PEP8 method name

get_weekly_usage

Endpoint

Method Route
GET /billing-dashboards-usage/aggregates/weekly-average/v1

Required Scope

sensor-usage:read

Content-Type

  • Consumes: application/json
  • Produces: application/json

Keyword Arguments

Name Service Uber Type Data type Description
filter Service Class Support Uber Class Support query string The FQL search filter.
parameters Service Class Support Uber Class Support query dictionary Full query string parameters payload in JSON format. Not required if using other keywords.
Allowed filters
Filter Description
event_date A specified date that will be final date of the results returned. Specified date cannot be after the default. Format: 2024-06-11, Default: the current date, minus 2 days, in UTC
period An integer surrounded by single quotes representing the number of days to return. Format: 30, Default: 28, Minimum: 1, Maximum: 395
selected_cids A comma delimited list of CIDs to return data for. Caller must be a parent CID or have special access enabled. Format: cid_1,cid_2,cid_3, Default: for parent CIDs the default is the parent and all children, otherwise the current CID

Usage

Service class example (PEP8 syntax)
from falconpy import SensorUsage

# Do not hardcode API credentials!
falcon = SensorUsage(client_id=CLIENT_ID,
                     client_secret=CLIENT_SECRET
                     )

response = falcon.get_weekly_usage(filter="string")
print(response)
Service class example (Operation ID syntax)
from falconpy import SensorUsage

# Do not hardcode API credentials!
falcon = SensorUsage(client_id=CLIENT_ID,
                     client_secret=CLIENT_SECRET
                     )

response = falcon.GetSensorUsageWeekly(filter="string")
print(response)
Uber class example
from falconpy import APIHarnessV2

# Do not hardcode API credentials!
falcon = APIHarnessV2(client_id=CLIENT_ID,
                      client_secret=CLIENT_SECRET
                      )

response = falcon.command("GetSensorUsageWeekly", filter="string")

print(response)

Back to Table of Contents

⚠️ **GitHub.com Fallback** ⚠️