# Ignore a set of domains

**URL:** https://discourse.mitmproxy.org/t/ignore-a-set-of-domains/788
**Category:** help
**Created:** [January 7, 2018, 5:00pm UTC](https://discourse.mitmproxy.org/t/ignore-a-set-of-domains/788 "2018-01-07T17:00:04Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![roryjtowler](https://avatars.discourse-cdn.com/v4/letter/r/e68b1a/32.png) [@roryjtowler](https://discourse.mitmproxy.org/u/roryjtowler)
#### Post date: [January 7, 2018, 5:00pm UTC](https://discourse.mitmproxy.org/t/ignore-a-set-of-domains/788/1 "2018-01-07T17:00:04Z")

</div>

Hi, so Ive played around with some filter expressions and the one thing I have consistently failed to do it correctly filter OUT certain domains. For example I’d like to filter out everything that has ‘accuweather’ in the URL. Furthermore I’d like to be able to filter out multiple domains this way. I’m doing this using the ‘Filtering saved traffic’ feature mitmdump provides.

Heres what I know

mitmdump -nr Infile -w testFilter [google.com](http://google.com) filters everything but [google.com](http://google.com) in the URL

when I try to use a Unary not it produces an error “-bash: !: event not found”. I assumed that if you could filter everything but something, you could filter out just that one url. But this doesn’t work with a !. Even trying the filter expression !(~q & ~t “text/html”) as a test to see if unary not worked…didn’t work.

So if anyone could provide help with this this would be much appreciated.

ps I’ve tried to use --ignore but that doesn’t quite seem to work. I don’t think Ive quite grasped it.

---

<div class="post-metadata">

### Author: ![mhils](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mitmproxy.org/mhils/32/7_2.png) [@mhils](https://discourse.mitmproxy.org/u/mhils)
#### Post date: [January 7, 2018, 9:53pm UTC](https://discourse.mitmproxy.org/t/ignore-a-set-of-domains/788/2 "2018-01-07T21:53:39Z")

</div>

Hi,

if you invoke this from bash, you probably need an additional pair of quotes around your filter. Otherwise bash will interpret is as bash stuff. 🙂

---

<div class="post-metadata">

### Author: ![roryjtowler](https://avatars.discourse-cdn.com/v4/letter/r/e68b1a/32.png) [@roryjtowler](https://discourse.mitmproxy.org/u/roryjtowler)
#### Post date: [January 8, 2018, 1:55pm UTC](https://discourse.mitmproxy.org/t/ignore-a-set-of-domains/788/3 "2018-01-08T13:55:24Z")

</div>

Thanks for the speedy reply mhils, much appreciated. I’ve worked out how it works and its basically the need for ’ rather than "

So for anyone in future need of help, you can filter out by simply putting something like this

**mitmdump -nr infile -w outfile ‘!accuweather’**

and this will filter anything with ‘accuweather’ in it. This can of course be used in conjunction with & to filter out multiple transactions.

Hope this helps 🙂
