-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from axoflow/webhook-source
syslog-ng: add webhook() and webhook-json() sources
- Loading branch information
Showing
9 changed files
with
325 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tornado==6.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from .source import HTTPSource | ||
|
||
__all__ = [ | ||
"HTTPSource" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
############################################################################# | ||
# Copyright (c) 2024 László Várady | ||
# | ||
# This program is free software; you can redistribute it and/or modify it | ||
# under the terms of the GNU General Public License version 2 as published | ||
# by the Free Software Foundation, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program; if not, write to the Free Software | ||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
# | ||
# As an additional exemption you are allowed to compile & link against the | ||
# OpenSSL libraries as published by the OpenSSL project. See the file | ||
# COPYING for details. | ||
# | ||
############################################################################# | ||
|
||
block source webhook( | ||
port("") | ||
auth_token("") | ||
tls_key_file("") | ||
tls_cert_file("") | ||
|
||
# for client authentication | ||
tls_peer_verify(no) | ||
tls_use_system_cert_store(no) | ||
tls_ca_file("") | ||
tls_ca_dir("") | ||
... | ||
) | ||
{ | ||
python( | ||
class("syslogng.modules.webhook.HTTPSource") | ||
options( | ||
"port" => "`port`" | ||
"auth_token" => "`auth_token`" | ||
"tls_key_file" => "`tls_key_file`" | ||
"tls_cert_file" => "`tls_cert_file`" | ||
|
||
"tls_peer_verify" => `tls_peer_verify` | ||
"tls_use_system_cert_store" => `tls_use_system_cert_store` | ||
"tls_ca_file" => "`tls_ca_file`" | ||
"tls_ca_dir" => "`tls_ca_dir`" | ||
) | ||
`__VARARGS__` | ||
); | ||
}; | ||
|
||
block source webhook-json( | ||
port("") | ||
auth_token("") | ||
prefix("") | ||
tls_key_file("") | ||
tls_cert_file("") | ||
|
||
# for client authentication | ||
tls_peer_verify(no) | ||
tls_use_system_cert_store(no) | ||
tls_ca_file("") | ||
tls_ca_dir("") | ||
... | ||
) | ||
{ | ||
channel { | ||
source { | ||
webhook( | ||
port("`port`") auth_token("`auth_token`") | ||
tls_key_file("`tls_key_file`") tls_cert_file("`tls_cert_file`") | ||
|
||
tls_peer_verify(`tls_peer_verify`) | ||
tls_use_system_cert_store(`tls_use_system_cert_store`) | ||
tls_ca_file("`tls_ca_file`") tls_ca_dir("`tls_ca_dir`") | ||
`__VARARGS__` | ||
); | ||
}; | ||
|
||
parser { | ||
json-parser(prefix("`prefix`")); | ||
}; | ||
}; | ||
}; |
Oops, something went wrong.