--- title: "prefilter" slug: "prefilter" updated: 2026-02-06T06:01:12Z published: 2026-02-06T06:01:12Z canonical: "docs.fmad.io/prefilter" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.fmad.io/llms.txt > Use this file to discover all available pages before exploring further. # prefilter Retrieval and modification of the [pre-capture filters](/v1/docs/fmadio-features-pre-capture-filter). --- ## /api/v1/capture/prefilter/get Returns a JSON object containing the configurations of all pre-capture filters. #### Address `/api/v1/capture/prefilter/get` #### Verb GET #### Arguments This endpoint has no parameters. #### Example ```bash curl -u fmadio:xxx -s 'https://192.168.108.10/api/v1/capture/prefilter/get' | jq {  "Status": true,  "Str": "[Thu Feb  5 07:46:46 2023] successfully fetched prefilter config",  "Policy": "ACCEPT",  "Slice": "64",  "Config": {    "prefilter0": {      "enable": true,      "action": "drop",      "value": "all==true",      "comment": ""    },    "prefilter1": {      "enable": false,      "action": "drop",      "value": "",      "comment": ""    },    # omitted for brevity...    "prefilter15": {      "enable": false,      "action": "drop",      "value": "",      "comment": ""    }  } } ``` --- ## /api/v1/capture/prefilter/set All-purpose configuration of a prefilter. #### Address `/api/v1/capture/prefilter/set` #### Verb GET #### Arguments | Parameter | Description | | --- | --- | | `Action` | Dictates what is done to the packet if it meets the condition set by the filter. Must be one of the following: - `accept` - `drop` - `slice` | | `FilterId` | Which filter to alter. Can be either of the following: - `prefilter` followed by a whole number from 0 to 16 (e.g. `prefilter1`) - A whole number from 0 to 16 | | `Enable` | Whether the filter should be active or inactive. Must be any of the following: - `enable` - `disable` - `true` - `false` | | `Value` | The prefilter expression to use. | #### Example ```bash curl -u fmadio:xxx -Gs --data-urlencode 'FilterID=1' --data-urlencode 'Enable=true' --data-urlencode 'Value=all==true' --data-urlencode 'Action=drop' 'https://192.168.108.10/v1/capture/prefilter/set' | jq {  "Status": true,  "Str": "[Fri Feb  6 15:26:57 2023] successfully updated" } ``` --- ## /api/v1/capture/prefilter/policy Configures the default pre-filter policy (i.e. what happens to a packet that passes the filter’s expression). #### Address `/api/v1/capture/prefilter/policy` #### Verb GET #### Arguments | Parameter | Description | | --- | --- | | `Policy` | Must be one of the following: - `accept` - `drop` - `slice` | #### Example ```bash curl -u fmadio:xxx -Gs --data-urlencode 'Policy=accept' 'https://192.168.108.10/api/v1/capture/prefilter/policy' | jq {  "Status": true,  "Str": "[Fri Feb  6 15:37:28 2023] successfully updated Policy to ACCEPT" } ``` --- ## /api/v1/capture/prefilter/slice Configure how many bytes will be kept from the start of a packet if it passes a filter whose action is set to `slice`. #### Address `/api/v1/capture/prefilter/slice` #### Verb GET #### Arguments | Parameter | Description | | --- | --- | | `Slice` | The number of bytes kept from the start of a packet if it passes a filter whose action is set to `slice`. Must be 64, 128, or 256. | #### Example ```bash curl -u fmadio:xxx -Gs --data-urlencode 'Slice=128' 'https://192.168.108.10/api/v1/capture/prefilter/slice' | jq {  "Status": true,  "Str": "[Fri Feb  6 15:35:00 2023] successfully updated slice to 128 Bytes" } ```