aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/docs/features/filters.rst
blob: 2adcfb7067c55bf3af93720bbd6dc153c7c90105 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
.. _filters:

Filter expressions
==================

Many commands in :program:`mitmproxy` and :program:`mitmdump` take a filter expression.
Filter expressions consist of the following operators:

.. documentedlist::
    :header: "Expression" "Description"
    :listobject: libmproxy.filt.help

- Regexes are Python-style
- Regexes can be specified as quoted strings
- Header matching (~h, ~hq, ~hs) is against a string of the form "name: value".
- Strings with no operators are matched against the request URL.
- The default binary operator is &.

Examples
--------

URL containing "google.com":

.. code-block:: none

    google\.com

Requests whose body contains the string "test":

.. code-block:: none

    ~q ~b test

Anything but requests with a text/html content type:

.. code-block:: none

    !(~q & ~t "text/html")