import os
import socket
import inspect
+from systemd import journal
+from datetime import datetime, timedelta
import logging
logger = logging.getLogger(__name__)
from pkg_resources import Requirement, resource_filename
-from . import config
+from logparse import config
def hostname(path): # get the hostname of current server
hnfile = open(path, 'r')
else:
return domain[-1]
-def resolve(ip, fqdn = 'host-only'): # try to resolve an ip to hostname
+def resolve(ip, fqdn=None): # try to resolve an ip to hostname
# Possible values for fqdn:
# fqdn show full hostname and domain
# fqdn-implicit show hostname and domain unless local
# resolve-domains defined in individual sections of the config take priority over global config
if not fqdn:
- fqdn = config.prefs['resolve-domains']
+ fqdn = config.prefs.get("logparse", "resolve-domains")
if fqdn == 'ip':
return(ip)