Created
April 6, 2019 22:20
-
-
Save dipanjanS/e3359625c2f547ef37cd561f5201b93d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
host_pattern = r'(^\S+\.[\S+\.]+\S+)\s' | |
hosts = [re.search(host_pattern, item).group(1) | |
if re.search(host_pattern, item) | |
else 'no match' | |
for item in sample_logs] | |
hosts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment