syslog ui: filter new style log directories accordingly. when using suricata, there already is a directory called suricata for example with a stats.log in it. we should only try to fetch files which match the pattern:

/var/log/[app]/[component]/component_*.log
/var/log/[component]/component_*.log
This commit is contained in:
Ad Schellevis 2020-08-04 10:02:03 +02:00
parent 9e4f0dea30
commit 6dbd1d4abc

View File

@ -64,7 +64,7 @@ if __name__ == '__main__':
)
if os.path.isdir(log_basename):
# new syslog-ng local targets use an extra directory level
for filename in sorted(glob.glob("%s/*.log" % log_basename), reverse=True):
for filename in sorted(glob.glob("%s/%s_*.log" % (log_basename, log_basename.split('/')[-1].split('.')[0])), reverse=True):
log_filenames.append(filename)
# legacy log output is always stiched last
log_filenames.append("%s.log" % log_basename)