Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to parse specific values passed to notify by id #287

Open
ResistanceIsUseless opened this issue Jul 18, 2023 · 0 comments
Open
Labels
Type: Enhancement Most issues will probably ask for additions or changes.

Comments

@ResistanceIsUseless
Copy link

ResistanceIsUseless commented Jul 18, 2023

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.

@ResistanceIsUseless ResistanceIsUseless added the Type: Enhancement Most issues will probably ask for additions or changes. label Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Most issues will probably ask for additions or changes.
Projects
None yet
Development

No branches or pull requests

1 participant