Compare commits
9 Commits
add-licens
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7c5ad6abbe | ||
|
|
748f0c5157 | ||
|
|
cc9035cf4e | ||
|
|
d44c2c1d1d | ||
|
|
82b04af0c8 | ||
|
|
4305529bf7 | ||
|
|
8a3fc9ef6c | ||
|
|
41015bdbcd | ||
|
|
5a827f4173 |
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
11
.github/dependabot.yml
vendored
Normal file
11
.github/dependabot.yml
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
# To get started with Dependabot version updates, you'll need to specify which
|
||||
# package ecosystems to update and where the package manifests are located.
|
||||
# Please see the documentation for all configuration options:
|
||||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "gitsubmodule" # See documentation for possible values
|
||||
directory: "/" # Location of package manifests
|
||||
schedule:
|
||||
interval: "daily"
|
||||
21
LICENSE
Normal file
21
LICENSE
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) [year] [fullname]
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@ -5,4 +5,3 @@ required libraries
|
||||
|
||||
https://github.com/oracle/python-cx_Oracle.git
|
||||
|
||||
https://github.com/pyparsing/pyparsing.git
|
||||
|
||||
@ -8,21 +8,14 @@ HOST, PORT = "0.0.0.0", 514
|
||||
OracleUser = ''
|
||||
OraclePasswd = ''
|
||||
OracleServerSid = "localhost/orclpdb1"
|
||||
|
||||
#
|
||||
# NO USER SERVICEABLE PARTS BELOW HERE...
|
||||
#
|
||||
import sys
|
||||
from pyparsing import Word, alphas, Suppress, Combine, nums, string, Optional, Regex
|
||||
from time import strftime
|
||||
import cx_Oracle
|
||||
import config
|
||||
import logging
|
||||
import SocketServer
|
||||
import socketserver
|
||||
import json
|
||||
import threading
|
||||
|
||||
connection = cx_Oracle.connect(OracleUser, OraclePasswd, OracleServerSid)
|
||||
|
||||
connection = cx_Oracle.connect(OracleUser, OraclePasswd, OracleServerSid, threaded = True)
|
||||
cursor = connection.cursor()
|
||||
|
||||
def insert_logging(IP,PRIO,STAMP,HOST,APP,PID,MESS):
|
||||
@ -37,9 +30,8 @@ def insert_logging(IP,PRIO,STAMP,HOST,APP,PID,MESS):
|
||||
:param MESS:
|
||||
:return:
|
||||
"""
|
||||
sql = ('insert into SYSLOG(REMOTEIP,APPNAME,ZEIT,HOSTNAME,PID,PRIORITY,MESSAGE) '
|
||||
'values(:IP,:APP,:STAMP,:HOST,:PID,:PRIO,:MESS)')
|
||||
|
||||
# construct an insert statement that add a new row to the billing_headers table
|
||||
sql = ('insert into SYSLOG(REMOTEIP,APPNAME,ZEIT,HOSTNAME,PID,PRIORITY,MESSAGE) values (:IP,:APP,:STAMP,:HOST,:PID,:PRIO,:MESS)')
|
||||
try:
|
||||
cursor.execute(sql, [IP, APP, STAMP, HOST, PRIO, PID, MESS])
|
||||
connection.commit()
|
||||
@ -48,20 +40,21 @@ def insert_logging(IP,PRIO,STAMP,HOST,APP,PID,MESS):
|
||||
print(error)
|
||||
|
||||
|
||||
class SyslogUDPHandler(SocketServer.BaseRequestHandler):
|
||||
|
||||
class SyslogUDPHandler(socketserver.BaseRequestHandler):
|
||||
def handle(self):
|
||||
data = bytes.decode(self.request[0].strip())
|
||||
socket = self.request[1]
|
||||
print( "%s : " % self.client_address[0], str(data))
|
||||
fields = json.loads(str(data))
|
||||
insert_logging("%s" % self.client_address[0],fields["PRIO"].strip(),fields["TIME"],fields["HOST"],fields["APP"],fields["PID"].strip(),fields["MSG"])
|
||||
print("Recieved one request from {}".format(self.client_address[0]))
|
||||
print("Thread Name:{}".format(threading.current_thread().name))
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
server = SocketServer.UDPServer((HOST,PORT), SyslogUDPHandler)
|
||||
server.serve_forever(poll_interval=0.5)
|
||||
server = socketserver.ThreadingUDPServer((HOST,PORT), SyslogUDPHandler)
|
||||
server.serve_forever()
|
||||
except (IOError, SystemExit):
|
||||
raise
|
||||
except KeyboardInterrupt:
|
||||
|
||||
20
dependabot.yml
Normal file
20
dependabot.yml
Normal file
@ -0,0 +1,20 @@
|
||||
# To get started with Dependabot version updates, you'll need to specify which
|
||||
# package ecosystems to update and where the package manifests are located.
|
||||
# Please see the documentation for all configuration options:
|
||||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "gitsubmodule" # See documentation for possible values
|
||||
directory: "/" # Location of package manifests
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "pip"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
|
||||
@ -1,2 +1 @@
|
||||
git+https://github.com/pyparsing/pyparsing.git#egg=pyparsing
|
||||
git+https://github.com/oracle/python-cx_Oracle.git#egg=cx_Oracle
|
||||
|
||||
@ -14,6 +14,8 @@ CREATE TABLE "SYSLOG"
|
||||
) NO INMEMORY
|
||||
/
|
||||
|
||||
CREATE SEQUENCE "SYSLOG_SEQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 241 CACHE 20 NOORDER NOCYCLE NOKEEP NOSCALE GLOBAL
|
||||
/
|
||||
|
||||
CREATE OR REPLACE EDITIONABLE TRIGGER "BI_SYSLOG"
|
||||
before insert on "SYSLOG"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user