Merge pull request #470 from stevengoossensB/master

Mapping the fields in the select statement according to the configuration file
This commit is contained in:
Thomas Patzke 2019-10-16 22:34:28 +02:00 committed by GitHub
commit 02d193c518
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -198,9 +198,11 @@ class QRadarBackend(SingleTextQueryBackend):
qradarPrefix="SELECT "
try:
mappedFields = []
for field in sigmaparser.parsedyaml["fields"]:
mapped = sigmaparser.config.get_fieldmapping(field).resolve_fieldname(field, sigmaparser)
qradarPrefix += str(sigmaparser.parsedyaml["fields"]).strip('[]')
mappedFields.append(mapped)
qradarPrefix += str(mappedFields).strip('[]')
except KeyError: # no 'fields' attribute
mapped = None
qradarPrefix+="UTF8(payload) as search_payload"