Here is http.yaml.
token and chat_id fictitious
type: http # Don't change
name: http_default # Must match the registered plugin in the profile
# One of "trace", "debug", "info", "warn", "error", "off"
log_level: info
group_wait: 30s # Time to wait collecting alerts before relaying a message to this plugin, eg "30s"
group_threshold: 5 # Amount of alerts that triggers a message before <group_wait> has expired, eg "10"
max_retry: 4 # Number of attempts to relay messages to plugins in case of error
timeout: 4s # Time to wait for response from the plugin before considering the attempt a failure, eg "10s"
format: |
{
"chat_id": "-6354634534567",
"text": "
{{range . -}}
{{$alert := . -}}
{{range .Decisions -}}
{{.Value}} will get {{.Type}} for next {{.Duration}} for triggering {{.Scenario}}.
{{end -}}
{{end -}}
",
"reply_markup": {
"inline_keyboard": [
{{ $arrLength := len . -}}
{{ range $i, $value := . -}}
{{ $V := $value.Source.Value -}}
[
{
"text": "See {{ $V }} on shodan.io",
"url": "https://www.shodan.io/host/{{ $V -}}"
},
{
"text": "See {{ $V }} on crowdsec.net",
"url": "https://app.crowdsec.net/cti/{{ $V -}}"
}
]{{if lt $i ( sub $arrLength 1) }},{{end }}
{{end -}}
]
}
url: https://api.telegram.org/bot54578563453:sdfgsdf_823454k3454345kdfgs/sendMessage
method: POST
headers:
Content-Type: "application/json"
Here is log
time="09-05-2023 10:50:36" level=info msg="received signal for http_default config" @module=http-plugin
time="09-05-2023 10:50:36" level=error msg="Failed to make HTTP request : Post \"%3CHTTP_url%3E\": unsupported protocol scheme \"\"" @module=http-plugin
time="09-05-2023 10:50:36" level=error msg="rpc error: code = Unknown desc = Post \"%3CHTTP_url%3E\": unsupported protocol scheme \"\" error, retry num 1" plugin=http_default
time="09-05-2023 10:50:37" level=error msg="rpc error: code = Unknown desc = Post \"%3CHTTP_url%3E\": unsupported protocol scheme \"\"" plugin:=http_default