netflow_config
Creates, updates, deletes, gets or lists a netflow_config resource.
Overview
| Name | netflow_config |
| Type | Resource |
| Id | cloudflare.magic_transit.netflow_config |
Fields
The following fields are returned by SELECT queries:
- list
Get NetFlow Configuration response
| Name | Datatype | Description |
|---|---|---|
active_timeout | integer | Timeout in seconds for active flows (defaults to 30). |
collector_ip | string | IPv4 address of the NetFlow collector. (example: 162.159.65.1) |
collector_port | integer | UDP port of the NetFlow collector (defaults to 2055). |
inactive_timeout | integer | Timeout in seconds for inactive flows (defaults to 15). |
sampling_rate | integer | Sampling rate for NetFlow records (1 = every packet, 1000 = 1 in 1000 packets). Defaults to 1. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | account_id, site_id | Get NetFlow configuration for a site. | |
magic_site_netflow_config_create_netflow_config | insert | account_id, site_id | Creates a NetFlow configuration for a site. | |
magic_site_netflow_config_patch_netflow_config | update | account_id, site_id | Updates NetFlow configuration for a site. | |
magic_site_netflow_config_update_netflow_config | replace | account_id, site_id | Updates NetFlow configuration for a site (partial update). | |
magic_site_netflow_config_delete_netflow_config | delete | account_id, site_id | Remove NetFlow configuration for a site. |
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.
| Name | Datatype | Description |
|---|---|---|
account_id | string | The Cloudflare account ID. |
site_id | string | The site ID. |
SELECT examples
- list
Get NetFlow configuration for a site.
SELECT
active_timeout,
collector_ip,
collector_port,
inactive_timeout,
sampling_rate
FROM cloudflare.magic_transit.netflow_config
WHERE account_id = '{{ account_id }}' -- required
AND site_id = '{{ site_id }}' -- required
;
INSERT examples
- magic_site_netflow_config_create_netflow_config
- Manifest
Creates a NetFlow configuration for a site.
INSERT INTO cloudflare.magic_transit.netflow_config (
active_timeout,
collector_ip,
collector_port,
inactive_timeout,
sampling_rate,
account_id,
site_id
)
SELECT
{{ active_timeout }},
'{{ collector_ip }}',
{{ collector_port }},
{{ inactive_timeout }},
{{ sampling_rate }},
'{{ account_id }}',
'{{ site_id }}'
RETURNING
errors,
messages,
result,
success
;
# Description fields are for documentation purposes
- name: netflow_config
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the netflow_config resource.
- name: site_id
value: "{{ site_id }}"
description: Required parameter for the netflow_config resource.
- name: active_timeout
value: {{ active_timeout }}
description: |
Timeout in seconds for active flows.
- name: collector_ip
value: "{{ collector_ip }}"
description: |
IPv4 address of the NetFlow collector.
- name: collector_port
value: {{ collector_port }}
description: |
UDP port of the NetFlow collector.
- name: inactive_timeout
value: {{ inactive_timeout }}
description: |
Timeout in seconds for inactive flows.
- name: sampling_rate
value: {{ sampling_rate }}
description: |
Sampling rate for NetFlow records (1 = every packet).
UPDATE examples
- magic_site_netflow_config_patch_netflow_config
Updates NetFlow configuration for a site.
UPDATE cloudflare.magic_transit.netflow_config
SET
active_timeout = {{ active_timeout }},
collector_ip = '{{ collector_ip }}',
collector_port = {{ collector_port }},
inactive_timeout = {{ inactive_timeout }},
sampling_rate = {{ sampling_rate }}
WHERE
account_id = '{{ account_id }}' --required
AND site_id = '{{ site_id }}' --required
RETURNING
errors,
messages,
result,
success;
REPLACE examples
- magic_site_netflow_config_update_netflow_config
Updates NetFlow configuration for a site (partial update).
REPLACE cloudflare.magic_transit.netflow_config
SET
active_timeout = {{ active_timeout }},
collector_ip = '{{ collector_ip }}',
collector_port = {{ collector_port }},
inactive_timeout = {{ inactive_timeout }},
sampling_rate = {{ sampling_rate }}
WHERE
account_id = '{{ account_id }}' --required
AND site_id = '{{ site_id }}' --required
RETURNING
errors,
messages,
result,
success;
DELETE examples
- magic_site_netflow_config_delete_netflow_config
Remove NetFlow configuration for a site.
DELETE FROM cloudflare.magic_transit.netflow_config
WHERE account_id = '{{ account_id }}' --required
AND site_id = '{{ site_id }}' --required
;