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

leave the httpevent outputServers as it is #374

Merged
merged 1 commit into from
Apr 15, 2020
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: 2 additions & 3 deletions splunk_eventgen/eventgen_api_server/eventgen_server_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,17 +579,16 @@ def create_new_hec_key(hostname):
self.discovered_servers = []
for host in hosts:
try:
formatted_hostname = socket.gethostbyname(host)
if new_key:
key = create_new_hec_key(formatted_hostname)
key = create_new_hec_key(host)
except (socket.gaierror, requests.ConnectionError):
self.logger.warning('failed to reach %s, skip...' % host)
continue
except (ValueError, KeyError):
self.logger.warning('failed to setup hec token for %s, skip...' % host)
continue

self.discovered_servers.append({"protocol": str(protocol), "address": str(formatted_hostname), "port": str(hec_port), "key": str(key)})
self.discovered_servers.append({"protocol": str(protocol), "address": str(host), "port": str(hec_port), "key": str(key)})

counter = 1
while True:
Expand Down