# cscli decisions import

## cscli decisions import[​](#cscli-decisions-import "Direct link to cscli decisions import")

Import decisions from a file or pipe

### Synopsis[​](#synopsis "Direct link to Synopsis")

expected format: csv : any of duration,reason,scope,type,value, with a header line json :`{"duration": "24h", "reason": "my_scenario", "scope": "ip", "type": "ban", "value": "x.y.z.z"}`

TEXTCOPY

```
cscli decisions import [options] [flags]
```

### Examples[​](#examples "Direct link to Examples")

TEXTCOPY

```
decisions.csv:
duration,scope,value
24h,ip,1.2.3.4

$ cscli decisions import -i decisions.csv

decisions.json:
[{"duration": "4h", "scope": "ip", "type": "ban", "value": "1.2.3.4"}]

The file format is detected from the extension, but can be forced with the --format option
which is required when reading from standard input.

Raw values, standard input:

$ echo "1.2.3.4" | cscli decisions import -i - --format values
```

### Options[​](#options "Direct link to Options")

TEXTCOPY

```
  -i, --input string      Input file
  -d, --duration string   Decision duration: 1h,4h,30m (default "4h")
      --scope string      Decision scope: ip,range,username (default "Ip")
  -R, --reason string     Decision reason: <scenario-name> (default "manual")
  -t, --type string       Decision type: ban,captcha,throttle (default "ban")
      --batch int         Split import in batches of N decisions
      --format string     Input format: 'json', 'csv' or 'values' (each line is a value, no headers)
  -h, --help              help for import
```

### Options inherited from parent commands[​](#options-inherited-from-parent-commands "Direct link to Options inherited from parent commands")

TEXTCOPY

```
      --color string    Output color: yes, no, auto (default "auto")
  -c, --config string   path to crowdsec config file (default "/etc/crowdsec/config.yaml")
      --debug           Set logging to debug
      --error           Set logging to error
      --info            Set logging to info
  -o, --output string   Output format: human, json, raw
      --trace           Set logging to trace
      --warning         Set logging to warning
```

### SEE ALSO[​](#see-also "Direct link to SEE ALSO")

* [cscli decisions](https://docs.crowdsec.net/docs/next/cscli/cscli_decisions.md) - Manage decisions
