Skip to content

Commit

Permalink
Correct posible type casting issue (#546)
Browse files Browse the repository at this point in the history
* Update fix_dns.conf

* Update fix_dns.conf
  • Loading branch information
Ryan Faircloth authored and GitHub committed Jun 25, 2020
1 parent e3767f8 commit b9eea97
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions package/etc/conf.d/conflib/_splunk/fix_dns.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ class FixHostResolver(object):
try:
ipaddr = log_message['HOST'].decode('utf-8')

resolved = socket.gethostbyaddr(ipaddr)
hostname = resolved[0]
name, ext = hostname.split('.')[-2:]
hostname, aliaslist, ipaddrlist = socket.gethostbyaddr(ipaddr)
name = str(hostname).split('.')[0]
log_message['HOST'] = name
except:
pass
Expand Down

0 comments on commit b9eea97

Please sign in to comment.