def getFileCfg(): """ Try to get fileCfg from LadCfg, if not present fetch it from public settings :return: fileCfg, or None if not set anywhere in the public config """ ladCfg = readPublicConfig('ladCfg') fileCfg = LadUtil.getFileCfgFromLadCfg(ladCfg) if not fileCfg: fileCfg = readPublicConfig('fileCfg') return fileCfg
def get_file_monitoring_config(self): """ Get rsyslog file monitoring (imfile module) config from LAD extension settings. First look up 'ladCfg' and use it if one is there. If not, then get 'fileCfg' at the top level of public settings. :return: List of dictionaries specifying files to monitor and Azure table names for the destinations of the monitored files. E.g.: [ {"file":"/var/log/a.log", "table":"aLog"}, {"file":"/var/log/b.log", "table":"bLog"} ] """ lad_cfg = self.read_public_config('ladCfg') file_cfg = LadUtil.getFileCfgFromLadCfg(lad_cfg) if not file_cfg: file_cfg = self.read_public_config('fileCfg') return file_cfg
def getFileCfg(): ladCfg = readPublicConfig('ladCfg') fileCfg = LadUtil.getFileCfgFromLadCfg(ladCfg) if not fileCfg: fileCfg = readPublicConfig('fileCfg') return fileCfg