Skip to content
Snippets Groups Projects
Commit e0c20e72 authored by Sven Mäder's avatar Sven Mäder :speech_balloon:
Browse files

Finish skeleton logparser

parent a2da30ac
No related branches found
No related tags found
1 merge request!12Deltalogparse
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
import sys import sys
import time import time
import datetime
import re import re
import pprint import pprint
import lib_path import lib_path
...@@ -68,22 +69,24 @@ def main(): ...@@ -68,22 +69,24 @@ def main():
connection.bind() connection.bind()
response = connection.search( reqs_last_run = list()
search_base=search_base, req_start = datetime.datetime.utcnow().strftime('%Y%m%d%H%M%S.%fZ')
search_filter=search_filter,
search_scope=search_scope,
attributes=attributes
)
while True: while True:
start_time = time.perf_counter() start_time = time.perf_counter()
req_start = None
response = connection.search(
search_base=search_base,
search_filter=''.join(['(&', search_filter, '(reqStart>=', req_start, ')',')']),
search_scope=search_scope,
attributes=attributes
)
if response: if response:
#for entry in connection.entries:
# print(entry.entry_dn)
# print(entry['reqStart'])
for entry in connection.response: for entry in connection.response:
if entry['attributes']['reqStart'][0] == req_start:
continue
req_start = entry['attributes']['reqStart'][0] req_start = entry['attributes']['reqStart'][0]
req_type = entry['attributes']['reqType'][0] req_type = entry['attributes']['reqType'][0]
req_dn = entry['attributes']['reqDN'][0] req_dn = entry['attributes']['reqDN'][0]
...@@ -107,15 +110,6 @@ def main(): ...@@ -107,15 +110,6 @@ def main():
if sleep_time > 0: if sleep_time > 0:
time.sleep(sleep_time) time.sleep(sleep_time)
#else:
# time.sleep(update_every)
response = connection.search(
search_base=search_base,
search_filter=search_filter,
search_scope=search_scope,
attributes=attributes
)
if __name__ == '__main__': if __name__ == '__main__':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment