aboutsummaryrefslogtreecommitdiffstats
path: root/doc-src/filters.html
blob: 2424c6f8e13b349d5f2992e75c0578912040fd31 (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
Many commands in __mitmproxy__ and __mitmdump__ take a filter expression.
Filter expressions consist of the following operators:

<table>
    <!--(for i in filt_help)-->
        <tr>
            <td class="filt_cmd">@!i[0]!@</td>
            <td class="filt_help">@!i[1]!@</td>
        </tr>
    <!--(end)-->
</table>

- 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 &amp;.

Examples
========

URL containing "google.com":

    google\.com

Requests whose body contains the string "test":

    ~q ~b test

Anything but requests with a text/html content type:

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