Metadata-Version: 2.4
Name: crowdsec_utils
Version: 0.1.1
Summary: A collection of small scripts to parse crowdsec alert and decision jsons into better json and more descriptive human readable formats
License-Expression: AGPL-3.0-or-later
License-File: LICENSE
Keywords: crowdsec,waf,crs,k8s
Author: JesseBot
Author-email: jessebot@linux.com
Requires-Python: >=3.14,<3.16
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3.15
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: POSIX :: Linux
Requires-Dist: click (>=8.5.1,<9.0.0)
Requires-Dist: rich (>=15.0.0,<16.0.0)
Description-Content-Type: text/markdown

# Crowdsec Utils

A small script to get you rolling parsing crowdsec jsons.

## Example Usage

### Parsing Decisions

```bash
# if using crowdsec on kubernetes, you can do something like this to get the decisions:
# kubectl exec -it deployment/crowdsec-lapi -- /bin/bash -c "cscli decisions list -o json" > crowdsec_decisions.json
cs-utils decisions -f ~/crowdsec_decisions.json
```

### Parsing Alerts

```bash
# if using crowdsec on kubernetes, you can do something like this to get the alerts:
# kubectl exec -it deployment/crowdsec-lapi -- /bin/bash -c "cscli alerts list -o json" > crowdsec_alerts.json
cs-utils alerts -f ~/crowdsec_alerts.json
```

### Formatting

All commands accept `-o` for formatting, but it defaults to pretty printing. To get a usable json, you can do:

```bash
cs-utils alerts -f ~/crowdsec_alerts.json -o json
```

You can then pipe that to something like `jq` to do more special parsing depending on your use case.

## Contributing

Feel free to come in to add features or open up bug reports on codeberg.org. No AI is allowed though.

## License

AGPL. See LICENSE for more info.

