Merge pull request #1456 from wagga40/update-sql-backend

Add a backend option to specify table name for SQL Backend
This commit is contained in:
Florian Roth
2021-05-11 15:00:39 +02:00
committed by GitHub
+9 -2
View File
@@ -43,9 +43,16 @@ class SQLBackend(SingleTextQueryBackend):
mapListValueExpression = "%s OR %s" # Syntax for field/value condititons where map value is a list
mapLength = "(%s %s)"
def __init__(self, sigmaconfig, table):
options = SingleTextQueryBackend.options + (
("table", False, "Use this option to specify table name, default is \"eventlog\"", None),
)
def __init__(self, sigmaconfig, options):
super().__init__(sigmaconfig)
self.table = table
if "table" in options:
self.table = options["table"]
else:
self.table = "eventlog"
def generateANDNode(self, node):
generated = [ self.generateNode(val) for val in node ]