Add option to parse specific values passed to notify by id
ResistanceIsUseless opened this issue · comments
It would be nice to be able to parse and filter json thats passed to notify. Using something like jq, jsonata or JMESPath would be really useful.
For example, today if I wanted to do this with jq I would run the following query to show only results that match severity of info.
nuclei -silent -u https://site.tld -j | jq 'select(.info.severity == "info") | {host, "template-id": .["template-id"]}' | notify
I'm thinking adding this into notify would be nice so you could have filtering by id.
discord:
- id: "nuclei"
discord_channel: "nuclei"
discord_username: "info"
discord_format: "{{data}}"
discord_webhook_url:
json_query: "select(.info.severity == "info") | {host, "template-id": .["template-id"]}"
- id: "subfinder"
discord_channel: "subs"
discord_username: "subs"
discord_format: "{{data}}"
discord_webhook_url:
json_query: ".host"
I know this is kind of a unique enhancement and does add some complexity so you wouldn't be sending output in some cases and I haven't really considered all the impacts. Figured I would throw out the idea because it would be nice to have these types of things in a config.