Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replay.py Incorrect variable reference in exchange timestamp #787

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 6 additions & 5 deletions bin/replay.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def manipulate_timestamp_exchange_logs(self, file_path):
difference = now - latest_event
f.close()

for line in fileinput.input(path, inplace=True):
for line in fileinput.input(file_path, inplace=True):
d = json.loads(line)
original_time = datetime.strptime(d["CreationTime"],"%Y-%m-%dT%H:%M:%S")
new_time = (difference + original_time)
Expand Down Expand Up @@ -136,7 +136,7 @@ def send_to_splunk(settings):
try:
service = client.connect(host=settings['splunk']['host'], port=8089, username=settings['splunk']['username'], password=settings['splunk']['password'])
except ConnectionRefusedError as e:
print("ERROR - could not connect to the splunk server {}:8089".format(settings['splunk']['host']))
print("ERROR - could not connect to the splunk server {}:8089 - {}".format(settings['splunk']['host'], e))
sys.exit(1)

# go through all datasets
Expand All @@ -153,15 +153,16 @@ def send_to_splunk(settings):

# update timestamps before replay
if 'update_timestamp' in dataset['replay_parameters']:
if dataset['replay_parameters']['update_timestamp'] == True:
data_manipulation = DataManipulation()
data_manipulation.manipulate_timestamp(fullpath, dataset['replay_parameters']['sourcetype'], dataset['replay_parameters']['source'])
if dataset['replay_parameters']['update_timestamp'] == True:
data_manipulation = DataManipulation()
data_manipulation.manipulate_timestamp(fullpath, dataset['replay_parameters']['sourcetype'], dataset['replay_parameters']['source'])

# upload file
kwargs_submit = dict()
kwargs_submit['sourcetype'] = dataset['replay_parameters']['sourcetype']
kwargs_submit['rename-source'] = dataset['replay_parameters']['source']
results = index.upload(fullpath, **kwargs_submit)
print(results)
return True

def parse_config(CONFIG_PATH, VERBOSE):
Expand Down