Skip to content

Commit 068bb48

Browse files
[Bug] Incorrect Integrations Schema Parsing for Nested Fields (#5058)
* Add proper handling for nested fields * Updated schemas * bump patch --------- Co-authored-by: Mika Ayenson, PhD <[email protected]> (cherry picked from commit cbb892b)
1 parent 8c5679a commit 068bb48

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+6
-2
lines changed

detection_rules/beats.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,11 @@ def _flatten_schema(schema: list[dict[str, Any]] | None, prefix: str = "") -> li
128128

129129
flattened.extend(_flatten_schema(s["fields"], prefix=nested_prefix))
130130
elif "fields" in s:
131-
flattened.extend(_flatten_schema(s["fields"], prefix=prefix))
131+
if s.get("name") and s.get("type") == "nested":
132+
nested_prefix = prefix + s["name"] + "."
133+
flattened.extend(_flatten_schema(s["fields"], prefix=nested_prefix))
134+
else:
135+
flattened.extend(_flatten_schema(s["fields"], prefix=prefix))
132136
elif "name" in s:
133137
_s = s.copy()
134138
# type is implicitly keyword if not defined
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)