Skip to content

Commit

Permalink
Don't require docs on date_range sub-keys
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewvc committed Dec 12, 2019
1 parent 1a7c1f4 commit 0150408
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libbeat/tests/system/beat/beat.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,7 @@ def field_pattern_match(pattern, key):
return True

def is_documented(key, docs):
#print("docs {}".format(docs))
if key in docs:
return True
for pattern in (f for f in docs if "*" in f):
Expand All @@ -683,7 +684,9 @@ def is_documented(key, docs):

for key in flat.keys():
metaKey = key.startswith('@metadata.')
if not(is_documented(key, expected_fields) or metaKey):
# Range keys as used in 'date_range' etc will not have docs of course
isRangeKey = key.split('.')[-1] in ['gte', 'gt', 'lte', 'lt'];
if not(is_documented(key, expected_fields) or metaKey or isRangeKey):
raise Exception("Key '{}' found in event is not documented!".format(key))
if is_documented(key, aliases):
raise Exception("Key '{}' found in event is documented as an alias!".format(key))
Expand Down

0 comments on commit 0150408

Please sign in to comment.