# Script output usage?

**URL:** https://discourse.mitmproxy.org/t/script-output-usage/952
**Category:** help
**Created:** [April 2, 2018, 8:21pm UTC](https://discourse.mitmproxy.org/t/script-output-usage/952 "2018-04-02T20:21:39Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![chaseme](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mitmproxy.org/chaseme/32/296_2.png) [@chaseme](https://discourse.mitmproxy.org/u/chaseme)
#### Post date: [April 2, 2018, 8:21pm UTC](https://discourse.mitmproxy.org/t/script-output-usage/952/1 "2018-04-02T20:21:39Z")

</div>

Hello,

I’m a bit confused on how to use the example scripts provided with mitmproxy. Could someone provide me an example of how a script is supposed to be outputting data?

According to: [https://docs.mitmproxy.org/stable/overview-tools/#scripted-data-transformation](https://docs.mitmproxy.org/stable/overview-tools/#scripted-data-transformation)  
I should be able to run a script with mitmdump and receive output from the script in the following manner:

```auto
mitmdump -ns mitmproxy/examples/complex/har_dump.py -r traffic.mitm -w traffic.har

```

`har_dump.py` is the script doing the transformation of the mitmdump.

`traffic.mitm` is a previously generated file using this command: `mitmdump -s mitmproxy/examples/complex/har_dump.py -w traffic.mitm`

`traffic.har` is (from what I understand) supposed to be the output of the script.

* * *

What I get instead is just a straight copy of the `traffic.mitm` into `traffic.har`.

---

<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: [April 5, 2018, 11:50am UTC](https://discourse.mitmproxy.org/t/script-output-usage/952/2 "2018-04-05T11:50:30Z")

</div>

Hi,

`-w` is always used to indicate a mitmproxy dump file as output. The har\_dump script defines a (not very convincingly named) `hardump` option, which is the `-w` equivalent for har files. For example, you can run mitmproxy like this:

```auto
mitmdump -s examples/complex/har_dump.py -w dump.mitm --set hardump=dump.har

```

This would produce both a mitmproxy capture and a HAR dump.
