Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ansible/library/extract_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
short_description: Unrotate logs and extract information starting from a row with predefined string
description: The module scans the 'directory' in search of files which filenames start with 'file_prefix'.
The found files are ungzipped and combined together in the rotation order. After that all lines after
'start_string' are copied into a file with name 'target_filename'.
'start_string' are copied into a file with name 'target_filename'. All input strings with 'nsible' in it
aren't considered as 'start_string' to avoid clashing with ansible output.

Options:
- option-name: directory
Expand Down Expand Up @@ -91,7 +92,7 @@ def extract_line(directory, filename, target_string):
file = open(path)
result = None
with file:
result = [(filename, line) for line in file if target_string in line]
result = [(filename, line) for line in file if target_string in line and 'nsible' not in line]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nsible? not ansible?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. To match both 'Ansible' and 'ansible'.

return result


Expand Down