Skip to content

Commit

Permalink
Print ruleset warning messages in wazuh-logtest
Browse files Browse the repository at this point in the history
  • Loading branch information
juliancnn committed Nov 12, 2021
1 parent 6531bb5 commit b9d02ad
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions framework/scripts/wazuh-logtest.py
Expand Up @@ -97,6 +97,7 @@ def main():

# Main processing loop
session_token = str()

while True:
# Get user input
try:
Expand Down Expand Up @@ -133,6 +134,16 @@ def main():
if session_token and session_token != output['token']:
logging.warning('New session was created with token "%s"', output['token'])

# Show the warning messages
if 'messages' in output.keys():
do_print_newline = False
for message in output['messages']:
if message.startswith("WARNING"):
logging.warning('** Wazuh-Logtest: %s', message)
do_print_newline = True
if do_print_newline:
logging.warning('')

# Continue using last available session
session_token = output['token']

Expand Down

0 comments on commit b9d02ad

Please sign in to comment.