Skip to main content

filters

Creates, updates, deletes, gets or lists a filters resource.

Overview

Namefilters
TypeResource
Idaws.guardduty.filters

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
actionstringSpecifies the action that is to be applied to the findings that match the filter. (NOOP, ARCHIVE)
created_atstring (date-time)The timestamp when the filter was created. This field is not available for filters that were created before the lifecycle metadata feature was enabled (legacy filters).
descriptionstringThe description of the filter.
finding_criteriaobjectContains information about the criteria used for querying findings.
namestringThe name of the filter.
rankintegerSpecifies the position of the filter in the list of current filters. Also specifies the order in which this filter is applied to the findings.
tagsobjectThe tags of the filter resource.
updated_atstring (date-time)The timestamp when the filter was last updated. For legacy filters, this field is present only after the filter has been updated at least once since the lifecycle metadata feature was enabled.
versioninteger (int64)The version of the filter. Every time the filter is updated, the version increments by 1. This field is not available for legacy filters that were created before the lifecycle metadata feature was enabled.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_filterselectdetector_id, filter_name, regionReturns the details of the filter specified by the filter name.
list_filtersselectdetector_id, regionmaxResults, nextTokenReturns a paginated list of the current filters.
create_filterinsertdetector_id, region, FindingCriteriaCreates a filter using the specified finding criteria. The maximum number of saved filters per Amazon Web Services account per Region is 100. For more information, see Quotas for GuardDuty.
update_filterupdatedetector_id, filter_name, regionUpdates the filter specified by the filter name.
delete_filterdeletedetector_id, filter_name, regionDeletes the filter specified by the filter name.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
detector_idstringThe unique ID of the detector that is associated with the filter. To find the detectorId in the current Region, see the Settings page in the GuardDuty console, or run the ListDetectors API.
filter_namestringThe name of the filter that you want to delete.
regionstringAWS region (default: us-east-1)
maxResultsintegerYou can use this parameter to indicate the maximum number of items that you want in the response. The default value is 50. The maximum value is 50.
nextTokenstringYou can use this parameter when paginating results. Set the value of this parameter to null on your first call to the list action. For subsequent calls to the action, fill nextToken in the request with the value of NextToken from the previous response to continue listing data.

SELECT examples

Returns the details of the filter specified by the filter name.

SELECT
action,
created_at,
description,
finding_criteria,
name,
rank,
tags,
updated_at,
version
FROM aws.guardduty.filters
WHERE detector_id = '{{ detector_id }}' -- required
AND filter_name = '{{ filter_name }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a filter using the specified finding criteria. The maximum number of saved filters per Amazon Web Services account per Region is 100. For more information, see Quotas for GuardDuty.

INSERT INTO aws.guardduty.filters (
Name,
Description,
Action,
Rank,
FindingCriteria,
ClientToken,
Tags,
detector_id,
region
)
SELECT
'{{ Name }}',
'{{ Description }}',
'{{ Action }}',
{{ Rank }},
'{{ FindingCriteria }}' /* required */,
'{{ ClientToken }}',
'{{ Tags }}',
'{{ detector_id }}',
'{{ region }}'
RETURNING
name
;

UPDATE examples

Updates the filter specified by the filter name.

UPDATE aws.guardduty.filters
SET
Description = '{{ Description }}',
Action = '{{ Action }}',
Rank = {{ Rank }},
FindingCriteria = '{{ FindingCriteria }}'
WHERE
detector_id = '{{ detector_id }}' --required
AND filter_name = '{{ filter_name }}' --required
AND region = '{{ region }}' --required
RETURNING
name;

DELETE examples

Deletes the filter specified by the filter name.

DELETE FROM aws.guardduty.filters
WHERE detector_id = '{{ detector_id }}' --required
AND filter_name = '{{ filter_name }}' --required
AND region = '{{ region }}' --required
;