pySigma-backend-sqlite 1.2.2__tar.gz → 1.2.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pySigma-backend-sqlite
3
- Version: 1.2.2
3
+ Version: 1.2.4
4
4
  Summary: pySigma sqlite backend
5
5
  License-Expression: LGPL-3.0-only
6
6
  License-File: LICENSE
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pySigma-backend-sqlite"
3
- version = "1.2.2"
3
+ version = "1.2.4"
4
4
  description = "pySigma sqlite backend"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -414,6 +414,12 @@ class sqliteBackend(TextQueryBackend):
414
414
 
415
415
  search = self.convert_correlation_search(rule)
416
416
 
417
+ # Correlation search templates hardcode "FROM logs"; honor a "table" state
418
+ # key set by a setState transformation, matching finalize_query_default.
419
+ table = self.last_processing_pipeline.state.get("table")
420
+ if table is not None:
421
+ search = search.replace("FROM logs", f"FROM {table}")
422
+
417
423
  # Determine select_fields based on whether GROUP BY is used
418
424
  if rule.group_by:
419
425
  # When GROUP BY is used, only select the grouped fields
@@ -633,7 +639,10 @@ class sqliteBackend(TextQueryBackend):
633
639
  # TODO : fields support will be handled with a backend option (all fields by default)
634
640
  # fields = "*" if len(rule.fields) == 0 else f"*, {', '.join(rule.fields)}"
635
641
 
636
- sqlite_query = f"SELECT * FROM {self.table} WHERE {query}"
642
+ # Table name can be overridden per-pipeline via a setState transformation
643
+ # setting the "table" state key, else fall back to the backend default.
644
+ table = state.processing_state.get("table", self.table)
645
+ sqlite_query = f"SELECT * FROM {table} WHERE {query}"
637
646
 
638
647
  return sqlite_query
639
648